@rsdoctor/core 1.2.4-beta.2 → 1.2.4-beta.4
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 +579 -0
- package/compiled/axios/index.js +9403 -0
- package/compiled/axios/license +7 -0
- package/compiled/axios/package.json +1 -0
- package/package.json +7 -6
|
@@ -0,0 +1,579 @@
|
|
|
1
|
+
// TypeScript Version: 4.7
|
|
2
|
+
type AxiosHeaderValue = AxiosHeaders | string | string[] | number | boolean | null;
|
|
3
|
+
|
|
4
|
+
interface RawAxiosHeaders {
|
|
5
|
+
[key: string]: AxiosHeaderValue;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
type MethodsHeaders = Partial<{
|
|
9
|
+
[Key in Method as Lowercase<Key>]: AxiosHeaders;
|
|
10
|
+
} & {common: AxiosHeaders}>;
|
|
11
|
+
|
|
12
|
+
type AxiosHeaderMatcher = string | RegExp | ((this: AxiosHeaders, value: string, name: string) => boolean);
|
|
13
|
+
|
|
14
|
+
type AxiosHeaderParser = (this: AxiosHeaders, value: AxiosHeaderValue, header: string) => any;
|
|
15
|
+
|
|
16
|
+
declare class AxiosHeaders {
|
|
17
|
+
constructor(
|
|
18
|
+
headers?: RawAxiosHeaders | AxiosHeaders | string
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
[key: string]: any;
|
|
22
|
+
|
|
23
|
+
set(headerName?: string, value?: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
|
24
|
+
set(headers?: RawAxiosHeaders | AxiosHeaders | string, rewrite?: boolean): AxiosHeaders;
|
|
25
|
+
|
|
26
|
+
get(headerName: string, parser: RegExp): RegExpExecArray | null;
|
|
27
|
+
get(headerName: string, matcher?: true | AxiosHeaderParser): AxiosHeaderValue;
|
|
28
|
+
|
|
29
|
+
has(header: string, matcher?: AxiosHeaderMatcher): boolean;
|
|
30
|
+
|
|
31
|
+
delete(header: string | string[], matcher?: AxiosHeaderMatcher): boolean;
|
|
32
|
+
|
|
33
|
+
clear(matcher?: AxiosHeaderMatcher): boolean;
|
|
34
|
+
|
|
35
|
+
normalize(format: boolean): AxiosHeaders;
|
|
36
|
+
|
|
37
|
+
concat(...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null>): AxiosHeaders;
|
|
38
|
+
|
|
39
|
+
toJSON(asStrings?: boolean): RawAxiosHeaders;
|
|
40
|
+
|
|
41
|
+
static from(thing?: AxiosHeaders | RawAxiosHeaders | string): AxiosHeaders;
|
|
42
|
+
|
|
43
|
+
static accessor(header: string | string[]): AxiosHeaders;
|
|
44
|
+
|
|
45
|
+
static concat(...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null>): AxiosHeaders;
|
|
46
|
+
|
|
47
|
+
setContentType(value: ContentType, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
|
48
|
+
getContentType(parser?: RegExp): RegExpExecArray | null;
|
|
49
|
+
getContentType(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
|
50
|
+
hasContentType(matcher?: AxiosHeaderMatcher): boolean;
|
|
51
|
+
|
|
52
|
+
setContentLength(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
|
53
|
+
getContentLength(parser?: RegExp): RegExpExecArray | null;
|
|
54
|
+
getContentLength(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
|
55
|
+
hasContentLength(matcher?: AxiosHeaderMatcher): boolean;
|
|
56
|
+
|
|
57
|
+
setAccept(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
|
58
|
+
getAccept(parser?: RegExp): RegExpExecArray | null;
|
|
59
|
+
getAccept(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
|
60
|
+
hasAccept(matcher?: AxiosHeaderMatcher): boolean;
|
|
61
|
+
|
|
62
|
+
setUserAgent(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
|
63
|
+
getUserAgent(parser?: RegExp): RegExpExecArray | null;
|
|
64
|
+
getUserAgent(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
|
65
|
+
hasUserAgent(matcher?: AxiosHeaderMatcher): boolean;
|
|
66
|
+
|
|
67
|
+
setContentEncoding(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
|
68
|
+
getContentEncoding(parser?: RegExp): RegExpExecArray | null;
|
|
69
|
+
getContentEncoding(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
|
70
|
+
hasContentEncoding(matcher?: AxiosHeaderMatcher): boolean;
|
|
71
|
+
|
|
72
|
+
setAuthorization(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
|
73
|
+
getAuthorization(parser?: RegExp): RegExpExecArray | null;
|
|
74
|
+
getAuthorization(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
|
75
|
+
hasAuthorization(matcher?: AxiosHeaderMatcher): boolean;
|
|
76
|
+
|
|
77
|
+
getSetCookie(): string[];
|
|
78
|
+
|
|
79
|
+
[Symbol.iterator](): IterableIterator<[string, AxiosHeaderValue]>;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
type CommonRequestHeadersList = 'Accept' | 'Content-Length' | 'User-Agent' | 'Content-Encoding' | 'Authorization';
|
|
83
|
+
|
|
84
|
+
type ContentType = AxiosHeaderValue | 'text/html' | 'text/plain' | 'multipart/form-data' | 'application/json' | 'application/x-www-form-urlencoded' | 'application/octet-stream';
|
|
85
|
+
|
|
86
|
+
type RawAxiosRequestHeaders = Partial<RawAxiosHeaders & {
|
|
87
|
+
[Key in CommonRequestHeadersList]: AxiosHeaderValue;
|
|
88
|
+
} & {
|
|
89
|
+
'Content-Type': ContentType
|
|
90
|
+
}>;
|
|
91
|
+
|
|
92
|
+
type AxiosRequestHeaders = RawAxiosRequestHeaders & AxiosHeaders;
|
|
93
|
+
|
|
94
|
+
type CommonResponseHeadersList = 'Server' | 'Content-Type' | 'Content-Length' | 'Cache-Control'| 'Content-Encoding';
|
|
95
|
+
|
|
96
|
+
type RawCommonResponseHeaders = {
|
|
97
|
+
[Key in CommonResponseHeadersList]: AxiosHeaderValue;
|
|
98
|
+
} & {
|
|
99
|
+
"set-cookie": string[];
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
type RawAxiosResponseHeaders = Partial<RawAxiosHeaders & RawCommonResponseHeaders>;
|
|
103
|
+
|
|
104
|
+
type AxiosResponseHeaders = RawAxiosResponseHeaders & AxiosHeaders;
|
|
105
|
+
|
|
106
|
+
interface AxiosRequestTransformer {
|
|
107
|
+
(this: InternalAxiosRequestConfig, data: any, headers: AxiosRequestHeaders): any;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
interface AxiosResponseTransformer {
|
|
111
|
+
(this: InternalAxiosRequestConfig, data: any, headers: AxiosResponseHeaders, status?: number): any;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
interface AxiosAdapter {
|
|
115
|
+
(config: InternalAxiosRequestConfig): AxiosPromise;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
interface AxiosBasicCredentials {
|
|
119
|
+
username: string;
|
|
120
|
+
password: string;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
interface AxiosProxyConfig {
|
|
124
|
+
host: string;
|
|
125
|
+
port: number;
|
|
126
|
+
auth?: AxiosBasicCredentials;
|
|
127
|
+
protocol?: string;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
declare enum HttpStatusCode {
|
|
131
|
+
Continue = 100,
|
|
132
|
+
SwitchingProtocols = 101,
|
|
133
|
+
Processing = 102,
|
|
134
|
+
EarlyHints = 103,
|
|
135
|
+
Ok = 200,
|
|
136
|
+
Created = 201,
|
|
137
|
+
Accepted = 202,
|
|
138
|
+
NonAuthoritativeInformation = 203,
|
|
139
|
+
NoContent = 204,
|
|
140
|
+
ResetContent = 205,
|
|
141
|
+
PartialContent = 206,
|
|
142
|
+
MultiStatus = 207,
|
|
143
|
+
AlreadyReported = 208,
|
|
144
|
+
ImUsed = 226,
|
|
145
|
+
MultipleChoices = 300,
|
|
146
|
+
MovedPermanently = 301,
|
|
147
|
+
Found = 302,
|
|
148
|
+
SeeOther = 303,
|
|
149
|
+
NotModified = 304,
|
|
150
|
+
UseProxy = 305,
|
|
151
|
+
Unused = 306,
|
|
152
|
+
TemporaryRedirect = 307,
|
|
153
|
+
PermanentRedirect = 308,
|
|
154
|
+
BadRequest = 400,
|
|
155
|
+
Unauthorized = 401,
|
|
156
|
+
PaymentRequired = 402,
|
|
157
|
+
Forbidden = 403,
|
|
158
|
+
NotFound = 404,
|
|
159
|
+
MethodNotAllowed = 405,
|
|
160
|
+
NotAcceptable = 406,
|
|
161
|
+
ProxyAuthenticationRequired = 407,
|
|
162
|
+
RequestTimeout = 408,
|
|
163
|
+
Conflict = 409,
|
|
164
|
+
Gone = 410,
|
|
165
|
+
LengthRequired = 411,
|
|
166
|
+
PreconditionFailed = 412,
|
|
167
|
+
PayloadTooLarge = 413,
|
|
168
|
+
UriTooLong = 414,
|
|
169
|
+
UnsupportedMediaType = 415,
|
|
170
|
+
RangeNotSatisfiable = 416,
|
|
171
|
+
ExpectationFailed = 417,
|
|
172
|
+
ImATeapot = 418,
|
|
173
|
+
MisdirectedRequest = 421,
|
|
174
|
+
UnprocessableEntity = 422,
|
|
175
|
+
Locked = 423,
|
|
176
|
+
FailedDependency = 424,
|
|
177
|
+
TooEarly = 425,
|
|
178
|
+
UpgradeRequired = 426,
|
|
179
|
+
PreconditionRequired = 428,
|
|
180
|
+
TooManyRequests = 429,
|
|
181
|
+
RequestHeaderFieldsTooLarge = 431,
|
|
182
|
+
UnavailableForLegalReasons = 451,
|
|
183
|
+
InternalServerError = 500,
|
|
184
|
+
NotImplemented = 501,
|
|
185
|
+
BadGateway = 502,
|
|
186
|
+
ServiceUnavailable = 503,
|
|
187
|
+
GatewayTimeout = 504,
|
|
188
|
+
HttpVersionNotSupported = 505,
|
|
189
|
+
VariantAlsoNegotiates = 506,
|
|
190
|
+
InsufficientStorage = 507,
|
|
191
|
+
LoopDetected = 508,
|
|
192
|
+
NotExtended = 510,
|
|
193
|
+
NetworkAuthenticationRequired = 511,
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
type Method =
|
|
197
|
+
| 'get' | 'GET'
|
|
198
|
+
| 'delete' | 'DELETE'
|
|
199
|
+
| 'head' | 'HEAD'
|
|
200
|
+
| 'options' | 'OPTIONS'
|
|
201
|
+
| 'post' | 'POST'
|
|
202
|
+
| 'put' | 'PUT'
|
|
203
|
+
| 'patch' | 'PATCH'
|
|
204
|
+
| 'purge' | 'PURGE'
|
|
205
|
+
| 'link' | 'LINK'
|
|
206
|
+
| 'unlink' | 'UNLINK';
|
|
207
|
+
|
|
208
|
+
type ResponseType =
|
|
209
|
+
| 'arraybuffer'
|
|
210
|
+
| 'blob'
|
|
211
|
+
| 'document'
|
|
212
|
+
| 'json'
|
|
213
|
+
| 'text'
|
|
214
|
+
| 'stream'
|
|
215
|
+
| 'formdata';
|
|
216
|
+
|
|
217
|
+
type responseEncoding =
|
|
218
|
+
| 'ascii' | 'ASCII'
|
|
219
|
+
| 'ansi' | 'ANSI'
|
|
220
|
+
| 'binary' | 'BINARY'
|
|
221
|
+
| 'base64' | 'BASE64'
|
|
222
|
+
| 'base64url' | 'BASE64URL'
|
|
223
|
+
| 'hex' | 'HEX'
|
|
224
|
+
| 'latin1' | 'LATIN1'
|
|
225
|
+
| 'ucs-2' | 'UCS-2'
|
|
226
|
+
| 'ucs2' | 'UCS2'
|
|
227
|
+
| 'utf-8' | 'UTF-8'
|
|
228
|
+
| 'utf8' | 'UTF8'
|
|
229
|
+
| 'utf16le' | 'UTF16LE';
|
|
230
|
+
|
|
231
|
+
interface TransitionalOptions {
|
|
232
|
+
silentJSONParsing?: boolean;
|
|
233
|
+
forcedJSONParsing?: boolean;
|
|
234
|
+
clarifyTimeoutError?: boolean;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
interface GenericAbortSignal {
|
|
238
|
+
readonly aborted: boolean;
|
|
239
|
+
onabort?: ((...args: any) => any) | null;
|
|
240
|
+
addEventListener?: (...args: any) => any;
|
|
241
|
+
removeEventListener?: (...args: any) => any;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
interface FormDataVisitorHelpers {
|
|
245
|
+
defaultVisitor: SerializerVisitor;
|
|
246
|
+
convertValue: (value: any) => any;
|
|
247
|
+
isVisitable: (value: any) => boolean;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
interface SerializerVisitor {
|
|
251
|
+
(
|
|
252
|
+
this: GenericFormData,
|
|
253
|
+
value: any,
|
|
254
|
+
key: string | number,
|
|
255
|
+
path: null | Array<string | number>,
|
|
256
|
+
helpers: FormDataVisitorHelpers
|
|
257
|
+
): boolean;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
interface SerializerOptions {
|
|
261
|
+
visitor?: SerializerVisitor;
|
|
262
|
+
dots?: boolean;
|
|
263
|
+
metaTokens?: boolean;
|
|
264
|
+
indexes?: boolean | null;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
// tslint:disable-next-line
|
|
268
|
+
interface FormSerializerOptions extends SerializerOptions {
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
interface ParamEncoder {
|
|
272
|
+
(value: any, defaultEncoder: (value: any) => any): any;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
interface CustomParamsSerializer {
|
|
276
|
+
(params: Record<string, any>, options?: ParamsSerializerOptions): string;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
interface ParamsSerializerOptions extends SerializerOptions {
|
|
280
|
+
encode?: ParamEncoder;
|
|
281
|
+
serialize?: CustomParamsSerializer;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
type MaxUploadRate = number;
|
|
285
|
+
|
|
286
|
+
type MaxDownloadRate = number;
|
|
287
|
+
|
|
288
|
+
type BrowserProgressEvent = any;
|
|
289
|
+
|
|
290
|
+
interface AxiosProgressEvent {
|
|
291
|
+
loaded: number;
|
|
292
|
+
total?: number;
|
|
293
|
+
progress?: number;
|
|
294
|
+
bytes: number;
|
|
295
|
+
rate?: number;
|
|
296
|
+
estimated?: number;
|
|
297
|
+
upload?: boolean;
|
|
298
|
+
download?: boolean;
|
|
299
|
+
event?: BrowserProgressEvent;
|
|
300
|
+
lengthComputable: boolean;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
type Milliseconds = number;
|
|
304
|
+
|
|
305
|
+
type AxiosAdapterName = 'fetch' | 'xhr' | 'http' | (string & {});
|
|
306
|
+
|
|
307
|
+
type AxiosAdapterConfig = AxiosAdapter | AxiosAdapterName;
|
|
308
|
+
|
|
309
|
+
type AddressFamily = 4 | 6 | undefined;
|
|
310
|
+
|
|
311
|
+
interface LookupAddressEntry {
|
|
312
|
+
address: string;
|
|
313
|
+
family?: AddressFamily;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
type LookupAddress = string | LookupAddressEntry;
|
|
317
|
+
|
|
318
|
+
interface AxiosRequestConfig<D = any> {
|
|
319
|
+
url?: string;
|
|
320
|
+
method?: Method | string;
|
|
321
|
+
baseURL?: string;
|
|
322
|
+
allowAbsoluteUrls?: boolean;
|
|
323
|
+
transformRequest?: AxiosRequestTransformer | AxiosRequestTransformer[];
|
|
324
|
+
transformResponse?: AxiosResponseTransformer | AxiosResponseTransformer[];
|
|
325
|
+
headers?: (RawAxiosRequestHeaders & MethodsHeaders) | AxiosHeaders;
|
|
326
|
+
params?: any;
|
|
327
|
+
paramsSerializer?: ParamsSerializerOptions | CustomParamsSerializer;
|
|
328
|
+
data?: D;
|
|
329
|
+
timeout?: Milliseconds;
|
|
330
|
+
timeoutErrorMessage?: string;
|
|
331
|
+
withCredentials?: boolean;
|
|
332
|
+
adapter?: AxiosAdapterConfig | AxiosAdapterConfig[];
|
|
333
|
+
auth?: AxiosBasicCredentials;
|
|
334
|
+
responseType?: ResponseType;
|
|
335
|
+
responseEncoding?: responseEncoding | string;
|
|
336
|
+
xsrfCookieName?: string;
|
|
337
|
+
xsrfHeaderName?: string;
|
|
338
|
+
onUploadProgress?: (progressEvent: AxiosProgressEvent) => void;
|
|
339
|
+
onDownloadProgress?: (progressEvent: AxiosProgressEvent) => void;
|
|
340
|
+
maxContentLength?: number;
|
|
341
|
+
validateStatus?: ((status: number) => boolean) | null;
|
|
342
|
+
maxBodyLength?: number;
|
|
343
|
+
maxRedirects?: number;
|
|
344
|
+
maxRate?: number | [MaxUploadRate, MaxDownloadRate];
|
|
345
|
+
beforeRedirect?: (options: Record<string, any>, responseDetails: {headers: Record<string, string>, statusCode: HttpStatusCode}) => void;
|
|
346
|
+
socketPath?: string | null;
|
|
347
|
+
transport?: any;
|
|
348
|
+
httpAgent?: any;
|
|
349
|
+
httpsAgent?: any;
|
|
350
|
+
proxy?: AxiosProxyConfig | false;
|
|
351
|
+
cancelToken?: CancelToken;
|
|
352
|
+
decompress?: boolean;
|
|
353
|
+
transitional?: TransitionalOptions;
|
|
354
|
+
signal?: GenericAbortSignal;
|
|
355
|
+
insecureHTTPParser?: boolean;
|
|
356
|
+
env?: {
|
|
357
|
+
FormData?: new (...args: any[]) => object;
|
|
358
|
+
fetch?: (input: URL | Request | string, init?: RequestInit) => Promise<Response>;
|
|
359
|
+
Request?: new (input: (RequestInfo | URL), init?: RequestInit) => Request;
|
|
360
|
+
Response?: new (body?: (BodyInit | null), init?: ResponseInit) => Response;
|
|
361
|
+
};
|
|
362
|
+
formSerializer?: FormSerializerOptions;
|
|
363
|
+
family?: AddressFamily;
|
|
364
|
+
lookup?: ((hostname: string, options: object, cb: (err: Error | null, address: LookupAddress | LookupAddress[], family?: AddressFamily) => void) => void) |
|
|
365
|
+
((hostname: string, options: object) => Promise<[address: LookupAddressEntry | LookupAddressEntry[], family?: AddressFamily] | LookupAddress>);
|
|
366
|
+
withXSRFToken?: boolean | ((config: InternalAxiosRequestConfig) => boolean | undefined);
|
|
367
|
+
parseReviver?: (this: any, key: string, value: any) => any;
|
|
368
|
+
fetchOptions?: Omit<RequestInit, 'body' | 'headers' | 'method' | 'signal'> | Record<string, any>;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
// Alias
|
|
372
|
+
type RawAxiosRequestConfig<D = any> = AxiosRequestConfig<D>;
|
|
373
|
+
|
|
374
|
+
interface InternalAxiosRequestConfig<D = any> extends AxiosRequestConfig<D> {
|
|
375
|
+
headers: AxiosRequestHeaders;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
interface HeadersDefaults {
|
|
379
|
+
common: RawAxiosRequestHeaders;
|
|
380
|
+
delete: RawAxiosRequestHeaders;
|
|
381
|
+
get: RawAxiosRequestHeaders;
|
|
382
|
+
head: RawAxiosRequestHeaders;
|
|
383
|
+
post: RawAxiosRequestHeaders;
|
|
384
|
+
put: RawAxiosRequestHeaders;
|
|
385
|
+
patch: RawAxiosRequestHeaders;
|
|
386
|
+
options?: RawAxiosRequestHeaders;
|
|
387
|
+
purge?: RawAxiosRequestHeaders;
|
|
388
|
+
link?: RawAxiosRequestHeaders;
|
|
389
|
+
unlink?: RawAxiosRequestHeaders;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
interface AxiosDefaults<D = any> extends Omit<AxiosRequestConfig<D>, 'headers'> {
|
|
393
|
+
headers: HeadersDefaults;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
interface CreateAxiosDefaults<D = any> extends Omit<AxiosRequestConfig<D>, 'headers'> {
|
|
397
|
+
headers?: RawAxiosRequestHeaders | AxiosHeaders | Partial<HeadersDefaults>;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
interface AxiosResponse<T = any, D = any, H = {}> {
|
|
401
|
+
data: T;
|
|
402
|
+
status: number;
|
|
403
|
+
statusText: string;
|
|
404
|
+
headers: H & RawAxiosResponseHeaders | AxiosResponseHeaders;
|
|
405
|
+
config: InternalAxiosRequestConfig<D>;
|
|
406
|
+
request?: any;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
declare class AxiosError<T = unknown, D = any> extends Error {
|
|
410
|
+
constructor(
|
|
411
|
+
message?: string,
|
|
412
|
+
code?: string,
|
|
413
|
+
config?: InternalAxiosRequestConfig<D>,
|
|
414
|
+
request?: any,
|
|
415
|
+
response?: AxiosResponse<T, D>
|
|
416
|
+
);
|
|
417
|
+
|
|
418
|
+
config?: InternalAxiosRequestConfig<D>;
|
|
419
|
+
code?: string;
|
|
420
|
+
request?: any;
|
|
421
|
+
response?: AxiosResponse<T, D>;
|
|
422
|
+
isAxiosError: boolean;
|
|
423
|
+
status?: number;
|
|
424
|
+
toJSON: () => object;
|
|
425
|
+
cause?: unknown;
|
|
426
|
+
event?: BrowserProgressEvent;
|
|
427
|
+
static from<T = unknown, D = any>(
|
|
428
|
+
error: Error | unknown,
|
|
429
|
+
code?: string,
|
|
430
|
+
config?: InternalAxiosRequestConfig<D>,
|
|
431
|
+
request?: any,
|
|
432
|
+
response?: AxiosResponse<T, D>,
|
|
433
|
+
customProps?: object,
|
|
434
|
+
): AxiosError<T, D>;
|
|
435
|
+
static readonly ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
|
|
436
|
+
static readonly ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
|
|
437
|
+
static readonly ERR_BAD_OPTION = "ERR_BAD_OPTION";
|
|
438
|
+
static readonly ERR_NETWORK = "ERR_NETWORK";
|
|
439
|
+
static readonly ERR_DEPRECATED = "ERR_DEPRECATED";
|
|
440
|
+
static readonly ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
|
|
441
|
+
static readonly ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
|
|
442
|
+
static readonly ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
|
|
443
|
+
static readonly ERR_INVALID_URL = "ERR_INVALID_URL";
|
|
444
|
+
static readonly ERR_CANCELED = "ERR_CANCELED";
|
|
445
|
+
static readonly ECONNABORTED = "ECONNABORTED";
|
|
446
|
+
static readonly ETIMEDOUT = "ETIMEDOUT";
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
declare class CanceledError<T> extends AxiosError<T> {
|
|
450
|
+
readonly name: "CanceledError";
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
type AxiosPromise<T = any> = Promise<AxiosResponse<T>>;
|
|
454
|
+
|
|
455
|
+
interface CancelStatic {
|
|
456
|
+
new (message?: string): Cancel;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
interface Cancel {
|
|
460
|
+
message: string | undefined;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
interface Canceler {
|
|
464
|
+
(message?: string, config?: AxiosRequestConfig, request?: any): void;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
interface CancelTokenStatic {
|
|
468
|
+
new (executor: (cancel: Canceler) => void): CancelToken;
|
|
469
|
+
source(): CancelTokenSource;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
interface CancelToken {
|
|
473
|
+
promise: Promise<Cancel>;
|
|
474
|
+
reason?: Cancel;
|
|
475
|
+
throwIfRequested(): void;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
interface CancelTokenSource {
|
|
479
|
+
token: CancelToken;
|
|
480
|
+
cancel: Canceler;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
interface AxiosInterceptorOptions {
|
|
484
|
+
synchronous?: boolean;
|
|
485
|
+
runWhen?: (config: InternalAxiosRequestConfig) => boolean;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
type AxiosRequestInterceptorUse<T> = (onFulfilled?: ((value: T) => T | Promise<T>) | null, onRejected?: ((error: any) => any) | null, options?: AxiosInterceptorOptions) => number;
|
|
489
|
+
|
|
490
|
+
type AxiosResponseInterceptorUse<T> = (onFulfilled?: ((value: T) => T | Promise<T>) | null, onRejected?: ((error: any) => any) | null) => number;
|
|
491
|
+
|
|
492
|
+
interface AxiosInterceptorManager<V> {
|
|
493
|
+
use: V extends AxiosResponse ? AxiosResponseInterceptorUse<V> : AxiosRequestInterceptorUse<V>;
|
|
494
|
+
eject(id: number): void;
|
|
495
|
+
clear(): void;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
declare class Axios {
|
|
499
|
+
constructor(config?: AxiosRequestConfig);
|
|
500
|
+
defaults: AxiosDefaults;
|
|
501
|
+
interceptors: {
|
|
502
|
+
request: AxiosInterceptorManager<InternalAxiosRequestConfig>;
|
|
503
|
+
response: AxiosInterceptorManager<AxiosResponse>;
|
|
504
|
+
};
|
|
505
|
+
getUri(config?: AxiosRequestConfig): string;
|
|
506
|
+
request<T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D>): Promise<R>;
|
|
507
|
+
get<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
|
|
508
|
+
delete<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
|
|
509
|
+
head<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
|
|
510
|
+
options<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
|
|
511
|
+
post<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
|
|
512
|
+
put<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
|
|
513
|
+
patch<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
|
|
514
|
+
postForm<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
|
|
515
|
+
putForm<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
|
|
516
|
+
patchForm<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
interface AxiosInstance extends Axios {
|
|
520
|
+
<T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D>): Promise<R>;
|
|
521
|
+
<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
|
|
522
|
+
|
|
523
|
+
create(config?: CreateAxiosDefaults): AxiosInstance;
|
|
524
|
+
defaults: Omit<AxiosDefaults, 'headers'> & {
|
|
525
|
+
headers: HeadersDefaults & {
|
|
526
|
+
[key: string]: AxiosHeaderValue
|
|
527
|
+
}
|
|
528
|
+
};
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
interface GenericFormData {
|
|
532
|
+
append(name: string, value: any, options?: any): any;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
interface GenericHTMLFormElement {
|
|
536
|
+
name: string;
|
|
537
|
+
method: string;
|
|
538
|
+
submit(): void;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
declare function getAdapter(adapters: AxiosAdapterConfig | AxiosAdapterConfig[] | undefined): AxiosAdapter;
|
|
542
|
+
|
|
543
|
+
declare function toFormData(sourceObj: object, targetFormData?: GenericFormData, options?: FormSerializerOptions): GenericFormData;
|
|
544
|
+
|
|
545
|
+
declare function formToJSON(form: GenericFormData|GenericHTMLFormElement): object;
|
|
546
|
+
|
|
547
|
+
declare function isAxiosError<T = any, D = any>(payload: any): payload is AxiosError<T, D>;
|
|
548
|
+
|
|
549
|
+
declare function spread<T, R>(callback: (...args: T[]) => R): (array: T[]) => R;
|
|
550
|
+
|
|
551
|
+
declare function isCancel<T = any>(value: any): value is CanceledError<T>;
|
|
552
|
+
|
|
553
|
+
declare function all<T>(values: Array<T | Promise<T>>): Promise<T[]>;
|
|
554
|
+
|
|
555
|
+
declare function mergeConfig<D = any>(config1: AxiosRequestConfig<D>, config2: AxiosRequestConfig<D>): AxiosRequestConfig<D>;
|
|
556
|
+
|
|
557
|
+
interface AxiosStatic extends AxiosInstance {
|
|
558
|
+
Cancel: CancelStatic;
|
|
559
|
+
CancelToken: CancelTokenStatic;
|
|
560
|
+
Axios: typeof Axios;
|
|
561
|
+
AxiosError: typeof AxiosError;
|
|
562
|
+
HttpStatusCode: typeof HttpStatusCode;
|
|
563
|
+
readonly VERSION: string;
|
|
564
|
+
isCancel: typeof isCancel;
|
|
565
|
+
all: typeof all;
|
|
566
|
+
spread: typeof spread;
|
|
567
|
+
isAxiosError: typeof isAxiosError;
|
|
568
|
+
toFormData: typeof toFormData;
|
|
569
|
+
formToJSON: typeof formToJSON;
|
|
570
|
+
getAdapter: typeof getAdapter;
|
|
571
|
+
CanceledError: typeof CanceledError;
|
|
572
|
+
AxiosHeaders: typeof AxiosHeaders;
|
|
573
|
+
mergeConfig: typeof mergeConfig;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
declare const axios: AxiosStatic;
|
|
577
|
+
|
|
578
|
+
export { Axios, AxiosError, AxiosHeaders, CanceledError, HttpStatusCode, all, axios as default, formToJSON, getAdapter, isAxiosError, isCancel, mergeConfig, spread, toFormData };
|
|
579
|
+
export type { AddressFamily, AxiosAdapter, AxiosBasicCredentials, AxiosDefaults, AxiosHeaderValue, AxiosInstance, AxiosInterceptorManager, AxiosInterceptorOptions, AxiosProgressEvent, AxiosPromise, AxiosProxyConfig, AxiosRequestConfig, AxiosRequestHeaders, AxiosRequestTransformer, AxiosResponse, AxiosResponseHeaders, AxiosResponseTransformer, AxiosStatic, Cancel, CancelStatic, CancelToken, CancelTokenSource, CancelTokenStatic, Canceler, CreateAxiosDefaults, CustomParamsSerializer, FormDataVisitorHelpers, FormSerializerOptions, GenericAbortSignal, GenericFormData, GenericHTMLFormElement, HeadersDefaults, InternalAxiosRequestConfig, LookupAddress, LookupAddressEntry, Method, ParamEncoder, ParamsSerializerOptions, RawAxiosRequestConfig, RawAxiosRequestHeaders, RawAxiosResponseHeaders, ResponseType, SerializerOptions, SerializerVisitor, TransitionalOptions, responseEncoding };
|