Skip to content

Commit dd16944

Browse files
FitzpasdJustinBeckwith
authored andcommitted
Adding better 'responseType' and 'method' type definitions by using a string literal union type of possible values (axios#1148)
1 parent 8e3b50c commit dd16944

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export interface AxiosProxyConfig {
2222

2323
export interface AxiosRequestConfig {
2424
url?: string;
25-
method?: string;
25+
method?: 'get' | 'delete' | 'head' | 'options' | 'post' | 'put' | 'patch';
2626
baseURL?: string;
2727
transformRequest?: AxiosTransformer | AxiosTransformer[];
2828
transformResponse?: AxiosTransformer | AxiosTransformer[];
@@ -34,7 +34,7 @@ export interface AxiosRequestConfig {
3434
withCredentials?: boolean;
3535
adapter?: AxiosAdapter;
3636
auth?: AxiosBasicCredentials;
37-
responseType?: string;
37+
responseType?: 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream';
3838
xsrfCookieName?: string;
3939
xsrfHeaderName?: string;
4040
onUploadProgress?: (progressEvent: any) => void;

0 commit comments

Comments
 (0)