Ignore:
Timestamp:
12/12/24 17:06:06 (5 weeks ago)
Author:
stefan toskovski <stefantoska84@…>
Branches:
main
Parents:
d565449
Message:

Pred finalna verzija

File:
1 edited

Legend:

Unmodified
Added
Removed
  • imaps-frontend/node_modules/axios/index.d.cts

    rd565449 r0c6b92a  
    44
    55type MethodsHeaders = Partial<{
    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;
     6  [Key in axios.Method as Lowercase<Key>]: InternalAxiosHeaders;
     7} & {common: InternalAxiosHeaders}>;
     8
     9type AxiosHeaderMatcher = (this: InternalAxiosHeaders, value: string, name: string, headers: RawAxiosHeaders) => boolean;
     10
     11type AxiosHeaderParser = (this: InternalAxiosHeaders, value: axios.AxiosHeaderValue, header: string) => any;
    1212
    1313type CommonRequestHeadersList = 'Accept' | 'Content-Length' | 'User-Agent'| 'Content-Encoding' | 'Authorization';
     
    1717type CommonResponseHeadersList = 'Server' | 'Content-Type' | 'Content-Length' | 'Cache-Control'| 'Content-Encoding';
    1818
    19 declare class AxiosHeaders {
     19declare class InternalAxiosHeaders {
    2020  constructor(
    21       headers?: RawAxiosHeaders | AxiosHeaders | string
     21      headers?: RawAxiosHeaders | InternalAxiosHeaders | string
    2222  );
    2323
    2424  [key: string]: any;
    2525
    26   set(headerName?: string, value?: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
    27   set(headers?: RawAxiosHeaders | AxiosHeaders | string, rewrite?: boolean): AxiosHeaders;
     26  set(headerName?: string, value?: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): InternalAxiosHeaders;
     27  set(headers?: RawAxiosHeaders | InternalAxiosHeaders | string, rewrite?: boolean): InternalAxiosHeaders;
    2828
    2929  get(headerName: string, parser: RegExp): RegExpExecArray | null;
     
    3636  clear(matcher?: AxiosHeaderMatcher): boolean;
    3737
    38   normalize(format: boolean): AxiosHeaders;
    39 
    40   concat(...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null>): AxiosHeaders;
     38  normalize(format: boolean): InternalAxiosHeaders;
     39
     40  concat(...targets: Array<InternalAxiosHeaders | RawAxiosHeaders | string | undefined | null>): InternalAxiosHeaders;
    4141
    4242  toJSON(asStrings?: boolean): RawAxiosHeaders;
    4343
    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;
     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;
    5151  getContentType(parser?: RegExp): RegExpExecArray | null;
    5252  getContentType(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue;
    5353  hasContentType(matcher?: AxiosHeaderMatcher): boolean;
    5454
    55   setContentLength(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
     55  setContentLength(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): InternalAxiosHeaders;
    5656  getContentLength(parser?: RegExp): RegExpExecArray | null;
    5757  getContentLength(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue;
    5858  hasContentLength(matcher?: AxiosHeaderMatcher): boolean;
    5959
    60   setAccept(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
     60  setAccept(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): InternalAxiosHeaders;
    6161  getAccept(parser?: RegExp): RegExpExecArray | null;
    6262  getAccept(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue;
    6363  hasAccept(matcher?: AxiosHeaderMatcher): boolean;
    6464
    65   setUserAgent(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
     65  setUserAgent(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): InternalAxiosHeaders;
    6666  getUserAgent(parser?: RegExp): RegExpExecArray | null;
    6767  getUserAgent(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue;
    6868  hasUserAgent(matcher?: AxiosHeaderMatcher): boolean;
    6969
    70   setContentEncoding(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
     70  setContentEncoding(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): InternalAxiosHeaders;
    7171  getContentEncoding(parser?: RegExp): RegExpExecArray | null;
    7272  getContentEncoding(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue;
    7373  hasContentEncoding(matcher?: AxiosHeaderMatcher): boolean;
    7474
    75   setAuthorization(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
     75  setAuthorization(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): InternalAxiosHeaders;
    7676  getAuthorization(parser?: RegExp): RegExpExecArray | null;
    7777  getAuthorization(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue;
     
    112112}
    113113
    114 declare class CanceledError<T> extends AxiosError<T> {
    115 }
    116 
    117 declare class Axios {
     114declare class InternalCanceledError<T> extends AxiosError<T> {
     115}
     116
     117declare class InternalAxios {
    118118  constructor(config?: axios.AxiosRequestConfig);
    119119  defaults: axios.AxiosDefaults;
     
    136136}
    137137
    138 declare enum HttpStatusCode {
     138declare enum InternalHttpStatusCode {
    139139  Continue = 100,
    140140  SwitchingProtocols = 101,
     
    206206declare namespace axios {
    207207  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;
    208212
    209213  type RawAxiosRequestHeaders = Partial<RawAxiosHeaders & {
     
    399403    maxRedirects?: number;
    400404    maxRate?: number | [MaxUploadRate, MaxDownloadRate];
    401     beforeRedirect?: (options: Record<string, any>, responseDetails: {headers: Record<string, string>, statusCode: HttpStatusCode}) => void;
     405    beforeRedirect?: (options: Record<string, any>, responseDetails: {headers: Record<string, string>, statusCode: InternalHttpStatusCode}) => void;
    402406    socketPath?: string | null;
    403407    transport?: any;
     
    494498  }
    495499
     500  type AxiosRequestInterceptorUse<T> = (onFulfilled?: ((value: T) => T | Promise<T>) | null, onRejected?: ((error: any) => any) | null, options?: AxiosInterceptorOptions) => number;
     501
     502  type AxiosResponseInterceptorUse<T> = (onFulfilled?: ((value: T) => T | Promise<T>) | null, onRejected?: ((error: any) => any) | null) => number;
     503
    496504  interface AxiosInterceptorManager<V> {
    497     use(onFulfilled?: (value: V) => V | Promise<V>, onRejected?: (error: any) => any, options?: AxiosInterceptorOptions): number;
     505    use: V extends AxiosResponse ? AxiosResponseInterceptorUse<V> : AxiosRequestInterceptorUse<V>;
    498506    eject(id: number): void;
    499507    clear(): void;
    500508  }
    501509
    502   interface AxiosInstance extends Axios {
     510  interface AxiosInstance extends InternalAxios {
    503511    <T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D>): Promise<R>;
    504512    <T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
     
    522530
    523531  interface AxiosStatic extends AxiosInstance {
     532    default: AxiosStatic;
    524533    create(config?: CreateAxiosDefaults): AxiosInstance;
    525534    Cancel: CancelStatic;
    526535    CancelToken: CancelTokenStatic;
    527     Axios: typeof Axios;
     536    Axios: typeof InternalAxios;
    528537    AxiosError: typeof AxiosError;
    529     CanceledError: typeof CanceledError;
    530     HttpStatusCode: typeof HttpStatusCode;
     538    CanceledError: typeof InternalCanceledError;
     539    HttpStatusCode: typeof InternalHttpStatusCode;
    531540    readonly VERSION: string;
    532541    isCancel(value: any): value is Cancel;
     
    537546    formToJSON(form: GenericFormData|GenericHTMLFormElement): object;
    538547    getAdapter(adapters: AxiosAdapterConfig | AxiosAdapterConfig[] | undefined): AxiosAdapter;
    539     AxiosHeaders: typeof AxiosHeaders;
     548    AxiosHeaders: typeof InternalAxiosHeaders;
    540549  }
    541550}
Note: See TracChangeset for help on using the changeset viewer.