index.d.ts 18 KB

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