@@ -165,15 +165,14 @@ export interface IRequestOld {
165
165
166
166
export type IOldReqOptions = Omit < RequestPromiseOptions & {
167
167
url : string
168
- resolveWithFullResponse ?: true
169
168
} , 'auth' >
170
169
171
170
export type IOldReqOptionsWithFullResponse = IOldReqOptions & {
172
171
resolveWithFullResponse : true
173
172
}
174
173
175
174
export type IOldReqOptionsWithJSON = IOldReqOptions & {
176
- json : boolean
175
+ json : true
177
176
}
178
177
179
178
/**
@@ -200,15 +199,15 @@ export type IFullResponse<T = any, U = any> = AxiosResponse<T, U> & {
200
199
body : T
201
200
}
202
201
203
- export type AxiosResponse < T = any , U = any > = import ( 'axios' ) . AxiosResponse < T , U >
202
+ type AxiosResponse < T = any , U = any > = import ( 'axios' ) . AxiosResponse < T , U >
204
203
205
- export type AxiosRequestConfig < T = any > = import ( 'axios' ) . AxiosRequestConfig < T >
204
+ type AxiosRequestConfig < T = any > = import ( 'axios' ) . AxiosRequestConfig < T >
206
205
207
206
interface IRequestOptionsWithFullResponse {
208
207
resolveWithFullResponse : true
209
208
}
210
209
211
- interface IRequestOptionsWithJson {
210
+ interface IRequestOptionsWithJSON {
212
211
json : true
213
212
}
214
213
@@ -220,12 +219,14 @@ interface IRequestOptionsWithResponseTypeArrayBuffer {
220
219
* T is the response data type
221
220
* U is the config type
222
221
*/
223
- export type IResponse < T , U > = U extends IRequestOptionsWithFullResponse
224
- ? IFullResponse < T , U >
225
- : U extends IRequestOptionsWithJson
226
- ? T
227
- : U extends IRequestOptionsWithResponseTypeArrayBuffer ?
228
- Buffer : string
222
+ export type IResponse < T , U > = U extends IRequestOptionsWithFullResponse ? IFullResponse < T , U >
223
+ : U extends IRequestOptionsWithJSON ? T
224
+ : U extends IRequestOptionsWithResponseTypeArrayBuffer ? Buffer
225
+ : U extends IOldReqOptionsWithFullResponse ? IFullResponse < T , U >
226
+ : U extends IOldReqOptionsWithJSON ? T
227
+ : U extends IOldReqOptions ? string
228
+ : U extends IReqOptionsWithBodyResOnly ? T
229
+ : string
229
230
230
231
/**
231
232
* the old request lib will be removed in v1.5.0+
0 commit comments