mirror of
https://github.com/tenrok/axios.git
synced 2026-05-21 13:24:11 +03:00
50 lines
1.2 KiB
TypeScript
50 lines
1.2 KiB
TypeScript
// Type definitions for Axios v0.7.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(onFulfilled:(response: axios.Response) => void): axios.Promise;
|
|
catch(onRejected:(response: axios.Response) => void): 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;
|
|
}
|