@rsdoctor/core 1.5.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiled/axios/index.d.ts +340 -116
- package/compiled/axios/index.js +181 -199
- package/compiled/axios/package.json +1 -1
- package/dist/build-utils/build/module-graph/rspack/transform.cjs +4 -0
- package/dist/build-utils/build/module-graph/rspack/transform.js +4 -0
- package/dist/build-utils/build/utils/parseBundle.cjs +2 -0
- package/dist/build-utils/build/utils/parseBundle.js +2 -0
- package/dist/inner-plugins/plugins/ensureModulesChunkGraph.cjs +5 -0
- package/dist/inner-plugins/plugins/ensureModulesChunkGraph.js +5 -0
- package/package.json +8 -8
|
@@ -1,27 +1,49 @@
|
|
|
1
1
|
// TypeScript Version: 4.7
|
|
2
|
-
type
|
|
2
|
+
type StringLiteralsOrString<Literals extends string> = Literals | (string & {});
|
|
3
|
+
|
|
4
|
+
type AxiosHeaderValue =
|
|
5
|
+
| AxiosHeaders
|
|
6
|
+
| string
|
|
7
|
+
| string[]
|
|
8
|
+
| number
|
|
9
|
+
| boolean
|
|
10
|
+
| null;
|
|
3
11
|
|
|
4
12
|
interface RawAxiosHeaders {
|
|
5
13
|
[key: string]: AxiosHeaderValue;
|
|
6
14
|
}
|
|
7
15
|
|
|
8
|
-
type MethodsHeaders = Partial<
|
|
9
|
-
|
|
10
|
-
|
|
16
|
+
type MethodsHeaders = Partial<
|
|
17
|
+
{
|
|
18
|
+
[Key in Method as Lowercase<Key>]: AxiosHeaders;
|
|
19
|
+
} & { common: AxiosHeaders }
|
|
20
|
+
>;
|
|
11
21
|
|
|
12
|
-
type AxiosHeaderMatcher =
|
|
22
|
+
type AxiosHeaderMatcher =
|
|
23
|
+
| string
|
|
24
|
+
| RegExp
|
|
25
|
+
| ((this: AxiosHeaders, value: string, name: string) => boolean);
|
|
13
26
|
|
|
14
|
-
type AxiosHeaderParser = (
|
|
27
|
+
type AxiosHeaderParser = (
|
|
28
|
+
this: AxiosHeaders,
|
|
29
|
+
value: AxiosHeaderValue,
|
|
30
|
+
header: string,
|
|
31
|
+
) => any;
|
|
15
32
|
|
|
16
33
|
declare class AxiosHeaders {
|
|
17
|
-
constructor(
|
|
18
|
-
headers?: RawAxiosHeaders | AxiosHeaders | string
|
|
19
|
-
);
|
|
34
|
+
constructor(headers?: RawAxiosHeaders | AxiosHeaders | string);
|
|
20
35
|
|
|
21
36
|
[key: string]: any;
|
|
22
37
|
|
|
23
|
-
set(
|
|
24
|
-
|
|
38
|
+
set(
|
|
39
|
+
headerName?: string,
|
|
40
|
+
value?: AxiosHeaderValue,
|
|
41
|
+
rewrite?: boolean | AxiosHeaderMatcher,
|
|
42
|
+
): AxiosHeaders;
|
|
43
|
+
set(
|
|
44
|
+
headers?: RawAxiosHeaders | AxiosHeaders | string,
|
|
45
|
+
rewrite?: boolean,
|
|
46
|
+
): AxiosHeaders;
|
|
25
47
|
|
|
26
48
|
get(headerName: string, parser: RegExp): RegExpExecArray | null;
|
|
27
49
|
get(headerName: string, matcher?: true | AxiosHeaderParser): AxiosHeaderValue;
|
|
@@ -34,7 +56,11 @@ declare class AxiosHeaders {
|
|
|
34
56
|
|
|
35
57
|
normalize(format: boolean): AxiosHeaders;
|
|
36
58
|
|
|
37
|
-
concat(
|
|
59
|
+
concat(
|
|
60
|
+
...targets: Array<
|
|
61
|
+
AxiosHeaders | RawAxiosHeaders | string | undefined | null
|
|
62
|
+
>
|
|
63
|
+
): AxiosHeaders;
|
|
38
64
|
|
|
39
65
|
toJSON(asStrings?: boolean): RawAxiosHeaders;
|
|
40
66
|
|
|
@@ -42,34 +68,56 @@ declare class AxiosHeaders {
|
|
|
42
68
|
|
|
43
69
|
static accessor(header: string | string[]): AxiosHeaders;
|
|
44
70
|
|
|
45
|
-
static concat(
|
|
71
|
+
static concat(
|
|
72
|
+
...targets: Array<
|
|
73
|
+
AxiosHeaders | RawAxiosHeaders | string | undefined | null
|
|
74
|
+
>
|
|
75
|
+
): AxiosHeaders;
|
|
46
76
|
|
|
47
|
-
setContentType(
|
|
77
|
+
setContentType(
|
|
78
|
+
value: ContentType,
|
|
79
|
+
rewrite?: boolean | AxiosHeaderMatcher,
|
|
80
|
+
): AxiosHeaders;
|
|
48
81
|
getContentType(parser?: RegExp): RegExpExecArray | null;
|
|
49
82
|
getContentType(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
|
50
83
|
hasContentType(matcher?: AxiosHeaderMatcher): boolean;
|
|
51
84
|
|
|
52
|
-
setContentLength(
|
|
85
|
+
setContentLength(
|
|
86
|
+
value: AxiosHeaderValue,
|
|
87
|
+
rewrite?: boolean | AxiosHeaderMatcher,
|
|
88
|
+
): AxiosHeaders;
|
|
53
89
|
getContentLength(parser?: RegExp): RegExpExecArray | null;
|
|
54
90
|
getContentLength(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
|
55
91
|
hasContentLength(matcher?: AxiosHeaderMatcher): boolean;
|
|
56
92
|
|
|
57
|
-
setAccept(
|
|
93
|
+
setAccept(
|
|
94
|
+
value: AxiosHeaderValue,
|
|
95
|
+
rewrite?: boolean | AxiosHeaderMatcher,
|
|
96
|
+
): AxiosHeaders;
|
|
58
97
|
getAccept(parser?: RegExp): RegExpExecArray | null;
|
|
59
98
|
getAccept(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
|
60
99
|
hasAccept(matcher?: AxiosHeaderMatcher): boolean;
|
|
61
100
|
|
|
62
|
-
setUserAgent(
|
|
101
|
+
setUserAgent(
|
|
102
|
+
value: AxiosHeaderValue,
|
|
103
|
+
rewrite?: boolean | AxiosHeaderMatcher,
|
|
104
|
+
): AxiosHeaders;
|
|
63
105
|
getUserAgent(parser?: RegExp): RegExpExecArray | null;
|
|
64
106
|
getUserAgent(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
|
65
107
|
hasUserAgent(matcher?: AxiosHeaderMatcher): boolean;
|
|
66
108
|
|
|
67
|
-
setContentEncoding(
|
|
109
|
+
setContentEncoding(
|
|
110
|
+
value: AxiosHeaderValue,
|
|
111
|
+
rewrite?: boolean | AxiosHeaderMatcher,
|
|
112
|
+
): AxiosHeaders;
|
|
68
113
|
getContentEncoding(parser?: RegExp): RegExpExecArray | null;
|
|
69
114
|
getContentEncoding(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
|
70
115
|
hasContentEncoding(matcher?: AxiosHeaderMatcher): boolean;
|
|
71
116
|
|
|
72
|
-
setAuthorization(
|
|
117
|
+
setAuthorization(
|
|
118
|
+
value: AxiosHeaderValue,
|
|
119
|
+
rewrite?: boolean | AxiosHeaderMatcher,
|
|
120
|
+
): AxiosHeaders;
|
|
73
121
|
getAuthorization(parser?: RegExp): RegExpExecArray | null;
|
|
74
122
|
getAuthorization(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
|
75
123
|
hasAuthorization(matcher?: AxiosHeaderMatcher): boolean;
|
|
@@ -79,19 +127,38 @@ declare class AxiosHeaders {
|
|
|
79
127
|
[Symbol.iterator](): IterableIterator<[string, AxiosHeaderValue]>;
|
|
80
128
|
}
|
|
81
129
|
|
|
82
|
-
type CommonRequestHeadersList =
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
130
|
+
type CommonRequestHeadersList =
|
|
131
|
+
| "Accept"
|
|
132
|
+
| "Content-Length"
|
|
133
|
+
| "User-Agent"
|
|
134
|
+
| "Content-Encoding"
|
|
135
|
+
| "Authorization";
|
|
136
|
+
|
|
137
|
+
type ContentType =
|
|
138
|
+
| AxiosHeaderValue
|
|
139
|
+
| "text/html"
|
|
140
|
+
| "text/plain"
|
|
141
|
+
| "multipart/form-data"
|
|
142
|
+
| "application/json"
|
|
143
|
+
| "application/x-www-form-urlencoded"
|
|
144
|
+
| "application/octet-stream";
|
|
145
|
+
|
|
146
|
+
type RawAxiosRequestHeaders = Partial<
|
|
147
|
+
RawAxiosHeaders & {
|
|
148
|
+
[Key in CommonRequestHeadersList]: AxiosHeaderValue;
|
|
149
|
+
} & {
|
|
150
|
+
"Content-Type": ContentType;
|
|
151
|
+
}
|
|
152
|
+
>;
|
|
91
153
|
|
|
92
154
|
type AxiosRequestHeaders = RawAxiosRequestHeaders & AxiosHeaders;
|
|
93
155
|
|
|
94
|
-
type CommonResponseHeadersList =
|
|
156
|
+
type CommonResponseHeadersList =
|
|
157
|
+
| "Server"
|
|
158
|
+
| "Content-Type"
|
|
159
|
+
| "Content-Length"
|
|
160
|
+
| "Cache-Control"
|
|
161
|
+
| "Content-Encoding";
|
|
95
162
|
|
|
96
163
|
type RawCommonResponseHeaders = {
|
|
97
164
|
[Key in CommonResponseHeadersList]: AxiosHeaderValue;
|
|
@@ -99,16 +166,27 @@ type RawCommonResponseHeaders = {
|
|
|
99
166
|
"set-cookie": string[];
|
|
100
167
|
};
|
|
101
168
|
|
|
102
|
-
type RawAxiosResponseHeaders = Partial<
|
|
169
|
+
type RawAxiosResponseHeaders = Partial<
|
|
170
|
+
RawAxiosHeaders & RawCommonResponseHeaders
|
|
171
|
+
>;
|
|
103
172
|
|
|
104
173
|
type AxiosResponseHeaders = RawAxiosResponseHeaders & AxiosHeaders;
|
|
105
174
|
|
|
106
175
|
interface AxiosRequestTransformer {
|
|
107
|
-
(
|
|
176
|
+
(
|
|
177
|
+
this: InternalAxiosRequestConfig,
|
|
178
|
+
data: any,
|
|
179
|
+
headers: AxiosRequestHeaders,
|
|
180
|
+
): any;
|
|
108
181
|
}
|
|
109
182
|
|
|
110
183
|
interface AxiosResponseTransformer {
|
|
111
|
-
(
|
|
184
|
+
(
|
|
185
|
+
this: InternalAxiosRequestConfig,
|
|
186
|
+
data: any,
|
|
187
|
+
headers: AxiosResponseHeaders,
|
|
188
|
+
status?: number,
|
|
189
|
+
): any;
|
|
112
190
|
}
|
|
113
191
|
|
|
114
192
|
interface AxiosAdapter {
|
|
@@ -194,39 +272,61 @@ declare enum HttpStatusCode {
|
|
|
194
272
|
}
|
|
195
273
|
|
|
196
274
|
type Method =
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
275
|
+
| "get"
|
|
276
|
+
| "GET"
|
|
277
|
+
| "delete"
|
|
278
|
+
| "DELETE"
|
|
279
|
+
| "head"
|
|
280
|
+
| "HEAD"
|
|
281
|
+
| "options"
|
|
282
|
+
| "OPTIONS"
|
|
283
|
+
| "post"
|
|
284
|
+
| "POST"
|
|
285
|
+
| "put"
|
|
286
|
+
| "PUT"
|
|
287
|
+
| "patch"
|
|
288
|
+
| "PATCH"
|
|
289
|
+
| "purge"
|
|
290
|
+
| "PURGE"
|
|
291
|
+
| "link"
|
|
292
|
+
| "LINK"
|
|
293
|
+
| "unlink"
|
|
294
|
+
| "UNLINK";
|
|
207
295
|
|
|
208
296
|
type ResponseType =
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
297
|
+
| "arraybuffer"
|
|
298
|
+
| "blob"
|
|
299
|
+
| "document"
|
|
300
|
+
| "json"
|
|
301
|
+
| "text"
|
|
302
|
+
| "stream"
|
|
303
|
+
| "formdata";
|
|
216
304
|
|
|
217
305
|
type responseEncoding =
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
306
|
+
| "ascii"
|
|
307
|
+
| "ASCII"
|
|
308
|
+
| "ansi"
|
|
309
|
+
| "ANSI"
|
|
310
|
+
| "binary"
|
|
311
|
+
| "BINARY"
|
|
312
|
+
| "base64"
|
|
313
|
+
| "BASE64"
|
|
314
|
+
| "base64url"
|
|
315
|
+
| "BASE64URL"
|
|
316
|
+
| "hex"
|
|
317
|
+
| "HEX"
|
|
318
|
+
| "latin1"
|
|
319
|
+
| "LATIN1"
|
|
320
|
+
| "ucs-2"
|
|
321
|
+
| "UCS-2"
|
|
322
|
+
| "ucs2"
|
|
323
|
+
| "UCS2"
|
|
324
|
+
| "utf-8"
|
|
325
|
+
| "UTF-8"
|
|
326
|
+
| "utf8"
|
|
327
|
+
| "UTF8"
|
|
328
|
+
| "utf16le"
|
|
329
|
+
| "UTF16LE";
|
|
230
330
|
|
|
231
331
|
interface TransitionalOptions {
|
|
232
332
|
silentJSONParsing?: boolean;
|
|
@@ -249,11 +349,11 @@ interface FormDataVisitorHelpers {
|
|
|
249
349
|
|
|
250
350
|
interface SerializerVisitor {
|
|
251
351
|
(
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
352
|
+
this: GenericFormData,
|
|
353
|
+
value: any,
|
|
354
|
+
key: string | number,
|
|
355
|
+
path: null | Array<string | number>,
|
|
356
|
+
helpers: FormDataVisitorHelpers,
|
|
257
357
|
): boolean;
|
|
258
358
|
}
|
|
259
359
|
|
|
@@ -265,8 +365,7 @@ interface SerializerOptions {
|
|
|
265
365
|
}
|
|
266
366
|
|
|
267
367
|
// tslint:disable-next-line
|
|
268
|
-
interface FormSerializerOptions extends SerializerOptions {
|
|
269
|
-
}
|
|
368
|
+
interface FormSerializerOptions extends SerializerOptions {}
|
|
270
369
|
|
|
271
370
|
interface ParamEncoder {
|
|
272
371
|
(value: any, defaultEncoder: (value: any) => any): any;
|
|
@@ -302,7 +401,7 @@ interface AxiosProgressEvent {
|
|
|
302
401
|
|
|
303
402
|
type Milliseconds = number;
|
|
304
403
|
|
|
305
|
-
type AxiosAdapterName =
|
|
404
|
+
type AxiosAdapterName = StringLiteralsOrString<"xhr" | "http" | "fetch">;
|
|
306
405
|
|
|
307
406
|
type AxiosAdapterConfig = AxiosAdapter | AxiosAdapterName;
|
|
308
407
|
|
|
@@ -317,7 +416,7 @@ type LookupAddress = string | LookupAddressEntry;
|
|
|
317
416
|
|
|
318
417
|
interface AxiosRequestConfig<D = any> {
|
|
319
418
|
url?: string;
|
|
320
|
-
method?: Method
|
|
419
|
+
method?: StringLiteralsOrString<Method>;
|
|
321
420
|
baseURL?: string;
|
|
322
421
|
allowAbsoluteUrls?: boolean;
|
|
323
422
|
transformRequest?: AxiosRequestTransformer | AxiosRequestTransformer[];
|
|
@@ -332,7 +431,7 @@ interface AxiosRequestConfig<D = any> {
|
|
|
332
431
|
adapter?: AxiosAdapterConfig | AxiosAdapterConfig[];
|
|
333
432
|
auth?: AxiosBasicCredentials;
|
|
334
433
|
responseType?: ResponseType;
|
|
335
|
-
responseEncoding?: responseEncoding
|
|
434
|
+
responseEncoding?: StringLiteralsOrString<responseEncoding>;
|
|
336
435
|
xsrfCookieName?: string;
|
|
337
436
|
xsrfHeaderName?: string;
|
|
338
437
|
onUploadProgress?: (progressEvent: AxiosProgressEvent) => void;
|
|
@@ -342,33 +441,74 @@ interface AxiosRequestConfig<D = any> {
|
|
|
342
441
|
maxBodyLength?: number;
|
|
343
442
|
maxRedirects?: number;
|
|
344
443
|
maxRate?: number | [MaxUploadRate, MaxDownloadRate];
|
|
345
|
-
beforeRedirect?: (
|
|
444
|
+
beforeRedirect?: (
|
|
445
|
+
options: Record<string, any>,
|
|
446
|
+
responseDetails: {
|
|
447
|
+
headers: Record<string, string>;
|
|
448
|
+
statusCode: HttpStatusCode;
|
|
449
|
+
},
|
|
450
|
+
) => void;
|
|
346
451
|
socketPath?: string | null;
|
|
347
452
|
transport?: any;
|
|
348
453
|
httpAgent?: any;
|
|
349
454
|
httpsAgent?: any;
|
|
350
455
|
proxy?: AxiosProxyConfig | false;
|
|
351
|
-
cancelToken?: CancelToken;
|
|
456
|
+
cancelToken?: CancelToken | undefined;
|
|
352
457
|
decompress?: boolean;
|
|
353
458
|
transitional?: TransitionalOptions;
|
|
354
459
|
signal?: GenericAbortSignal;
|
|
355
460
|
insecureHTTPParser?: boolean;
|
|
356
461
|
env?: {
|
|
357
462
|
FormData?: new (...args: any[]) => object;
|
|
358
|
-
fetch?: (
|
|
359
|
-
|
|
463
|
+
fetch?: (
|
|
464
|
+
input: URL | Request | string,
|
|
465
|
+
init?: RequestInit,
|
|
466
|
+
) => Promise<Response>;
|
|
467
|
+
Request?: new (
|
|
468
|
+
input: URL | Request | string,
|
|
469
|
+
init?: RequestInit,
|
|
470
|
+
) => Request;
|
|
360
471
|
Response?: new (
|
|
361
|
-
|
|
362
|
-
|
|
472
|
+
body?:
|
|
473
|
+
| ArrayBuffer
|
|
474
|
+
| ArrayBufferView
|
|
475
|
+
| Blob
|
|
476
|
+
| FormData
|
|
477
|
+
| URLSearchParams
|
|
478
|
+
| string
|
|
479
|
+
| null,
|
|
480
|
+
init?: ResponseInit,
|
|
363
481
|
) => Response;
|
|
364
482
|
};
|
|
365
483
|
formSerializer?: FormSerializerOptions;
|
|
366
484
|
family?: AddressFamily;
|
|
367
|
-
lookup?:
|
|
368
|
-
|
|
369
|
-
|
|
485
|
+
lookup?:
|
|
486
|
+
| ((
|
|
487
|
+
hostname: string,
|
|
488
|
+
options: object,
|
|
489
|
+
cb: (
|
|
490
|
+
err: Error | null,
|
|
491
|
+
address: LookupAddress | LookupAddress[],
|
|
492
|
+
family?: AddressFamily,
|
|
493
|
+
) => void,
|
|
494
|
+
) => void)
|
|
495
|
+
| ((
|
|
496
|
+
hostname: string,
|
|
497
|
+
options: object,
|
|
498
|
+
) => Promise<
|
|
499
|
+
| [
|
|
500
|
+
address: LookupAddressEntry | LookupAddressEntry[],
|
|
501
|
+
family?: AddressFamily,
|
|
502
|
+
]
|
|
503
|
+
| LookupAddress
|
|
504
|
+
>);
|
|
505
|
+
withXSRFToken?:
|
|
506
|
+
| boolean
|
|
507
|
+
| ((config: InternalAxiosRequestConfig) => boolean | undefined);
|
|
370
508
|
parseReviver?: (this: any, key: string, value: any) => any;
|
|
371
|
-
fetchOptions?:
|
|
509
|
+
fetchOptions?:
|
|
510
|
+
| Omit<RequestInit, "body" | "headers" | "method" | "signal">
|
|
511
|
+
| Record<string, any>;
|
|
372
512
|
httpVersion?: 1 | 2;
|
|
373
513
|
http2Options?: Record<string, any> & {
|
|
374
514
|
sessionTimeout?: number;
|
|
@@ -378,7 +518,9 @@ interface AxiosRequestConfig<D = any> {
|
|
|
378
518
|
// Alias
|
|
379
519
|
type RawAxiosRequestConfig<D = any> = AxiosRequestConfig<D>;
|
|
380
520
|
|
|
381
|
-
interface InternalAxiosRequestConfig<
|
|
521
|
+
interface InternalAxiosRequestConfig<
|
|
522
|
+
D = any,
|
|
523
|
+
> extends AxiosRequestConfig<D> {
|
|
382
524
|
headers: AxiosRequestHeaders;
|
|
383
525
|
}
|
|
384
526
|
|
|
@@ -396,11 +538,17 @@ interface HeadersDefaults {
|
|
|
396
538
|
unlink?: RawAxiosRequestHeaders;
|
|
397
539
|
}
|
|
398
540
|
|
|
399
|
-
interface AxiosDefaults<D = any> extends Omit<
|
|
541
|
+
interface AxiosDefaults<D = any> extends Omit<
|
|
542
|
+
AxiosRequestConfig<D>,
|
|
543
|
+
"headers"
|
|
544
|
+
> {
|
|
400
545
|
headers: HeadersDefaults;
|
|
401
546
|
}
|
|
402
547
|
|
|
403
|
-
interface CreateAxiosDefaults<D = any> extends Omit<
|
|
548
|
+
interface CreateAxiosDefaults<D = any> extends Omit<
|
|
549
|
+
AxiosRequestConfig<D>,
|
|
550
|
+
"headers"
|
|
551
|
+
> {
|
|
404
552
|
headers?: RawAxiosRequestHeaders | AxiosHeaders | Partial<HeadersDefaults>;
|
|
405
553
|
}
|
|
406
554
|
|
|
@@ -408,18 +556,18 @@ interface AxiosResponse<T = any, D = any, H = {}> {
|
|
|
408
556
|
data: T;
|
|
409
557
|
status: number;
|
|
410
558
|
statusText: string;
|
|
411
|
-
headers: H & RawAxiosResponseHeaders | AxiosResponseHeaders;
|
|
559
|
+
headers: (H & RawAxiosResponseHeaders) | AxiosResponseHeaders;
|
|
412
560
|
config: InternalAxiosRequestConfig<D>;
|
|
413
561
|
request?: any;
|
|
414
562
|
}
|
|
415
563
|
|
|
416
564
|
declare class AxiosError<T = unknown, D = any> extends Error {
|
|
417
565
|
constructor(
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
566
|
+
message?: string,
|
|
567
|
+
code?: string,
|
|
568
|
+
config?: InternalAxiosRequestConfig<D>,
|
|
569
|
+
request?: any,
|
|
570
|
+
response?: AxiosResponse<T, D>,
|
|
423
571
|
);
|
|
424
572
|
|
|
425
573
|
config?: InternalAxiosRequestConfig<D>;
|
|
@@ -429,7 +577,7 @@ declare class AxiosError<T = unknown, D = any> extends Error {
|
|
|
429
577
|
isAxiosError: boolean;
|
|
430
578
|
status?: number;
|
|
431
579
|
toJSON: () => object;
|
|
432
|
-
cause?:
|
|
580
|
+
cause?: Error;
|
|
433
581
|
event?: BrowserProgressEvent;
|
|
434
582
|
static from<T = unknown, D = any>(
|
|
435
583
|
error: Error | unknown,
|
|
@@ -438,7 +586,7 @@ declare class AxiosError<T = unknown, D = any> extends Error {
|
|
|
438
586
|
request?: any,
|
|
439
587
|
response?: AxiosResponse<T, D>,
|
|
440
588
|
customProps?: object,
|
|
441
|
-
): AxiosError<T, D>;
|
|
589
|
+
): AxiosError<T, D>;
|
|
442
590
|
static readonly ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
|
|
443
591
|
static readonly ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
|
|
444
592
|
static readonly ERR_BAD_OPTION = "ERR_BAD_OPTION";
|
|
@@ -492,14 +640,34 @@ interface AxiosInterceptorOptions {
|
|
|
492
640
|
runWhen?: (config: InternalAxiosRequestConfig) => boolean;
|
|
493
641
|
}
|
|
494
642
|
|
|
495
|
-
type
|
|
643
|
+
type AxiosInterceptorFulfilled<T> = (value: T) => T | Promise<T>;
|
|
644
|
+
type AxiosInterceptorRejected = (error: any) => any;
|
|
645
|
+
|
|
646
|
+
type AxiosRequestInterceptorUse<T> = (
|
|
647
|
+
onFulfilled?: AxiosInterceptorFulfilled<T> | null,
|
|
648
|
+
onRejected?: AxiosInterceptorRejected | null,
|
|
649
|
+
options?: AxiosInterceptorOptions,
|
|
650
|
+
) => number;
|
|
496
651
|
|
|
497
|
-
type AxiosResponseInterceptorUse<T> = (
|
|
652
|
+
type AxiosResponseInterceptorUse<T> = (
|
|
653
|
+
onFulfilled?: AxiosInterceptorFulfilled<T> | null,
|
|
654
|
+
onRejected?: AxiosInterceptorRejected | null,
|
|
655
|
+
) => number;
|
|
656
|
+
|
|
657
|
+
interface AxiosInterceptorHandler<T> {
|
|
658
|
+
fulfilled: AxiosInterceptorFulfilled<T>;
|
|
659
|
+
rejected?: AxiosInterceptorRejected;
|
|
660
|
+
synchronous: boolean;
|
|
661
|
+
runWhen: (config: AxiosRequestConfig) => boolean | null;
|
|
662
|
+
}
|
|
498
663
|
|
|
499
664
|
interface AxiosInterceptorManager<V> {
|
|
500
|
-
use: V extends AxiosResponse
|
|
665
|
+
use: V extends AxiosResponse
|
|
666
|
+
? AxiosResponseInterceptorUse<V>
|
|
667
|
+
: AxiosRequestInterceptorUse<V>;
|
|
501
668
|
eject(id: number): void;
|
|
502
669
|
clear(): void;
|
|
670
|
+
handlers?: Array<AxiosInterceptorHandler<V>>;
|
|
503
671
|
}
|
|
504
672
|
|
|
505
673
|
declare class Axios {
|
|
@@ -510,28 +678,71 @@ declare class Axios {
|
|
|
510
678
|
response: AxiosInterceptorManager<AxiosResponse>;
|
|
511
679
|
};
|
|
512
680
|
getUri(config?: AxiosRequestConfig): string;
|
|
513
|
-
request<T = any, R = AxiosResponse<T>, D = any>(
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
681
|
+
request<T = any, R = AxiosResponse<T>, D = any>(
|
|
682
|
+
config: AxiosRequestConfig<D>,
|
|
683
|
+
): Promise<R>;
|
|
684
|
+
get<T = any, R = AxiosResponse<T>, D = any>(
|
|
685
|
+
url: string,
|
|
686
|
+
config?: AxiosRequestConfig<D>,
|
|
687
|
+
): Promise<R>;
|
|
688
|
+
delete<T = any, R = AxiosResponse<T>, D = any>(
|
|
689
|
+
url: string,
|
|
690
|
+
config?: AxiosRequestConfig<D>,
|
|
691
|
+
): Promise<R>;
|
|
692
|
+
head<T = any, R = AxiosResponse<T>, D = any>(
|
|
693
|
+
url: string,
|
|
694
|
+
config?: AxiosRequestConfig<D>,
|
|
695
|
+
): Promise<R>;
|
|
696
|
+
options<T = any, R = AxiosResponse<T>, D = any>(
|
|
697
|
+
url: string,
|
|
698
|
+
config?: AxiosRequestConfig<D>,
|
|
699
|
+
): Promise<R>;
|
|
700
|
+
post<T = any, R = AxiosResponse<T>, D = any>(
|
|
701
|
+
url: string,
|
|
702
|
+
data?: D,
|
|
703
|
+
config?: AxiosRequestConfig<D>,
|
|
704
|
+
): Promise<R>;
|
|
705
|
+
put<T = any, R = AxiosResponse<T>, D = any>(
|
|
706
|
+
url: string,
|
|
707
|
+
data?: D,
|
|
708
|
+
config?: AxiosRequestConfig<D>,
|
|
709
|
+
): Promise<R>;
|
|
710
|
+
patch<T = any, R = AxiosResponse<T>, D = any>(
|
|
711
|
+
url: string,
|
|
712
|
+
data?: D,
|
|
713
|
+
config?: AxiosRequestConfig<D>,
|
|
714
|
+
): Promise<R>;
|
|
715
|
+
postForm<T = any, R = AxiosResponse<T>, D = any>(
|
|
716
|
+
url: string,
|
|
717
|
+
data?: D,
|
|
718
|
+
config?: AxiosRequestConfig<D>,
|
|
719
|
+
): Promise<R>;
|
|
720
|
+
putForm<T = any, R = AxiosResponse<T>, D = any>(
|
|
721
|
+
url: string,
|
|
722
|
+
data?: D,
|
|
723
|
+
config?: AxiosRequestConfig<D>,
|
|
724
|
+
): Promise<R>;
|
|
725
|
+
patchForm<T = any, R = AxiosResponse<T>, D = any>(
|
|
726
|
+
url: string,
|
|
727
|
+
data?: D,
|
|
728
|
+
config?: AxiosRequestConfig<D>,
|
|
729
|
+
): Promise<R>;
|
|
524
730
|
}
|
|
525
731
|
|
|
526
732
|
interface AxiosInstance extends Axios {
|
|
527
|
-
<T = any, R = AxiosResponse<T>, D = any>(
|
|
528
|
-
|
|
733
|
+
<T = any, R = AxiosResponse<T>, D = any>(
|
|
734
|
+
config: AxiosRequestConfig<D>,
|
|
735
|
+
): Promise<R>;
|
|
736
|
+
<T = any, R = AxiosResponse<T>, D = any>(
|
|
737
|
+
url: string,
|
|
738
|
+
config?: AxiosRequestConfig<D>,
|
|
739
|
+
): Promise<R>;
|
|
529
740
|
|
|
530
741
|
create(config?: CreateAxiosDefaults): AxiosInstance;
|
|
531
|
-
defaults: Omit<AxiosDefaults,
|
|
742
|
+
defaults: Omit<AxiosDefaults, "headers"> & {
|
|
532
743
|
headers: HeadersDefaults & {
|
|
533
|
-
[key: string]: AxiosHeaderValue
|
|
534
|
-
}
|
|
744
|
+
[key: string]: AxiosHeaderValue;
|
|
745
|
+
};
|
|
535
746
|
};
|
|
536
747
|
}
|
|
537
748
|
|
|
@@ -545,13 +756,23 @@ interface GenericHTMLFormElement {
|
|
|
545
756
|
submit(): void;
|
|
546
757
|
}
|
|
547
758
|
|
|
548
|
-
declare function getAdapter(
|
|
759
|
+
declare function getAdapter(
|
|
760
|
+
adapters: AxiosAdapterConfig | AxiosAdapterConfig[] | undefined,
|
|
761
|
+
): AxiosAdapter;
|
|
549
762
|
|
|
550
|
-
declare function toFormData(
|
|
763
|
+
declare function toFormData(
|
|
764
|
+
sourceObj: object,
|
|
765
|
+
targetFormData?: GenericFormData,
|
|
766
|
+
options?: FormSerializerOptions,
|
|
767
|
+
): GenericFormData;
|
|
551
768
|
|
|
552
|
-
declare function formToJSON(
|
|
769
|
+
declare function formToJSON(
|
|
770
|
+
form: GenericFormData | GenericHTMLFormElement,
|
|
771
|
+
): object;
|
|
553
772
|
|
|
554
|
-
declare function isAxiosError<T = any, D = any>(
|
|
773
|
+
declare function isAxiosError<T = any, D = any>(
|
|
774
|
+
payload: any,
|
|
775
|
+
): payload is AxiosError<T, D>;
|
|
555
776
|
|
|
556
777
|
declare function spread<T, R>(callback: (...args: T[]) => R): (array: T[]) => R;
|
|
557
778
|
|
|
@@ -559,7 +780,10 @@ declare function isCancel<T = any>(value: any): value is CanceledError<T>;
|
|
|
559
780
|
|
|
560
781
|
declare function all<T>(values: Array<T | Promise<T>>): Promise<T[]>;
|
|
561
782
|
|
|
562
|
-
declare function mergeConfig<D = any>(
|
|
783
|
+
declare function mergeConfig<D = any>(
|
|
784
|
+
config1: AxiosRequestConfig<D>,
|
|
785
|
+
config2: AxiosRequestConfig<D>,
|
|
786
|
+
): AxiosRequestConfig<D>;
|
|
563
787
|
|
|
564
788
|
interface AxiosStatic extends AxiosInstance {
|
|
565
789
|
Cancel: CancelStatic;
|