export type HttpResponseHeaders = Record & { "set-cookie"?: string[]; }; export interface HttpClientDefaults extends Omit { headers?: [string, string][] | Record | Headers | undefined; } export interface HttpClientResponse { data: T; headers: HttpResponseHeaders; config: any; status: number; statusText: string; } export interface CancelToken { promise: Promise; throwIfRequested(): void; reason?: string; } type HeadersInit = [string, string][] | Record | Headers; export interface HttpClientRequestConfig { url?: string; method?: string; baseURL?: string; data?: D; timeout?: number; fetchOptions?: Record; headers?: HeadersInit; params?: Record; maxContentLength?: number; maxRedirects?: number; cancelToken?: CancelToken; adapter?: (config: HttpClientRequestConfig) => Promise; } export interface HttpClient { get: (url: string, config?: HttpClientRequestConfig) => Promise>; delete: (url: string, config?: HttpClientRequestConfig) => Promise>; head: (url: string, config?: HttpClientRequestConfig) => Promise>; options: (url: string, config?: HttpClientRequestConfig) => Promise>; post: (url: string, data?: any, config?: HttpClientRequestConfig) => Promise>; put: (url: string, data?: any, config?: HttpClientRequestConfig) => Promise>; patch: (url: string, data?: any, config?: HttpClientRequestConfig) => Promise>; postForm: (url: string, data?: any, config?: HttpClientRequestConfig) => Promise>; putForm: (url: string, data?: any, config?: HttpClientRequestConfig) => Promise>; patchForm: (url: string, data?: any, config?: HttpClientRequestConfig) => Promise>; interceptors: { request: InterceptorManager; response: InterceptorManager; }; defaults: HttpClientDefaults; CancelToken: typeof CancelToken; isCancel: (value: any) => boolean; makeRequest: (config: HttpClientRequestConfig) => Promise>; create: (config?: HttpClientRequestConfig) => HttpClient; } export interface Interceptor { fulfilled: (value: V) => V | Promise; rejected?: (error: any) => any; } export interface InterceptorManager { use(fulfilled: (value: V) => V | Promise, rejected?: (error: any) => any): number; eject(id: number): void; forEach(fn: (interceptor: Interceptor) => void): void; handlers: Array | null>; } export declare class CancelToken { promise: Promise; reason?: string; constructor(executor: (cancel: (reason?: string) => void) => void); } export {};