forked from axios/axios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
axios.d.ts
66 lines (55 loc) · 1.76 KB
/
axios.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// Type definitions for Axios v0.8.1
// Project: https://github.com/mzabriskie/axios
declare var axios: axios.AxiosStatic
declare module axios {
interface AxiosRequestMethods {
get(url: string, config?: any): axios.Promise;
delete(url: string, config?: any): axios.Promise;
head(url: string, config?: any): axios.Promise;
post(url: string, data?: any, config?: any): axios.Promise;
put(url: string, data?: any, config?: any): axios.Promise;
patch(url: string, data?: any, config?: any): axios.Promise;
}
interface AxiosStatic extends AxiosRequestMethods {
(options: axios.RequestOptions): axios.Promise;
create(defaultOptions?: axios.InstanceOptions): AxiosInstance;
all(iterable: any): axios.Promise;
spread(callback: any): axios.Promise;
}
interface AxiosInstance extends AxiosRequestMethods {
request(options: axios.RequestOptions): axios.Promise;
}
interface Response {
data?: any;
status?: number;
statusText?: string;
headers?: any;
config?: any;
}
interface Promise {
then(onFulfilled:(response: axios.Response) => void): axios.Promise;
catch(onRejected:(response: axios.Response) => void): axios.Promise;
}
interface InstanceOptions {
transformRequest?: (data: any) => any;
transformResponse?: (data: any) => any;
headers?: any;
timeout?: number;
withCredentials?: boolean;
responseType?: string;
xsrfCookieName?: string;
xsrfHeaderName?: string;
paramsSerializer?: (params: any) => string;
baseURL?: string;
progress?: (progressEvent: ProgressEvent) => void;
}
interface RequestOptions extends InstanceOptions {
url: string;
method?: string;
params?: any;
data?: any;
}
}
declare module "axios" {
export = axios;
}