@delta-comic/request 1.3.0 → 1.3.1
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/lib/abort.d.ts +8 -0
- package/dist/lib/axios.d.ts +39 -0
- package/dist/lib/index.d.ts +9 -0
- package/dist/pack.tgz +0 -0
- package/package.json +2 -2
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { AxiosError, AxiosResponse, AxiosInstance, CreateAxiosDefaults, AxiosRequestConfig } from 'axios';
|
|
2
|
+
export declare const checkType: {
|
|
3
|
+
isPost: (v: {
|
|
4
|
+
config: {
|
|
5
|
+
method?: string;
|
|
6
|
+
};
|
|
7
|
+
}) => boolean;
|
|
8
|
+
isPut: (v: {
|
|
9
|
+
config: {
|
|
10
|
+
method?: string;
|
|
11
|
+
};
|
|
12
|
+
}) => boolean;
|
|
13
|
+
isGet: (v: {
|
|
14
|
+
config: {
|
|
15
|
+
method?: string;
|
|
16
|
+
};
|
|
17
|
+
}) => boolean;
|
|
18
|
+
};
|
|
19
|
+
export declare const interceptors: {
|
|
20
|
+
checkIsAxiosError<T extends object>(err: any): err is AxiosError<T, any>;
|
|
21
|
+
useUnreadableRetry<T extends () => Promise<AxiosResponse>>(fn: T, times?: number): Promise<Awaited<ReturnType<T>>["data"]>;
|
|
22
|
+
useForceRetry<T extends () => Promise<AxiosResponse>>(fn: T, times?: number): Promise<Awaited<ReturnType<T>>["data"]>;
|
|
23
|
+
createAutoRetry(api: AxiosInstance, times?: number): (err: any) => Promise<AxiosResponse<any, any, {}>>;
|
|
24
|
+
isClientError(err: any): Promise<never>;
|
|
25
|
+
passCorsError(err: any): Promise<never>;
|
|
26
|
+
};
|
|
27
|
+
export type Requester = ReturnType<typeof createAxios>;
|
|
28
|
+
export declare const createAxios: (fork: () => Promise<string> | string, config?: CreateAxiosDefaults & Partial<{
|
|
29
|
+
noPassClientError: boolean;
|
|
30
|
+
}>, middle?: (axios: AxiosInstance) => AxiosInstance) => {
|
|
31
|
+
get: <T>(url: string, config?: AxiosRequestConfig) => Promise<T>;
|
|
32
|
+
post: <T>(url: string, data?: any, config?: AxiosRequestConfig) => Promise<T>;
|
|
33
|
+
postForm: <T>(url: string, data?: any, config?: AxiosRequestConfig) => Promise<T>;
|
|
34
|
+
put: <T>(url: string, data?: any, config?: AxiosRequestConfig) => Promise<T>;
|
|
35
|
+
putForm: <T>(url: string, data?: any, config?: AxiosRequestConfig) => Promise<T>;
|
|
36
|
+
delete: <T>(url: string, config?: AxiosRequestConfig) => Promise<T>;
|
|
37
|
+
patch: <T>(url: string, data?: any, config?: AxiosRequestConfig) => Promise<T>;
|
|
38
|
+
patchForm: <T>(url: string, data?: any, config?: AxiosRequestConfig) => Promise<T>;
|
|
39
|
+
};
|
package/dist/pack.tgz
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@delta-comic/request",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "空阙虱楼",
|
|
5
5
|
"homepage": "https://github.com/delta-comic/delta-comic",
|
|
6
6
|
"license": "AGPL-3.0-only",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"axios": "^1.13",
|
|
42
|
-
"@delta-comic/utils": "1.3.
|
|
42
|
+
"@delta-comic/utils": "1.3.1"
|
|
43
43
|
},
|
|
44
44
|
"release": {
|
|
45
45
|
"tagFormat": "request-${version}"
|