mirror of
https://github.com/axios/axios.git
synced 2026-04-11 02:11:50 +08:00
fix: all merge configs
This commit is contained in:
commit
253e3ad06a
604
CHANGELOG.md
604
CHANGELOG.md
File diff suppressed because it is too large
Load Diff
@ -8,16 +8,18 @@ We celebrate diversity and inclusivity regardless of age, body size, disability,
|
|||||||
## Our Standards
|
## Our Standards
|
||||||
|
|
||||||
Examples of positive behavior include:
|
Examples of positive behavior include:
|
||||||
* Showing empathy and kindness toward others
|
|
||||||
* Being respectful of different opinions and experiences
|
- Showing empathy and kindness toward others
|
||||||
* Accepting feedback gracefully and learning from it
|
- Being respectful of different opinions and experiences
|
||||||
* Taking responsibility for mistakes and offering sincere apologies
|
- Accepting feedback gracefully and learning from it
|
||||||
|
- Taking responsibility for mistakes and offering sincere apologies
|
||||||
|
|
||||||
Unacceptable behaviors include:
|
Unacceptable behaviors include:
|
||||||
* Use of sexualized language, imagery, or advances
|
|
||||||
* Personal attacks, trolling, or insulting comments
|
- Use of sexualized language, imagery, or advances
|
||||||
* Publishing private information (such as email or address) without permission
|
- Personal attacks, trolling, or insulting comments
|
||||||
* Any other conduct that would be considered inappropriate in a professional setting
|
- Publishing private information (such as email or address) without permission
|
||||||
|
- Any other conduct that would be considered inappropriate in a professional setting
|
||||||
|
|
||||||
## Enforcement
|
## Enforcement
|
||||||
|
|
||||||
@ -26,9 +28,9 @@ All complaints will be reviewed promptly and treated confidentially.
|
|||||||
|
|
||||||
## Enforcement Guidelines
|
## Enforcement Guidelines
|
||||||
|
|
||||||
1. **Correction** – A private warning and explanation of why the behavior was inappropriate.
|
1. **Correction** – A private warning and explanation of why the behavior was inappropriate.
|
||||||
2. **Warning** – A clear warning with consequences for continued behavior.
|
2. **Warning** – A clear warning with consequences for continued behavior.
|
||||||
3. **Temporary Ban** – A temporary ban for repeated or severe violations.
|
3. **Temporary Ban** – A temporary ban for repeated or severe violations.
|
||||||
4. **Permanent Ban** – A permanent removal for repeated harassment or sustained inappropriate conduct.
|
4. **Permanent Ban** – A permanent removal for repeated harassment or sustained inappropriate conduct.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
@ -2,13 +2,13 @@
|
|||||||
|
|
||||||
As a collaborator, you will be involved with axios with some administrative responsibilities. This guide will help you understand your role and the responsibilities that come with being a collaborator.
|
As a collaborator, you will be involved with axios with some administrative responsibilities. This guide will help you understand your role and the responsibilities that come with being a collaborator.
|
||||||
|
|
||||||
1. __Adhere to and help enforce the Code of Conduct.__ It is expected that you have read the [code of conduct](https://github.com/axios/axios/blob/master/CODE_OF_CONDUCT.md) and that you agree to live by it. This community should be friendly and welcoming.
|
1. **Adhere to and help enforce the Code of Conduct.** It is expected that you have read the [code of conduct](https://github.com/axios/axios/blob/master/CODE_OF_CONDUCT.md) and that you agree to live by it. This community should be friendly and welcoming.
|
||||||
|
|
||||||
1. __Triage issues.__ As a collaborator, you may help sort through the issues that are reported. Issues vary from bugs, regressions, feature requests, questions, etc. Apply the appropriate label(s) and respond as needed. If it is a legitimate request, please address it, otherwise feel free to close the issue and include a comment with a suggestion on where to find support. If an issue has been inactive for more than a week (i.e., the owner of the issue hasn’t responded to you), close the issue with a note indicating stale issues are closed; it can always be reopened if needed. In the case of issues that require a code change, encourage the owner to submit a PR. For less complex code changes, add a very simple and detailed checklist, apply the “first-timers-only” label, and encourage a newcomer to open source to get involved.
|
1. **Triage issues.** As a collaborator, you may help sort through the issues that are reported. Issues vary from bugs, regressions, feature requests, questions, etc. Apply the appropriate label(s) and respond as needed. If it is a legitimate request, please address it, otherwise feel free to close the issue and include a comment with a suggestion on where to find support. If an issue has been inactive for more than a week (i.e., the owner of the issue hasn’t responded to you), close the issue with a note indicating stale issues are closed; it can always be reopened if needed. In the case of issues that require a code change, encourage the owner to submit a PR. For less complex code changes, add a very simple and detailed checklist, apply the “first-timers-only” label, and encourage a newcomer to open source to get involved.
|
||||||
|
|
||||||
1. __Answer questions.__ It is not expected that you provide answers to questions that aren’t relevant, nor do you need to mentor people on how to use JavaScript, etc. If the question is not directly about the module, please close the issue. If the question stems from poor documentation, please update the docs and consider adding a code example. In any event try to be helpful and remember that there’s no such thing as a stupid question.
|
1. **Answer questions.** It is not expected that you provide answers to questions that aren’t relevant, nor do you need to mentor people on how to use JavaScript, etc. If the question is not directly about the module, please close the issue. If the question stems from poor documentation, please update the docs and consider adding a code example. In any event try to be helpful and remember that there’s no such thing as a stupid question.
|
||||||
|
|
||||||
1. __Assist with PRs.__ By encouraging contributors to supply a PR for their own issue this is ideally where most of your attention will be focused. Keep a few things in mind as you review PRs.
|
1. **Assist with PRs.** By encouraging contributors to supply a PR for their own issue this is ideally where most of your attention will be focused. Keep a few things in mind as you review PRs.
|
||||||
|
|
||||||
- When fixing a bug: does the PR adequately solve the problem without introducing any regressions?
|
- When fixing a bug: does the PR adequately solve the problem without introducing any regressions?
|
||||||
- When implementing a feature: does the feature fit within the scope of axios?
|
- When implementing a feature: does the feature fit within the scope of axios?
|
||||||
@ -18,6 +18,6 @@ As a collaborator, you will be involved with axios with some administrative resp
|
|||||||
- Do the tests and linting pass CI?
|
- Do the tests and linting pass CI?
|
||||||
- Are there tests to validate the changes that have been made?
|
- Are there tests to validate the changes that have been made?
|
||||||
|
|
||||||
1. __Fix bugs and implement features.__ When things need to be fixed or implemented, and a PR can’t wait, you may do things yourself. You should still submit a PR yourself and get it checked off by at least one other contributor. Keep the points from number 4 in consideration as you push your code.
|
1. **Fix bugs and implement features.** When things need to be fixed or implemented, and a PR can’t wait, you may do things yourself. You should still submit a PR yourself and get it checked off by at least one other contributor. Keep the points from number 4 in consideration as you push your code.
|
||||||
|
|
||||||
Thank you again for your help as a collaborator and in making axios community great! If you have any questions or need any assistance, please feel free to contact another collaborator or the owner.
|
Thank you again for your help as a collaborator and in making axios community great! If you have any questions or need any assistance, please feel free to contact another collaborator or the owner.
|
||||||
|
|||||||
58
ECOSYSTEM.md
58
ECOSYSTEM.md
@ -6,44 +6,44 @@ This is a list of axios related libraries and resources. If you have a suggestio
|
|||||||
|
|
||||||
### General
|
### General
|
||||||
|
|
||||||
* [axios-vcr](https://github.com/nettofarah/axios-vcr) - 📼 Record and Replay Axios requests
|
- [axios-vcr](https://github.com/nettofarah/axios-vcr) - 📼 Record and Replay Axios requests
|
||||||
* [@3846masa/axios-cookiejar-support](https://github.com/3846masa/axios-cookiejar-support) - Add tough-cookie support to axios
|
- [@3846masa/axios-cookiejar-support](https://github.com/3846masa/axios-cookiejar-support) - Add tough-cookie support to axios
|
||||||
* [axios-method-override](https://github.com/jacobbuck/axios-method-override) - Axios http request method override plugin
|
- [axios-method-override](https://github.com/jacobbuck/axios-method-override) - Axios http request method override plugin
|
||||||
* [axios-cache-plugin](https://github.com/jin5354/axios-cache-plugin) - Help you cache GET requests when using axios.
|
- [axios-cache-plugin](https://github.com/jin5354/axios-cache-plugin) - Help you cache GET requests when using axios.
|
||||||
* [axios-extensions](https://github.com/kuitos/axios-extensions) - A collection of axios extensions, including throttle and cache GET request plugin.
|
- [axios-extensions](https://github.com/kuitos/axios-extensions) - A collection of axios extensions, including throttle and cache GET request plugin.
|
||||||
* [axios-fetch](https://github.com/lifeomic/axios-fetch) - A WebAPI Fetch implementation backed by an Axios client
|
- [axios-fetch](https://github.com/lifeomic/axios-fetch) - A WebAPI Fetch implementation backed by an Axios client
|
||||||
* [axios-actions](https://github.com/davestewart/axios-actions) - Bundle endpoints as callable, reusable services
|
- [axios-actions](https://github.com/davestewart/axios-actions) - Bundle endpoints as callable, reusable services
|
||||||
* [axios-api-versioning](https://weffe.github.io/axios-api-versioning) - Add easy to manage api versioning to axios
|
- [axios-api-versioning](https://weffe.github.io/axios-api-versioning) - Add easy to manage api versioning to axios
|
||||||
* [axios-data-unpacker](https://github.com/anubhavsrivastava/axios-data-unpacker) - Axios interceptor that unpacks HTTP responses so that you can focus on actual server data.
|
- [axios-data-unpacker](https://github.com/anubhavsrivastava/axios-data-unpacker) - Axios interceptor that unpacks HTTP responses so that you can focus on actual server data.
|
||||||
* [r2curl](https://github.com/uyu423/r2curl) - Extracts the cURL command string from the Axios object. (AxiosResponse, AxiosRequestConfig)
|
- [r2curl](https://github.com/uyu423/r2curl) - Extracts the cURL command string from the Axios object. (AxiosResponse, AxiosRequestConfig)
|
||||||
* [axios-endpoints](https://github.com/renancaraujo/axios-endpoints) - Axios endpoints help you to create a more concise endpoint mapping with axios.
|
- [axios-endpoints](https://github.com/renancaraujo/axios-endpoints) - Axios endpoints help you to create a more concise endpoint mapping with axios.
|
||||||
* [axios-multi-api](https://github.com/MattCCC/axios-multi-api) - Easy API handling whenever there are many endpoints to add. It helps to make Axios requests in an easy and declarative manner.
|
- [axios-multi-api](https://github.com/MattCCC/axios-multi-api) - Easy API handling whenever there are many endpoints to add. It helps to make Axios requests in an easy and declarative manner.
|
||||||
* [axios-url-template](https://github.com/rafw87/axios-url-template) - Axios interceptor adding support for URL templates.
|
- [axios-url-template](https://github.com/rafw87/axios-url-template) - Axios interceptor adding support for URL templates.
|
||||||
|
|
||||||
### API clients
|
### API clients
|
||||||
|
|
||||||
* [@hey-api/openapi-ts](https://heyapi.dev/openapi-ts/clients/axios) - The OpenAPI to TypeScript codegen. Generate clients, SDKs, validators, and more.
|
- [@hey-api/openapi-ts](https://heyapi.dev/openapi-ts/clients/axios) - The OpenAPI to TypeScript codegen. Generate clients, SDKs, validators, and more.
|
||||||
* [swagger-taxos-codegen](https://github.com/michalzaq12/swagger-taxos-codegen) - Axios based Swagger Codegen (tailored for typescript)
|
- [swagger-taxos-codegen](https://github.com/michalzaq12/swagger-taxos-codegen) - Axios based Swagger Codegen (tailored for typescript)
|
||||||
* [zodios](https://www.zodios.org) - Typesafe API client based on axios
|
- [zodios](https://www.zodios.org) - Typesafe API client based on axios
|
||||||
|
|
||||||
### Logging and debugging
|
### Logging and debugging
|
||||||
|
|
||||||
* [axios-response-logger](https://github.com/srph/axios-response-logger) - Axios interceptor which logs responses
|
- [axios-response-logger](https://github.com/srph/axios-response-logger) - Axios interceptor which logs responses
|
||||||
* [axios-debug-log](https://github.com/Gerhut/axios-debug-log) - Axios interceptor of logging requests & responses by debug.
|
- [axios-debug-log](https://github.com/Gerhut/axios-debug-log) - Axios interceptor of logging requests & responses by debug.
|
||||||
* [axios-curlirize](https://www.npmjs.com/package/axios-curlirize) - Logs axios requests as curl commands, also adds a property to the response object with the curl command as value.
|
- [axios-curlirize](https://www.npmjs.com/package/axios-curlirize) - Logs axios requests as curl commands, also adds a property to the response object with the curl command as value.
|
||||||
|
|
||||||
### React and redux
|
### React and redux
|
||||||
|
|
||||||
* [axios-hooks](https://github.com/simoneb/axios-hooks) - 🦆 React hooks for axios, with built-in support for server side rendering
|
- [axios-hooks](https://github.com/simoneb/axios-hooks) - 🦆 React hooks for axios, with built-in support for server side rendering
|
||||||
* [react-hooks-axios](https://github.com/use-hooks/react-hooks-axios) - Custom React Hooks for Axios.js
|
- [react-hooks-axios](https://github.com/use-hooks/react-hooks-axios) - Custom React Hooks for Axios.js
|
||||||
* [redux-saga-requests](https://github.com/klis87/redux-saga-requests) - Redux-Saga addon to simplify handling of AJAX requests.
|
- [redux-saga-requests](https://github.com/klis87/redux-saga-requests) - Redux-Saga addon to simplify handling of AJAX requests.
|
||||||
* [redux-axios-middleware](https://github.com/svrcekmichal/redux-axios-middleware) - Redux middleware for fetching data with axios HTTP client
|
- [redux-axios-middleware](https://github.com/svrcekmichal/redux-axios-middleware) - Redux middleware for fetching data with axios HTTP client
|
||||||
* [@react-cmpt/react-request-hook](https://github.com/react-cmpt/react-request-hook) - A React hook plugin for axios. Lightweight and less change.
|
- [@react-cmpt/react-request-hook](https://github.com/react-cmpt/react-request-hook) - A React hook plugin for axios. Lightweight and less change.
|
||||||
|
|
||||||
### Unit testing
|
### Unit testing
|
||||||
|
|
||||||
* [axiosist](https://github.com/Gerhut/axiosist) - Axios based supertest: convert node.js request handler to axios adapter, used for node.js server unit test.
|
- [axiosist](https://github.com/Gerhut/axiosist) - Axios based supertest: convert node.js request handler to axios adapter, used for node.js server unit test.
|
||||||
* [axios-mock-adapter](https://github.com/ctimmerm/axios-mock-adapter) — Axios adapter that allows for easily mocking requests
|
- [axios-mock-adapter](https://github.com/ctimmerm/axios-mock-adapter) — Axios adapter that allows for easily mocking requests
|
||||||
* [axios-test-instance](https://github.com/remcohaszing/axios-test-instance) — Test NodeJS backends using Axios
|
- [axios-test-instance](https://github.com/remcohaszing/axios-test-instance) — Test NodeJS backends using Axios
|
||||||
* [moxios](https://github.com/axios/moxios) - Mock axios requests for testing
|
- [moxios](https://github.com/axios/moxios) - Mock axios requests for testing
|
||||||
* [mocha-axios](https://github.com/jdrydn/mocha-axios) - Streamlined integration testing with Mocha & Axios
|
- [mocha-axios](https://github.com/jdrydn/mocha-axios) - Streamlined integration testing with Mocha & Axios
|
||||||
|
|||||||
424
index.d.ts
vendored
424
index.d.ts
vendored
@ -1,29 +1,49 @@
|
|||||||
// TypeScript Version: 4.7
|
// TypeScript Version: 4.7
|
||||||
type StringLiteralsOrString<Literals extends string> = Literals | (string & {});
|
type StringLiteralsOrString<Literals extends string> = Literals | (string & {});
|
||||||
|
|
||||||
export type AxiosHeaderValue = AxiosHeaders | string | string[] | number | boolean | null;
|
export type AxiosHeaderValue =
|
||||||
|
| AxiosHeaders
|
||||||
|
| string
|
||||||
|
| string[]
|
||||||
|
| number
|
||||||
|
| boolean
|
||||||
|
| null;
|
||||||
|
|
||||||
interface RawAxiosHeaders {
|
interface RawAxiosHeaders {
|
||||||
[key: string]: AxiosHeaderValue;
|
[key: string]: AxiosHeaderValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
type MethodsHeaders = Partial<{
|
type MethodsHeaders = Partial<
|
||||||
[Key in Method as Lowercase<Key>]: AxiosHeaders;
|
{
|
||||||
} & {common: AxiosHeaders}>;
|
[Key in Method as Lowercase<Key>]: AxiosHeaders;
|
||||||
|
} & { common: AxiosHeaders }
|
||||||
|
>;
|
||||||
|
|
||||||
type AxiosHeaderMatcher = string | RegExp | ((this: AxiosHeaders, value: string, name: string) => boolean);
|
type AxiosHeaderMatcher =
|
||||||
|
| string
|
||||||
|
| RegExp
|
||||||
|
| ((this: AxiosHeaders, value: string, name: string) => boolean);
|
||||||
|
|
||||||
type AxiosHeaderParser = (this: AxiosHeaders, value: AxiosHeaderValue, header: string) => any;
|
type AxiosHeaderParser = (
|
||||||
|
this: AxiosHeaders,
|
||||||
|
value: AxiosHeaderValue,
|
||||||
|
header: string,
|
||||||
|
) => any;
|
||||||
|
|
||||||
export class AxiosHeaders {
|
export class AxiosHeaders {
|
||||||
constructor(
|
constructor(headers?: RawAxiosHeaders | AxiosHeaders | string);
|
||||||
headers?: RawAxiosHeaders | AxiosHeaders | string
|
|
||||||
);
|
|
||||||
|
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
|
|
||||||
set(headerName?: string, value?: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
set(
|
||||||
set(headers?: RawAxiosHeaders | AxiosHeaders | string, rewrite?: boolean): AxiosHeaders;
|
headerName?: string,
|
||||||
|
value?: AxiosHeaderValue,
|
||||||
|
rewrite?: boolean | AxiosHeaderMatcher,
|
||||||
|
): AxiosHeaders;
|
||||||
|
set(
|
||||||
|
headers?: RawAxiosHeaders | AxiosHeaders | string,
|
||||||
|
rewrite?: boolean,
|
||||||
|
): AxiosHeaders;
|
||||||
|
|
||||||
get(headerName: string, parser: RegExp): RegExpExecArray | null;
|
get(headerName: string, parser: RegExp): RegExpExecArray | null;
|
||||||
get(headerName: string, matcher?: true | AxiosHeaderParser): AxiosHeaderValue;
|
get(headerName: string, matcher?: true | AxiosHeaderParser): AxiosHeaderValue;
|
||||||
@ -36,7 +56,11 @@ export class AxiosHeaders {
|
|||||||
|
|
||||||
normalize(format: boolean): AxiosHeaders;
|
normalize(format: boolean): AxiosHeaders;
|
||||||
|
|
||||||
concat(...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null>): AxiosHeaders;
|
concat(
|
||||||
|
...targets: Array<
|
||||||
|
AxiosHeaders | RawAxiosHeaders | string | undefined | null
|
||||||
|
>
|
||||||
|
): AxiosHeaders;
|
||||||
|
|
||||||
toJSON(asStrings?: boolean): RawAxiosHeaders;
|
toJSON(asStrings?: boolean): RawAxiosHeaders;
|
||||||
|
|
||||||
@ -44,34 +68,56 @@ export class AxiosHeaders {
|
|||||||
|
|
||||||
static accessor(header: string | string[]): AxiosHeaders;
|
static accessor(header: string | string[]): AxiosHeaders;
|
||||||
|
|
||||||
static concat(...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null>): AxiosHeaders;
|
static concat(
|
||||||
|
...targets: Array<
|
||||||
|
AxiosHeaders | RawAxiosHeaders | string | undefined | null
|
||||||
|
>
|
||||||
|
): AxiosHeaders;
|
||||||
|
|
||||||
setContentType(value: ContentType, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
setContentType(
|
||||||
|
value: ContentType,
|
||||||
|
rewrite?: boolean | AxiosHeaderMatcher,
|
||||||
|
): AxiosHeaders;
|
||||||
getContentType(parser?: RegExp): RegExpExecArray | null;
|
getContentType(parser?: RegExp): RegExpExecArray | null;
|
||||||
getContentType(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
getContentType(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
||||||
hasContentType(matcher?: AxiosHeaderMatcher): boolean;
|
hasContentType(matcher?: AxiosHeaderMatcher): boolean;
|
||||||
|
|
||||||
setContentLength(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
setContentLength(
|
||||||
|
value: AxiosHeaderValue,
|
||||||
|
rewrite?: boolean | AxiosHeaderMatcher,
|
||||||
|
): AxiosHeaders;
|
||||||
getContentLength(parser?: RegExp): RegExpExecArray | null;
|
getContentLength(parser?: RegExp): RegExpExecArray | null;
|
||||||
getContentLength(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
getContentLength(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
||||||
hasContentLength(matcher?: AxiosHeaderMatcher): boolean;
|
hasContentLength(matcher?: AxiosHeaderMatcher): boolean;
|
||||||
|
|
||||||
setAccept(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
setAccept(
|
||||||
|
value: AxiosHeaderValue,
|
||||||
|
rewrite?: boolean | AxiosHeaderMatcher,
|
||||||
|
): AxiosHeaders;
|
||||||
getAccept(parser?: RegExp): RegExpExecArray | null;
|
getAccept(parser?: RegExp): RegExpExecArray | null;
|
||||||
getAccept(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
getAccept(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
||||||
hasAccept(matcher?: AxiosHeaderMatcher): boolean;
|
hasAccept(matcher?: AxiosHeaderMatcher): boolean;
|
||||||
|
|
||||||
setUserAgent(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
setUserAgent(
|
||||||
|
value: AxiosHeaderValue,
|
||||||
|
rewrite?: boolean | AxiosHeaderMatcher,
|
||||||
|
): AxiosHeaders;
|
||||||
getUserAgent(parser?: RegExp): RegExpExecArray | null;
|
getUserAgent(parser?: RegExp): RegExpExecArray | null;
|
||||||
getUserAgent(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
getUserAgent(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
||||||
hasUserAgent(matcher?: AxiosHeaderMatcher): boolean;
|
hasUserAgent(matcher?: AxiosHeaderMatcher): boolean;
|
||||||
|
|
||||||
setContentEncoding(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
setContentEncoding(
|
||||||
|
value: AxiosHeaderValue,
|
||||||
|
rewrite?: boolean | AxiosHeaderMatcher,
|
||||||
|
): AxiosHeaders;
|
||||||
getContentEncoding(parser?: RegExp): RegExpExecArray | null;
|
getContentEncoding(parser?: RegExp): RegExpExecArray | null;
|
||||||
getContentEncoding(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
getContentEncoding(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
||||||
hasContentEncoding(matcher?: AxiosHeaderMatcher): boolean;
|
hasContentEncoding(matcher?: AxiosHeaderMatcher): boolean;
|
||||||
|
|
||||||
setAuthorization(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
setAuthorization(
|
||||||
|
value: AxiosHeaderValue,
|
||||||
|
rewrite?: boolean | AxiosHeaderMatcher,
|
||||||
|
): AxiosHeaders;
|
||||||
getAuthorization(parser?: RegExp): RegExpExecArray | null;
|
getAuthorization(parser?: RegExp): RegExpExecArray | null;
|
||||||
getAuthorization(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
getAuthorization(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
||||||
hasAuthorization(matcher?: AxiosHeaderMatcher): boolean;
|
hasAuthorization(matcher?: AxiosHeaderMatcher): boolean;
|
||||||
@ -81,19 +127,38 @@ export class AxiosHeaders {
|
|||||||
[Symbol.iterator](): IterableIterator<[string, AxiosHeaderValue]>;
|
[Symbol.iterator](): IterableIterator<[string, AxiosHeaderValue]>;
|
||||||
}
|
}
|
||||||
|
|
||||||
type CommonRequestHeadersList = 'Accept' | 'Content-Length' | 'User-Agent' | 'Content-Encoding' | 'Authorization';
|
type CommonRequestHeadersList =
|
||||||
|
| "Accept"
|
||||||
|
| "Content-Length"
|
||||||
|
| "User-Agent"
|
||||||
|
| "Content-Encoding"
|
||||||
|
| "Authorization";
|
||||||
|
|
||||||
type ContentType = AxiosHeaderValue | 'text/html' | 'text/plain' | 'multipart/form-data' | 'application/json' | 'application/x-www-form-urlencoded' | 'application/octet-stream';
|
type ContentType =
|
||||||
|
| AxiosHeaderValue
|
||||||
|
| "text/html"
|
||||||
|
| "text/plain"
|
||||||
|
| "multipart/form-data"
|
||||||
|
| "application/json"
|
||||||
|
| "application/x-www-form-urlencoded"
|
||||||
|
| "application/octet-stream";
|
||||||
|
|
||||||
export type RawAxiosRequestHeaders = Partial<RawAxiosHeaders & {
|
export type RawAxiosRequestHeaders = Partial<
|
||||||
[Key in CommonRequestHeadersList]: AxiosHeaderValue;
|
RawAxiosHeaders & {
|
||||||
} & {
|
[Key in CommonRequestHeadersList]: AxiosHeaderValue;
|
||||||
'Content-Type': ContentType
|
} & {
|
||||||
}>;
|
"Content-Type": ContentType;
|
||||||
|
}
|
||||||
|
>;
|
||||||
|
|
||||||
export type AxiosRequestHeaders = RawAxiosRequestHeaders & AxiosHeaders;
|
export type AxiosRequestHeaders = RawAxiosRequestHeaders & AxiosHeaders;
|
||||||
|
|
||||||
type CommonResponseHeadersList = 'Server' | 'Content-Type' | 'Content-Length' | 'Cache-Control'| 'Content-Encoding';
|
type CommonResponseHeadersList =
|
||||||
|
| "Server"
|
||||||
|
| "Content-Type"
|
||||||
|
| "Content-Length"
|
||||||
|
| "Cache-Control"
|
||||||
|
| "Content-Encoding";
|
||||||
|
|
||||||
type RawCommonResponseHeaders = {
|
type RawCommonResponseHeaders = {
|
||||||
[Key in CommonResponseHeadersList]: AxiosHeaderValue;
|
[Key in CommonResponseHeadersList]: AxiosHeaderValue;
|
||||||
@ -101,16 +166,27 @@ type RawCommonResponseHeaders = {
|
|||||||
"set-cookie": string[];
|
"set-cookie": string[];
|
||||||
};
|
};
|
||||||
|
|
||||||
export type RawAxiosResponseHeaders = Partial<RawAxiosHeaders & RawCommonResponseHeaders>;
|
export type RawAxiosResponseHeaders = Partial<
|
||||||
|
RawAxiosHeaders & RawCommonResponseHeaders
|
||||||
|
>;
|
||||||
|
|
||||||
export type AxiosResponseHeaders = RawAxiosResponseHeaders & AxiosHeaders;
|
export type AxiosResponseHeaders = RawAxiosResponseHeaders & AxiosHeaders;
|
||||||
|
|
||||||
export interface AxiosRequestTransformer {
|
export interface AxiosRequestTransformer {
|
||||||
(this: InternalAxiosRequestConfig, data: any, headers: AxiosRequestHeaders): any;
|
(
|
||||||
|
this: InternalAxiosRequestConfig,
|
||||||
|
data: any,
|
||||||
|
headers: AxiosRequestHeaders,
|
||||||
|
): any;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AxiosResponseTransformer {
|
export interface AxiosResponseTransformer {
|
||||||
(this: InternalAxiosRequestConfig, data: any, headers: AxiosResponseHeaders, status?: number): any;
|
(
|
||||||
|
this: InternalAxiosRequestConfig,
|
||||||
|
data: any,
|
||||||
|
headers: AxiosResponseHeaders,
|
||||||
|
status?: number,
|
||||||
|
): any;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AxiosAdapter {
|
export interface AxiosAdapter {
|
||||||
@ -196,39 +272,61 @@ export enum HttpStatusCode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export type Method =
|
export type Method =
|
||||||
| 'get' | 'GET'
|
| "get"
|
||||||
| 'delete' | 'DELETE'
|
| "GET"
|
||||||
| 'head' | 'HEAD'
|
| "delete"
|
||||||
| 'options' | 'OPTIONS'
|
| "DELETE"
|
||||||
| 'post' | 'POST'
|
| "head"
|
||||||
| 'put' | 'PUT'
|
| "HEAD"
|
||||||
| 'patch' | 'PATCH'
|
| "options"
|
||||||
| 'purge' | 'PURGE'
|
| "OPTIONS"
|
||||||
| 'link' | 'LINK'
|
| "post"
|
||||||
| 'unlink' | 'UNLINK';
|
| "POST"
|
||||||
|
| "put"
|
||||||
|
| "PUT"
|
||||||
|
| "patch"
|
||||||
|
| "PATCH"
|
||||||
|
| "purge"
|
||||||
|
| "PURGE"
|
||||||
|
| "link"
|
||||||
|
| "LINK"
|
||||||
|
| "unlink"
|
||||||
|
| "UNLINK";
|
||||||
|
|
||||||
export type ResponseType =
|
export type ResponseType =
|
||||||
| 'arraybuffer'
|
| "arraybuffer"
|
||||||
| 'blob'
|
| "blob"
|
||||||
| 'document'
|
| "document"
|
||||||
| 'json'
|
| "json"
|
||||||
| 'text'
|
| "text"
|
||||||
| 'stream'
|
| "stream"
|
||||||
| 'formdata';
|
| "formdata";
|
||||||
|
|
||||||
export type responseEncoding =
|
export type responseEncoding =
|
||||||
| 'ascii' | 'ASCII'
|
| "ascii"
|
||||||
| 'ansi' | 'ANSI'
|
| "ASCII"
|
||||||
| 'binary' | 'BINARY'
|
| "ansi"
|
||||||
| 'base64' | 'BASE64'
|
| "ANSI"
|
||||||
| 'base64url' | 'BASE64URL'
|
| "binary"
|
||||||
| 'hex' | 'HEX'
|
| "BINARY"
|
||||||
| 'latin1' | 'LATIN1'
|
| "base64"
|
||||||
| 'ucs-2' | 'UCS-2'
|
| "BASE64"
|
||||||
| 'ucs2' | 'UCS2'
|
| "base64url"
|
||||||
| 'utf-8' | 'UTF-8'
|
| "BASE64URL"
|
||||||
| 'utf8' | 'UTF8'
|
| "hex"
|
||||||
| 'utf16le' | 'UTF16LE';
|
| "HEX"
|
||||||
|
| "latin1"
|
||||||
|
| "LATIN1"
|
||||||
|
| "ucs-2"
|
||||||
|
| "UCS-2"
|
||||||
|
| "ucs2"
|
||||||
|
| "UCS2"
|
||||||
|
| "utf-8"
|
||||||
|
| "UTF-8"
|
||||||
|
| "utf8"
|
||||||
|
| "UTF8"
|
||||||
|
| "utf16le"
|
||||||
|
| "UTF16LE";
|
||||||
|
|
||||||
export interface TransitionalOptions {
|
export interface TransitionalOptions {
|
||||||
silentJSONParsing?: boolean;
|
silentJSONParsing?: boolean;
|
||||||
@ -251,11 +349,11 @@ export interface FormDataVisitorHelpers {
|
|||||||
|
|
||||||
export interface SerializerVisitor {
|
export interface SerializerVisitor {
|
||||||
(
|
(
|
||||||
this: GenericFormData,
|
this: GenericFormData,
|
||||||
value: any,
|
value: any,
|
||||||
key: string | number,
|
key: string | number,
|
||||||
path: null | Array<string | number>,
|
path: null | Array<string | number>,
|
||||||
helpers: FormDataVisitorHelpers
|
helpers: FormDataVisitorHelpers,
|
||||||
): boolean;
|
): boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -267,8 +365,7 @@ export interface SerializerOptions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// tslint:disable-next-line
|
// tslint:disable-next-line
|
||||||
export interface FormSerializerOptions extends SerializerOptions {
|
export interface FormSerializerOptions extends SerializerOptions {}
|
||||||
}
|
|
||||||
|
|
||||||
export interface ParamEncoder {
|
export interface ParamEncoder {
|
||||||
(value: any, defaultEncoder: (value: any) => any): any;
|
(value: any, defaultEncoder: (value: any) => any): any;
|
||||||
@ -304,7 +401,7 @@ export interface AxiosProgressEvent {
|
|||||||
|
|
||||||
type Milliseconds = number;
|
type Milliseconds = number;
|
||||||
|
|
||||||
type AxiosAdapterName = StringLiteralsOrString<'xhr' | 'http' | 'fetch'>;
|
type AxiosAdapterName = StringLiteralsOrString<"xhr" | "http" | "fetch">;
|
||||||
|
|
||||||
type AxiosAdapterConfig = AxiosAdapter | AxiosAdapterName;
|
type AxiosAdapterConfig = AxiosAdapter | AxiosAdapterName;
|
||||||
|
|
||||||
@ -344,7 +441,13 @@ export interface AxiosRequestConfig<D = any> {
|
|||||||
maxBodyLength?: number;
|
maxBodyLength?: number;
|
||||||
maxRedirects?: number;
|
maxRedirects?: number;
|
||||||
maxRate?: number | [MaxUploadRate, MaxDownloadRate];
|
maxRate?: number | [MaxUploadRate, MaxDownloadRate];
|
||||||
beforeRedirect?: (options: Record<string, any>, responseDetails: {headers: Record<string, string>, statusCode: HttpStatusCode}) => void;
|
beforeRedirect?: (
|
||||||
|
options: Record<string, any>,
|
||||||
|
responseDetails: {
|
||||||
|
headers: Record<string, string>;
|
||||||
|
statusCode: HttpStatusCode;
|
||||||
|
},
|
||||||
|
) => void;
|
||||||
socketPath?: string | null;
|
socketPath?: string | null;
|
||||||
transport?: any;
|
transport?: any;
|
||||||
httpAgent?: any;
|
httpAgent?: any;
|
||||||
@ -357,20 +460,55 @@ export interface AxiosRequestConfig<D = any> {
|
|||||||
insecureHTTPParser?: boolean;
|
insecureHTTPParser?: boolean;
|
||||||
env?: {
|
env?: {
|
||||||
FormData?: new (...args: any[]) => object;
|
FormData?: new (...args: any[]) => object;
|
||||||
fetch?: (input: URL | Request | string, init?: RequestInit) => Promise<Response>;
|
fetch?: (
|
||||||
Request?: new (input: URL | Request | string, init?: RequestInit) => Request;
|
input: URL | Request | string,
|
||||||
|
init?: RequestInit,
|
||||||
|
) => Promise<Response>;
|
||||||
|
Request?: new (
|
||||||
|
input: URL | Request | string,
|
||||||
|
init?: RequestInit,
|
||||||
|
) => Request;
|
||||||
Response?: new (
|
Response?: new (
|
||||||
body?: ArrayBuffer | ArrayBufferView | Blob | FormData | URLSearchParams | string | null,
|
body?:
|
||||||
init?: ResponseInit
|
| ArrayBuffer
|
||||||
|
| ArrayBufferView
|
||||||
|
| Blob
|
||||||
|
| FormData
|
||||||
|
| URLSearchParams
|
||||||
|
| string
|
||||||
|
| null,
|
||||||
|
init?: ResponseInit,
|
||||||
) => Response;
|
) => Response;
|
||||||
};
|
};
|
||||||
formSerializer?: FormSerializerOptions;
|
formSerializer?: FormSerializerOptions;
|
||||||
family?: AddressFamily;
|
family?: AddressFamily;
|
||||||
lookup?: ((hostname: string, options: object, cb: (err: Error | null, address: LookupAddress | LookupAddress[], family?: AddressFamily) => void) => void) |
|
lookup?:
|
||||||
((hostname: string, options: object) => Promise<[address: LookupAddressEntry | LookupAddressEntry[], family?: AddressFamily] | LookupAddress>);
|
| ((
|
||||||
withXSRFToken?: boolean | ((config: InternalAxiosRequestConfig) => boolean | undefined);
|
hostname: string,
|
||||||
|
options: object,
|
||||||
|
cb: (
|
||||||
|
err: Error | null,
|
||||||
|
address: LookupAddress | LookupAddress[],
|
||||||
|
family?: AddressFamily,
|
||||||
|
) => void,
|
||||||
|
) => void)
|
||||||
|
| ((
|
||||||
|
hostname: string,
|
||||||
|
options: object,
|
||||||
|
) => Promise<
|
||||||
|
| [
|
||||||
|
address: LookupAddressEntry | LookupAddressEntry[],
|
||||||
|
family?: AddressFamily,
|
||||||
|
]
|
||||||
|
| LookupAddress
|
||||||
|
>);
|
||||||
|
withXSRFToken?:
|
||||||
|
| boolean
|
||||||
|
| ((config: InternalAxiosRequestConfig) => boolean | undefined);
|
||||||
parseReviver?: (this: any, key: string, value: any) => any;
|
parseReviver?: (this: any, key: string, value: any) => any;
|
||||||
fetchOptions?: Omit<RequestInit, 'body' | 'headers' | 'method' | 'signal'> | Record<string, any>;
|
fetchOptions?:
|
||||||
|
| Omit<RequestInit, "body" | "headers" | "method" | "signal">
|
||||||
|
| Record<string, any>;
|
||||||
httpVersion?: 1 | 2;
|
httpVersion?: 1 | 2;
|
||||||
http2Options?: Record<string, any> & {
|
http2Options?: Record<string, any> & {
|
||||||
sessionTimeout?: number;
|
sessionTimeout?: number;
|
||||||
@ -380,7 +518,9 @@ export interface AxiosRequestConfig<D = any> {
|
|||||||
// Alias
|
// Alias
|
||||||
export type RawAxiosRequestConfig<D = any> = AxiosRequestConfig<D>;
|
export type RawAxiosRequestConfig<D = any> = AxiosRequestConfig<D>;
|
||||||
|
|
||||||
export interface InternalAxiosRequestConfig<D = any> extends AxiosRequestConfig<D> {
|
export interface InternalAxiosRequestConfig<
|
||||||
|
D = any,
|
||||||
|
> extends AxiosRequestConfig<D> {
|
||||||
headers: AxiosRequestHeaders;
|
headers: AxiosRequestHeaders;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -398,11 +538,17 @@ export interface HeadersDefaults {
|
|||||||
unlink?: RawAxiosRequestHeaders;
|
unlink?: RawAxiosRequestHeaders;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AxiosDefaults<D = any> extends Omit<AxiosRequestConfig<D>, 'headers'> {
|
export interface AxiosDefaults<D = any> extends Omit<
|
||||||
|
AxiosRequestConfig<D>,
|
||||||
|
"headers"
|
||||||
|
> {
|
||||||
headers: HeadersDefaults;
|
headers: HeadersDefaults;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CreateAxiosDefaults<D = any> extends Omit<AxiosRequestConfig<D>, 'headers'> {
|
export interface CreateAxiosDefaults<D = any> extends Omit<
|
||||||
|
AxiosRequestConfig<D>,
|
||||||
|
"headers"
|
||||||
|
> {
|
||||||
headers?: RawAxiosRequestHeaders | AxiosHeaders | Partial<HeadersDefaults>;
|
headers?: RawAxiosRequestHeaders | AxiosHeaders | Partial<HeadersDefaults>;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -410,18 +556,18 @@ export interface AxiosResponse<T = any, D = any, H = {}> {
|
|||||||
data: T;
|
data: T;
|
||||||
status: number;
|
status: number;
|
||||||
statusText: string;
|
statusText: string;
|
||||||
headers: H & RawAxiosResponseHeaders | AxiosResponseHeaders;
|
headers: (H & RawAxiosResponseHeaders) | AxiosResponseHeaders;
|
||||||
config: InternalAxiosRequestConfig<D>;
|
config: InternalAxiosRequestConfig<D>;
|
||||||
request?: any;
|
request?: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class AxiosError<T = unknown, D = any> extends Error {
|
export class AxiosError<T = unknown, D = any> extends Error {
|
||||||
constructor(
|
constructor(
|
||||||
message?: string,
|
message?: string,
|
||||||
code?: string,
|
code?: string,
|
||||||
config?: InternalAxiosRequestConfig<D>,
|
config?: InternalAxiosRequestConfig<D>,
|
||||||
request?: any,
|
request?: any,
|
||||||
response?: AxiosResponse<T, D>
|
response?: AxiosResponse<T, D>,
|
||||||
);
|
);
|
||||||
|
|
||||||
config?: InternalAxiosRequestConfig<D>;
|
config?: InternalAxiosRequestConfig<D>;
|
||||||
@ -440,7 +586,7 @@ export class AxiosError<T = unknown, D = any> extends Error {
|
|||||||
request?: any,
|
request?: any,
|
||||||
response?: AxiosResponse<T, D>,
|
response?: AxiosResponse<T, D>,
|
||||||
customProps?: object,
|
customProps?: object,
|
||||||
): AxiosError<T, D>;
|
): AxiosError<T, D>;
|
||||||
static readonly ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
|
static readonly ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
|
||||||
static readonly ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
|
static readonly ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
|
||||||
static readonly ERR_BAD_OPTION = "ERR_BAD_OPTION";
|
static readonly ERR_BAD_OPTION = "ERR_BAD_OPTION";
|
||||||
@ -500,12 +646,12 @@ type AxiosInterceptorRejected = (error: any) => any;
|
|||||||
type AxiosRequestInterceptorUse<T> = (
|
type AxiosRequestInterceptorUse<T> = (
|
||||||
onFulfilled?: AxiosInterceptorFulfilled<T> | null,
|
onFulfilled?: AxiosInterceptorFulfilled<T> | null,
|
||||||
onRejected?: AxiosInterceptorRejected | null,
|
onRejected?: AxiosInterceptorRejected | null,
|
||||||
options?: AxiosInterceptorOptions
|
options?: AxiosInterceptorOptions,
|
||||||
) => number;
|
) => number;
|
||||||
|
|
||||||
type AxiosResponseInterceptorUse<T> = (
|
type AxiosResponseInterceptorUse<T> = (
|
||||||
onFulfilled?: AxiosInterceptorFulfilled<T> | null,
|
onFulfilled?: AxiosInterceptorFulfilled<T> | null,
|
||||||
onRejected?: AxiosInterceptorRejected | null
|
onRejected?: AxiosInterceptorRejected | null,
|
||||||
) => number;
|
) => number;
|
||||||
|
|
||||||
interface AxiosInterceptorHandler<T> {
|
interface AxiosInterceptorHandler<T> {
|
||||||
@ -516,7 +662,9 @@ interface AxiosInterceptorHandler<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface AxiosInterceptorManager<V> {
|
export interface AxiosInterceptorManager<V> {
|
||||||
use: V extends AxiosResponse ? AxiosResponseInterceptorUse<V> : AxiosRequestInterceptorUse<V>;
|
use: V extends AxiosResponse
|
||||||
|
? AxiosResponseInterceptorUse<V>
|
||||||
|
: AxiosRequestInterceptorUse<V>;
|
||||||
eject(id: number): void;
|
eject(id: number): void;
|
||||||
clear(): void;
|
clear(): void;
|
||||||
handlers?: Array<AxiosInterceptorHandler<V>>;
|
handlers?: Array<AxiosInterceptorHandler<V>>;
|
||||||
@ -530,28 +678,71 @@ export class Axios {
|
|||||||
response: AxiosInterceptorManager<AxiosResponse>;
|
response: AxiosInterceptorManager<AxiosResponse>;
|
||||||
};
|
};
|
||||||
getUri(config?: AxiosRequestConfig): string;
|
getUri(config?: AxiosRequestConfig): string;
|
||||||
request<T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D>): Promise<R>;
|
request<T = any, R = AxiosResponse<T>, D = any>(
|
||||||
get<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
|
config: AxiosRequestConfig<D>,
|
||||||
delete<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
|
): Promise<R>;
|
||||||
head<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
|
get<T = any, R = AxiosResponse<T>, D = any>(
|
||||||
options<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
|
url: string,
|
||||||
post<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
|
config?: AxiosRequestConfig<D>,
|
||||||
put<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
|
): Promise<R>;
|
||||||
patch<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
|
delete<T = any, R = AxiosResponse<T>, D = any>(
|
||||||
postForm<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
|
url: string,
|
||||||
putForm<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
|
config?: AxiosRequestConfig<D>,
|
||||||
patchForm<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
|
): Promise<R>;
|
||||||
|
head<T = any, R = AxiosResponse<T>, D = any>(
|
||||||
|
url: string,
|
||||||
|
config?: AxiosRequestConfig<D>,
|
||||||
|
): Promise<R>;
|
||||||
|
options<T = any, R = AxiosResponse<T>, D = any>(
|
||||||
|
url: string,
|
||||||
|
config?: AxiosRequestConfig<D>,
|
||||||
|
): Promise<R>;
|
||||||
|
post<T = any, R = AxiosResponse<T>, D = any>(
|
||||||
|
url: string,
|
||||||
|
data?: D,
|
||||||
|
config?: AxiosRequestConfig<D>,
|
||||||
|
): Promise<R>;
|
||||||
|
put<T = any, R = AxiosResponse<T>, D = any>(
|
||||||
|
url: string,
|
||||||
|
data?: D,
|
||||||
|
config?: AxiosRequestConfig<D>,
|
||||||
|
): Promise<R>;
|
||||||
|
patch<T = any, R = AxiosResponse<T>, D = any>(
|
||||||
|
url: string,
|
||||||
|
data?: D,
|
||||||
|
config?: AxiosRequestConfig<D>,
|
||||||
|
): Promise<R>;
|
||||||
|
postForm<T = any, R = AxiosResponse<T>, D = any>(
|
||||||
|
url: string,
|
||||||
|
data?: D,
|
||||||
|
config?: AxiosRequestConfig<D>,
|
||||||
|
): Promise<R>;
|
||||||
|
putForm<T = any, R = AxiosResponse<T>, D = any>(
|
||||||
|
url: string,
|
||||||
|
data?: D,
|
||||||
|
config?: AxiosRequestConfig<D>,
|
||||||
|
): Promise<R>;
|
||||||
|
patchForm<T = any, R = AxiosResponse<T>, D = any>(
|
||||||
|
url: string,
|
||||||
|
data?: D,
|
||||||
|
config?: AxiosRequestConfig<D>,
|
||||||
|
): Promise<R>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AxiosInstance extends Axios {
|
export interface AxiosInstance extends Axios {
|
||||||
<T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D>): Promise<R>;
|
<T = any, R = AxiosResponse<T>, D = any>(
|
||||||
<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
|
config: AxiosRequestConfig<D>,
|
||||||
|
): Promise<R>;
|
||||||
|
<T = any, R = AxiosResponse<T>, D = any>(
|
||||||
|
url: string,
|
||||||
|
config?: AxiosRequestConfig<D>,
|
||||||
|
): Promise<R>;
|
||||||
|
|
||||||
create(config?: CreateAxiosDefaults): AxiosInstance;
|
create(config?: CreateAxiosDefaults): AxiosInstance;
|
||||||
defaults: Omit<AxiosDefaults, 'headers'> & {
|
defaults: Omit<AxiosDefaults, "headers"> & {
|
||||||
headers: HeadersDefaults & {
|
headers: HeadersDefaults & {
|
||||||
[key: string]: AxiosHeaderValue
|
[key: string]: AxiosHeaderValue;
|
||||||
}
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -565,13 +756,23 @@ export interface GenericHTMLFormElement {
|
|||||||
submit(): void;
|
submit(): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getAdapter(adapters: AxiosAdapterConfig | AxiosAdapterConfig[] | undefined): AxiosAdapter;
|
export function getAdapter(
|
||||||
|
adapters: AxiosAdapterConfig | AxiosAdapterConfig[] | undefined,
|
||||||
|
): AxiosAdapter;
|
||||||
|
|
||||||
export function toFormData(sourceObj: object, targetFormData?: GenericFormData, options?: FormSerializerOptions): GenericFormData;
|
export function toFormData(
|
||||||
|
sourceObj: object,
|
||||||
|
targetFormData?: GenericFormData,
|
||||||
|
options?: FormSerializerOptions,
|
||||||
|
): GenericFormData;
|
||||||
|
|
||||||
export function formToJSON(form: GenericFormData|GenericHTMLFormElement): object;
|
export function formToJSON(
|
||||||
|
form: GenericFormData | GenericHTMLFormElement,
|
||||||
|
): object;
|
||||||
|
|
||||||
export function isAxiosError<T = any, D = any>(payload: any): payload is AxiosError<T, D>;
|
export function isAxiosError<T = any, D = any>(
|
||||||
|
payload: any,
|
||||||
|
): payload is AxiosError<T, D>;
|
||||||
|
|
||||||
export function spread<T, R>(callback: (...args: T[]) => R): (array: T[]) => R;
|
export function spread<T, R>(callback: (...args: T[]) => R): (array: T[]) => R;
|
||||||
|
|
||||||
@ -579,7 +780,10 @@ export function isCancel<T = any>(value: any): value is CanceledError<T>;
|
|||||||
|
|
||||||
export function all<T>(values: Array<T | Promise<T>>): Promise<T[]>;
|
export function all<T>(values: Array<T | Promise<T>>): Promise<T[]>;
|
||||||
|
|
||||||
export function mergeConfig<D = any>(config1: AxiosRequestConfig<D>, config2: AxiosRequestConfig<D>): AxiosRequestConfig<D>;
|
export function mergeConfig<D = any>(
|
||||||
|
config1: AxiosRequestConfig<D>,
|
||||||
|
config2: AxiosRequestConfig<D>,
|
||||||
|
): AxiosRequestConfig<D>;
|
||||||
|
|
||||||
export interface AxiosStatic extends AxiosInstance {
|
export interface AxiosStatic extends AxiosInstance {
|
||||||
Cancel: CancelStatic;
|
Cancel: CancelStatic;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user