2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-20 20:00:40 +03:00

feat(adapter): add fetch adapter; (#6371)

This commit is contained in:
Dmitriy Mozgovoy
2024-04-28 22:33:49 +03:00
committed by GitHub
parent 751133eb9e
commit a3ff99b59d
21 changed files with 1015 additions and 127 deletions
Vendored
+5 -2
View File
@@ -209,7 +209,8 @@ export type ResponseType =
| 'document'
| 'json'
| 'text'
| 'stream';
| 'stream'
| 'formdata';
export type responseEncoding =
| 'ascii' | 'ASCII'
@@ -294,11 +295,12 @@ export interface AxiosProgressEvent {
upload?: boolean;
download?: boolean;
event?: BrowserProgressEvent;
lengthComputable: boolean;
}
type Milliseconds = number;
type AxiosAdapterName = 'xhr' | 'http' | string;
type AxiosAdapterName = 'fetch' | 'xhr' | 'http' | string;
type AxiosAdapterConfig = AxiosAdapter | AxiosAdapterName;
@@ -356,6 +358,7 @@ export interface AxiosRequestConfig<D = any> {
lookup?: ((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);
fetchOptions?: Record<string, any>;
}
// Alias