1 | import { RequestInit, Response } from "node-fetch";
|
2 | declare type Url<S extends string> = S extends `http${infer A}` ? S : never;
|
3 | declare type IsUrl<S extends string> = Url<S> extends never ? false : true;
|
4 | declare type Extname<S extends string> = S extends `${infer A}.${infer B}` ? B : never;
|
5 | declare type HasExt<S extends string> = Extname<S> extends never ? false : true;
|
6 | interface DirOptions {
|
7 | recursive?: boolean;
|
8 | }
|
9 | declare function fetch<T extends string, Opts = IsUrl<T> extends true ? RequestInit : HasExt<T> extends true ? never : DirOptions>(url: T, opts?: Opts): Promise<Response>;
|
10 | export default fetch;
|