index.d.cts 18 KB

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