mirror of
https://github.com/tenrok/axios.git
synced 2026-06-08 17:22:34 +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 {
|
||||
url?: string;
|
||||
method?: 'get' | 'delete' | 'head' | 'options' | 'post' | 'put' | 'patch';
|
||||
method?: Method;
|
||||
baseURL?: string;
|
||||
transformRequest?: AxiosTransformer | AxiosTransformer[];
|
||||
transformResponse?: AxiosTransformer | AxiosTransformer[];
|
||||
@@ -34,7 +51,7 @@ export interface AxiosRequestConfig {
|
||||
withCredentials?: boolean;
|
||||
adapter?: AxiosAdapter;
|
||||
auth?: AxiosBasicCredentials;
|
||||
responseType?: 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream';
|
||||
responseType?: ResponseType;
|
||||
xsrfCookieName?: string;
|
||||
xsrfHeaderName?: string;
|
||||
onUploadProgress?: (progressEvent: any) => void;
|
||||
|
||||
Reference in New Issue
Block a user