@labeg/tfetch 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/contructors/TsFetch.d.ts +5 -3
- package/dist/index.d.ts +2 -3
- package/package.json +1 -1
|
@@ -17,10 +17,12 @@ export interface TsRequestInit<T> extends Omit<RequestInit, "body"> {
|
|
|
17
17
|
}
|
|
18
18
|
export declare class TsFetch {
|
|
19
19
|
protected readonly requestCache: Map<string, [PromiseResRej, PromiseResRej][]>;
|
|
20
|
+
/**
|
|
21
|
+
* Overloads
|
|
22
|
+
*/
|
|
20
23
|
send(options: TsRequestInit<void>): Promise<void>;
|
|
21
|
-
send<T extends boolean>(options: TsRequestInit<T>): Promise<T>;
|
|
22
|
-
send<T extends number>(options: TsRequestInit<T>): Promise<T>;
|
|
23
|
-
send<T extends string>(options: TsRequestInit<T>): Promise<T>;
|
|
24
|
+
send<T extends (boolean | number | string)>(options: TsRequestInit<T>): Promise<T>;
|
|
25
|
+
send<T extends (boolean | number | string)[]>(options: TsRequestInit<T>): Promise<T>;
|
|
24
26
|
send<T>(options: TsRequestInit<new () => T>): Promise<T>;
|
|
25
27
|
send<T>(options: TsRequestInit<[new () => T]>): Promise<T[]>;
|
|
26
28
|
protected handleError(response: Response): Promise<Response>;
|
package/dist/index.d.ts
CHANGED
|
@@ -6,9 +6,8 @@ declare const instance: TsFetch;
|
|
|
6
6
|
export declare const tfetch: typeof instance.send;
|
|
7
7
|
export declare const tf: {
|
|
8
8
|
(options: import("./contructors/TsFetch.js").TsRequestInit<void>): Promise<void>;
|
|
9
|
-
<T extends boolean>(options: import("./contructors/TsFetch.js").TsRequestInit<T>): Promise<T>;
|
|
10
|
-
<T extends number>(options: import("./contructors/TsFetch.js").TsRequestInit<T>): Promise<T>;
|
|
11
|
-
<T extends string>(options: import("./contructors/TsFetch.js").TsRequestInit<T>): Promise<T>;
|
|
9
|
+
<T extends (boolean | number | string)>(options: import("./contructors/TsFetch.js").TsRequestInit<T>): Promise<T>;
|
|
10
|
+
<T extends (boolean | number | string)[]>(options: import("./contructors/TsFetch.js").TsRequestInit<T>): Promise<T>;
|
|
12
11
|
<T>(options: import("./contructors/TsFetch.js").TsRequestInit<new () => T>): Promise<T>;
|
|
13
12
|
<T>(options: import("./contructors/TsFetch.js").TsRequestInit<[new () => T]>): Promise<T[]>;
|
|
14
13
|
};
|