-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypding.d.ts
40 lines (34 loc) · 992 Bytes
/
typding.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
export interface AxiosRequestConfig {
url: string
method: 'get' | 'post' | 'put' | 'delete'
headers: Record<string, string>
timeout: number
responseType: 'json' | 'text'
params?: Record<string, string | number>
paramsSerializer?: (params: AxiosRequestConfig['params']) => string
data?: Record<string, any>
transformRequestData: Array<
(
data: AxiosRequestConfig['data'],
headers: AxiosRequestConfig['headers']
) => any
>
transformResponse: Array<(data: any) => any>
// onUploadProgress: (e: ProgressEvent) => void
// onDownloadProgress: (e: ProgressEvent) => void
adapter: (config: AxiosRequestConfig) => Promise<AxiosResponse>
// cancelToken: any
}
export interface AxiosResponse<T = any> {
data: T
status: number
headers: any
config: AxiosRequestConfig
request: XMLHttpRequest
}
export interface AxiosError extends Error {
code: number | null
request: XMLHttpRequest
response?: AxiosResponse
isAxiosError: boolean
}