forked from axios/axios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaxios.d.ts
49 lines (41 loc) · 1.2 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
// Type definitions for Axios v0.6.0
// Project: https://github.com/mzabriskie/axios
declare var axios: axios.AxiosStatic
declare module axios {
interface AxiosStatic {
(options: axios.RequestOptions): axios.Promise;
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;
all(iterable: any): axios.Promise;
spread(callback: any): axios.Promise;
}
interface Response {
data?: any;
status?: number;
headers?: any;
config?: any;
}
interface Promise {
then(response: axios.Response): axios.Promise;
catch(response: axios.Response): axios.Promise;
}
interface RequestOptions {
url: string;
method?: string;
transformRequest?: (data: any) => any;
headers?: any;
params?: any;
data?: any;
withCredentials?: boolean;
responseType?: string;
xsrfCookieName?: string;
xsrfHeaderName?: string;
}
}
declare module "axios" {
export = axios;
}