import type { AxiosRequestConfig, AxiosResponse, AxiosInstance } from 'axios'; export interface RequestInterceptors { requestInterceptors?: (config: AxiosRequestConfig) => AxiosRequestConfig; requestInterceptorsCatch?: (err: any) => any; responseInterceptors?: (config: T) => T; responseInterceptorsCatch?: (err: any) => any; } export interface RequestConfig extends AxiosRequestConfig { interceptors?: RequestInterceptors; } export interface CancelRequestSource { [index: string]: () => void; } export interface AnyObject { [key: string]: any; } export interface AnyFcuntion { [key: string]: () => void; } export interface IRequest { instance: AxiosInstance; useConfig: (key: string | AnyObject, value?: any) => void; useResponse: (reslove: (config: AxiosResponse) => AxiosResponse, reject?: (error: any) => any) => void; useRequest: (reslove: (config: AxiosRequestConfig) => AxiosRequestConfig, reject?: (error: any) => any) => void; useBase: (config: IRequestConfig) => Promise; getBlob: (url: string, data?: D, h?: AnyObject, o?: AnyObject) => Promise; formData: (url: string, data?: D, h?: AnyObject, o?: AnyObject) => Promise; json: (url: string, data?: D, h?: AnyObject, o?: AnyObject) => Promise; upload: (url: string, data?: D, h?: AnyObject, o?: AnyObject) => Promise; dlt: (url: string, data?: D, h?: AnyObject, o?: AnyObject) => Promise; head: (url: string, data?: D, h?: AnyObject, o?: AnyObject) => Promise; patch: (url: string, data?: D, h?: AnyObject, o?: AnyObject) => Promise; put: (url: string, data?: D, h?: AnyObject, o?: AnyObject) => Promise; get: (url: string, data?: D, h?: AnyObject, o?: AnyObject) => Promise; post: (url: string, data?: D, h?: AnyObject, o?: AnyObject) => Promise; generatePathQuery: (path: string, obj?: AnyObject) => string; } export interface IResponse { statusCode: number; desc: string; result: T; } export interface IRequestConfig extends RequestConfig> { data?: T; }