mirror of
https://github.com/tenrok/axios.git
synced 2026-06-20 20:00:40 +03:00
cleaner definitions with union types. (#1551)
This commit is contained in:
committed by
Justin Beckwith
parent
787c808c04
commit
84388b0389
Vendored
+19
-2
@@ -20,9 +20,26 @@ export interface AxiosProxyConfig {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type Method =
|
||||||
|
| 'get'
|
||||||
|
| 'delete'
|
||||||
|
| 'head'
|
||||||
|
| 'options'
|
||||||
|
| 'post'
|
||||||
|
| 'put'
|
||||||
|
| 'patch'
|
||||||
|
|
||||||
|
export type ResponseType =
|
||||||
|
| 'arraybuffer'
|
||||||
|
| 'blob'
|
||||||
|
| 'document'
|
||||||
|
| 'json'
|
||||||
|
| 'text'
|
||||||
|
| 'stream'
|
||||||
|
|
||||||
export interface AxiosRequestConfig {
|
export interface AxiosRequestConfig {
|
||||||
url?: string;
|
url?: string;
|
||||||
method?: 'get' | 'delete' | 'head' | 'options' | 'post' | 'put' | 'patch';
|
method?: Method;
|
||||||
baseURL?: string;
|
baseURL?: string;
|
||||||
transformRequest?: AxiosTransformer | AxiosTransformer[];
|
transformRequest?: AxiosTransformer | AxiosTransformer[];
|
||||||
transformResponse?: AxiosTransformer | AxiosTransformer[];
|
transformResponse?: AxiosTransformer | AxiosTransformer[];
|
||||||
@@ -34,7 +51,7 @@ export interface AxiosRequestConfig {
|
|||||||
withCredentials?: boolean;
|
withCredentials?: boolean;
|
||||||
adapter?: AxiosAdapter;
|
adapter?: AxiosAdapter;
|
||||||
auth?: AxiosBasicCredentials;
|
auth?: AxiosBasicCredentials;
|
||||||
responseType?: 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream';
|
responseType?: ResponseType;
|
||||||
xsrfCookieName?: string;
|
xsrfCookieName?: string;
|
||||||
xsrfHeaderName?: string;
|
xsrfHeaderName?: string;
|
||||||
onUploadProgress?: (progressEvent: any) => void;
|
onUploadProgress?: (progressEvent: any) => void;
|
||||||
|
|||||||
Reference in New Issue
Block a user