@@ -17,40 +17,37 @@ export type RequestUriParams = Params;
17
17
export type RequestSearchParams = URLSearchParams | Params ;
18
18
19
19
export enum ResponseTypes {
20
- json = 'application/json' ,
21
- text = 'text/*' ,
22
- formData = 'multipart/form-data' ,
23
- blob = '*/*' ,
20
+ JSON = 'application/json' ,
21
+ TEXT = 'text/*' ,
22
+ FORM_DATA = 'multipart/form-data' ,
23
+ BLOB = '*/*' ,
24
24
}
25
25
26
26
export enum Header {
27
27
CONTENT_TYPE = 'Content-Type' ,
28
28
}
29
29
30
- export interface RequestConfig extends Omit < RequestInit , 'body' | 'headers' | 'method' > {
30
+ export interface FullRequestConfig extends Omit < RequestInit , 'body' | 'headers' | 'method' > {
31
31
// `baseURL` will be prepended to `url` unless `url` is absolute.
32
32
// It can be convenient to set `baseURL` for an instance of axios to pass relative URLs
33
33
// to methods of that instance.
34
- baseURL ? : string ;
34
+ baseURL : string ;
35
35
36
- responseType ? : ResponseType ;
36
+ responseType : ResponseType ;
37
37
38
- uriParams ? : RequestUriParams ;
38
+ uriParams : RequestUriParams ;
39
39
40
- headers ? : RequestHeaders ;
40
+ headers : RequestHeaders ;
41
41
42
- searchParams ? : RequestSearchParams ;
42
+ searchParams : RequestSearchParams ;
43
43
}
44
44
45
+ export type RequestConfig = Partial < FullRequestConfig > ;
46
+
45
47
export interface GeneralConfig {
46
48
logger : Logger ;
47
49
}
48
50
49
- export interface DefaultRequestConfig extends RequestConfig {
50
- headers : RequestHeaders ;
51
- responseType : ResponseType ;
52
- }
53
-
54
51
export interface RequestResult {
55
52
request : Request ;
56
53
response : Response ;
0 commit comments