@@ -47,7 +47,7 @@ export interface TransitionalOptions{
47
47
clarifyTimeoutError : boolean ;
48
48
}
49
49
50
- export interface AxiosRequestConfig < T = any > {
50
+ export interface AxiosRequestConfig < D = any > {
51
51
url ?: string ;
52
52
method ?: Method ;
53
53
baseURL ?: string ;
@@ -56,7 +56,7 @@ export interface AxiosRequestConfig<T = any> {
56
56
headers ?: Record < string , string > ;
57
57
params ?: any ;
58
58
paramsSerializer ?: ( params : any ) => string ;
59
- data ?: T ;
59
+ data ?: D ;
60
60
timeout ?: number ;
61
61
timeoutErrorMessage ?: string ;
62
62
withCredentials ?: boolean ;
@@ -81,20 +81,20 @@ export interface AxiosRequestConfig<T = any> {
81
81
signal ?: AbortSignal ;
82
82
}
83
83
84
- export interface AxiosResponse < T = never > {
84
+ export interface AxiosResponse < T = never , D = any > {
85
85
data : T ;
86
86
status : number ;
87
87
statusText : string ;
88
88
headers : Record < string , string > ;
89
- config : AxiosRequestConfig < T > ;
89
+ config : AxiosRequestConfig < D > ;
90
90
request ?: any ;
91
91
}
92
92
93
- export interface AxiosError < T = never > extends Error {
94
- config : AxiosRequestConfig ;
93
+ export interface AxiosError < T = never , D = any > extends Error {
94
+ config : AxiosRequestConfig < D > ;
95
95
code ?: string ;
96
96
request ?: any ;
97
- response ?: AxiosResponse < T > ;
97
+ response ?: AxiosResponse < T , D > ;
98
98
isAxiosError : boolean ;
99
99
toJSON : ( ) => object ;
100
100
}
@@ -143,14 +143,14 @@ export class Axios {
143
143
response : AxiosInterceptorManager < AxiosResponse > ;
144
144
} ;
145
145
getUri ( config ?: AxiosRequestConfig ) : string ;
146
- request < T = never , R = AxiosResponse < T > > ( config : AxiosRequestConfig < T > ) : Promise < R > ;
147
- get < T = never , R = AxiosResponse < T > > ( url : string , config ?: AxiosRequestConfig < T > ) : Promise < R > ;
148
- delete < T = never , R = AxiosResponse < T > > ( url : string , config ?: AxiosRequestConfig < T > ) : Promise < R > ;
149
- head < T = never , R = AxiosResponse < T > > ( url : string , config ?: AxiosRequestConfig < T > ) : Promise < R > ;
150
- options < T = never , R = AxiosResponse < T > > ( url : string , config ?: AxiosRequestConfig < T > ) : Promise < R > ;
151
- post < T = never , R = AxiosResponse < T > > ( url : string , data ?: T , config ?: AxiosRequestConfig < T > ) : Promise < R > ;
152
- put < T = never , R = AxiosResponse < T > > ( url : string , data ?: T , config ?: AxiosRequestConfig < T > ) : Promise < R > ;
153
- patch < T = never , R = AxiosResponse < T > > ( url : string , data ?: T , config ?: AxiosRequestConfig < T > ) : Promise < R > ;
146
+ request < T = never , R = AxiosResponse < T > , D = any > ( config : AxiosRequestConfig < D > ) : Promise < R > ;
147
+ get < T = never , R = AxiosResponse < T > , D = any > ( url : string , config ?: AxiosRequestConfig < D > ) : Promise < R > ;
148
+ delete < T = never , R = AxiosResponse < T > , D = any > ( url : string , config ?: AxiosRequestConfig < D > ) : Promise < R > ;
149
+ head < T = never , R = AxiosResponse < T > , D = any > ( url : string , config ?: AxiosRequestConfig < D > ) : Promise < R > ;
150
+ options < T = never , R = AxiosResponse < T > , D = any > ( url : string , config ?: AxiosRequestConfig < D > ) : Promise < R > ;
151
+ post < T = never , R = AxiosResponse < T > , D = any > ( url : string , data ?: D , config ?: AxiosRequestConfig < D > ) : Promise < R > ;
152
+ put < T = never , R = AxiosResponse < T > , D = any > ( url : string , data ?: D , config ?: AxiosRequestConfig < D > ) : Promise < R > ;
153
+ patch < T = never , R = AxiosResponse < T > , D = any > ( url : string , data ?: D , config ?: AxiosRequestConfig < D > ) : Promise < R > ;
154
154
}
155
155
156
156
export interface AxiosInstance extends Axios {
0 commit comments