source: frontend/node_modules/axios/index.d.ts

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

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