Changeset 79a0317 for imaps-frontend/node_modules/axios/index.d.cts
- Timestamp:
- 01/21/25 03:08:24 (3 days ago)
- Branches:
- main
- Parents:
- 0c6b92a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/node_modules/axios/index.d.cts
r0c6b92a r79a0317 4 4 5 5 type MethodsHeaders = Partial<{ 6 [Key in axios.Method as Lowercase<Key>]: InternalAxiosHeaders;7 } & {common: InternalAxiosHeaders}>;8 9 type AxiosHeaderMatcher = (this: InternalAxiosHeaders, value: string, name: string, headers: RawAxiosHeaders) => boolean;10 11 type AxiosHeaderParser = (this: InternalAxiosHeaders, value: axios.AxiosHeaderValue, header: string) => any;6 [Key in axios.Method as Lowercase<Key>]: AxiosHeaders; 7 } & {common: AxiosHeaders}>; 8 9 type AxiosHeaderMatcher = (this: AxiosHeaders, value: string, name: string, headers: RawAxiosHeaders) => boolean; 10 11 type AxiosHeaderParser = (this: AxiosHeaders, value: axios.AxiosHeaderValue, header: string) => any; 12 12 13 13 type CommonRequestHeadersList = 'Accept' | 'Content-Length' | 'User-Agent'| 'Content-Encoding' | 'Authorization'; … … 17 17 type CommonResponseHeadersList = 'Server' | 'Content-Type' | 'Content-Length' | 'Cache-Control'| 'Content-Encoding'; 18 18 19 declare class InternalAxiosHeaders {19 declare class AxiosHeaders { 20 20 constructor( 21 headers?: RawAxiosHeaders | InternalAxiosHeaders | string21 headers?: RawAxiosHeaders | AxiosHeaders | string 22 22 ); 23 23 24 24 [key: string]: any; 25 25 26 set(headerName?: string, value?: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): InternalAxiosHeaders;27 set(headers?: RawAxiosHeaders | InternalAxiosHeaders | string, rewrite?: boolean): InternalAxiosHeaders;26 set(headerName?: string, value?: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; 27 set(headers?: RawAxiosHeaders | AxiosHeaders | string, rewrite?: boolean): AxiosHeaders; 28 28 29 29 get(headerName: string, parser: RegExp): RegExpExecArray | null; … … 36 36 clear(matcher?: AxiosHeaderMatcher): boolean; 37 37 38 normalize(format: boolean): InternalAxiosHeaders;39 40 concat(...targets: Array< InternalAxiosHeaders | RawAxiosHeaders | string | undefined | null>): InternalAxiosHeaders;38 normalize(format: boolean): AxiosHeaders; 39 40 concat(...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null>): AxiosHeaders; 41 41 42 42 toJSON(asStrings?: boolean): RawAxiosHeaders; 43 43 44 static from(thing?: InternalAxiosHeaders | RawAxiosHeaders | string): InternalAxiosHeaders;45 46 static accessor(header: string | string[]): InternalAxiosHeaders;47 48 static concat(...targets: Array< InternalAxiosHeaders | RawAxiosHeaders | string | undefined | null>): InternalAxiosHeaders;49 50 setContentType(value: ContentType, rewrite?: boolean | AxiosHeaderMatcher): InternalAxiosHeaders;44 static from(thing?: AxiosHeaders | RawAxiosHeaders | string): AxiosHeaders; 45 46 static accessor(header: string | string[]): AxiosHeaders; 47 48 static concat(...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null>): AxiosHeaders; 49 50 setContentType(value: ContentType, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; 51 51 getContentType(parser?: RegExp): RegExpExecArray | null; 52 52 getContentType(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue; 53 53 hasContentType(matcher?: AxiosHeaderMatcher): boolean; 54 54 55 setContentLength(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): InternalAxiosHeaders;55 setContentLength(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; 56 56 getContentLength(parser?: RegExp): RegExpExecArray | null; 57 57 getContentLength(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue; 58 58 hasContentLength(matcher?: AxiosHeaderMatcher): boolean; 59 59 60 setAccept(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): InternalAxiosHeaders;60 setAccept(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; 61 61 getAccept(parser?: RegExp): RegExpExecArray | null; 62 62 getAccept(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue; 63 63 hasAccept(matcher?: AxiosHeaderMatcher): boolean; 64 64 65 setUserAgent(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): InternalAxiosHeaders;65 setUserAgent(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; 66 66 getUserAgent(parser?: RegExp): RegExpExecArray | null; 67 67 getUserAgent(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue; 68 68 hasUserAgent(matcher?: AxiosHeaderMatcher): boolean; 69 69 70 setContentEncoding(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): InternalAxiosHeaders;70 setContentEncoding(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; 71 71 getContentEncoding(parser?: RegExp): RegExpExecArray | null; 72 72 getContentEncoding(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue; 73 73 hasContentEncoding(matcher?: AxiosHeaderMatcher): boolean; 74 74 75 setAuthorization(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): InternalAxiosHeaders;75 setAuthorization(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; 76 76 getAuthorization(parser?: RegExp): RegExpExecArray | null; 77 77 getAuthorization(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue; … … 112 112 } 113 113 114 declare class InternalCanceledError<T> extends AxiosError<T> {115 } 116 117 declare class InternalAxios {114 declare class CanceledError<T> extends AxiosError<T> { 115 } 116 117 declare class Axios { 118 118 constructor(config?: axios.AxiosRequestConfig); 119 119 defaults: axios.AxiosDefaults; … … 136 136 } 137 137 138 declare enum InternalHttpStatusCode {138 declare enum HttpStatusCode { 139 139 Continue = 100, 140 140 SwitchingProtocols = 101, … … 206 206 declare namespace axios { 207 207 type AxiosError<T = unknown, D = any> = InternalAxiosError<T, D>; 208 type Axios = InternalAxios;209 type AxiosHeaders = InternalAxiosHeaders;210 type CanceledError<T> = InternalCanceledError<T>;211 type HttpStatusCode = InternalHttpStatusCode;212 208 213 209 type RawAxiosRequestHeaders = Partial<RawAxiosHeaders & { … … 403 399 maxRedirects?: number; 404 400 maxRate?: number | [MaxUploadRate, MaxDownloadRate]; 405 beforeRedirect?: (options: Record<string, any>, responseDetails: {headers: Record<string, string>, statusCode: InternalHttpStatusCode}) => void;401 beforeRedirect?: (options: Record<string, any>, responseDetails: {headers: Record<string, string>, statusCode: HttpStatusCode}) => void; 406 402 socketPath?: string | null; 407 403 transport?: any; … … 508 504 } 509 505 510 interface AxiosInstance extends InternalAxios {506 interface AxiosInstance extends Axios { 511 507 <T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D>): Promise<R>; 512 508 <T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>; … … 530 526 531 527 interface AxiosStatic extends AxiosInstance { 532 default: AxiosStatic;533 528 create(config?: CreateAxiosDefaults): AxiosInstance; 534 529 Cancel: CancelStatic; 535 530 CancelToken: CancelTokenStatic; 536 Axios: typeof InternalAxios;531 Axios: typeof Axios; 537 532 AxiosError: typeof AxiosError; 538 CanceledError: typeof InternalCanceledError;539 HttpStatusCode: typeof InternalHttpStatusCode;533 CanceledError: typeof CanceledError; 534 HttpStatusCode: typeof HttpStatusCode; 540 535 readonly VERSION: string; 541 536 isCancel(value: any): value is Cancel; … … 546 541 formToJSON(form: GenericFormData|GenericHTMLFormElement): object; 547 542 getAdapter(adapters: AxiosAdapterConfig | AxiosAdapterConfig[] | undefined): AxiosAdapter; 548 AxiosHeaders: typeof InternalAxiosHeaders;543 AxiosHeaders: typeof AxiosHeaders; 549 544 } 550 545 }
Note:
See TracChangeset
for help on using the changeset viewer.