123456789101112131415161718192021222324252627282930 |
- import type { CreateAxiosDefaults, AxiosInstance, AxiosInterceptorOptions, AxiosRequestConfig, InternalAxiosRequestConfig, AxiosResponse } from "axios";
- declare class WrappedAxios {
- private instance?;
- constructor(options?: CreateAxiosDefaults);
- beforeRequest<V = any>(onFulfilled?: ((value: InternalAxiosRequestConfig<V>) => InternalAxiosRequestConfig<V> | Promise<InternalAxiosRequestConfig<V>>) | null, onRejected?: ((error: any) => any) | null, options?: AxiosInterceptorOptions): this;
- afterResponse<V = any, D = any>(onFulfilled?: ((value: AxiosResponse<V, D>) => AxiosResponse<V, D> | Promise<AxiosResponse<V, D>>) | null, onRejected?: ((error: any) => any) | null, options?: AxiosInterceptorOptions): this;
- get axiosInstance(): AxiosInstance;
- get<R = any>(url: string, data: Record<string, any>, config?: AxiosRequestConfig): Promise<R>;
- post<R = any>(url: string, data: Record<string, any>, config?: AxiosRequestConfig): Promise<R>;
- put<R = any>(url: string, data: Record<string, any>, config?: AxiosRequestConfig): Promise<R>;
- delete<R = any>(url: string, data: Record<string, any>, config?: AxiosRequestConfig): Promise<R>;
- private createCancelObj;
- createGetWithCancel<R = any>(url: string, data: Record<string, any>, config?: AxiosRequestConfig): {
- abort(): void;
- send: () => Promise<R>;
- };
- createPostWithCancel<R = any>(url: string, data: Record<string, any>, config?: AxiosRequestConfig): {
- abort(): void;
- send: () => Promise<R>;
- };
- createPutWithCancel<R = any>(url: string, data: Record<string, any>, config?: AxiosRequestConfig): {
- abort(): void;
- send: () => Promise<R>;
- };
- createDeleteWithCancel<R = any>(url: string, data: Record<string, any>, config?: AxiosRequestConfig): {
- abort(): void;
- send: () => Promise<R>;
- };
- }
- export { WrappedAxios };
|