UNPKG

@newbiz/axios-libs

Version:

신사업 프론트엔드 Axios 래핑 라이브러리

24 lines (23 loc) 1.15 kB
import { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios'; export declare type ResolveRequestUrl = { [key: string]: string; }; export declare type AxiosDefaultConfig<T = any> = { defaults?: AxiosRequestConfig; isShowLog?: boolean; isLogFullResponse?: boolean; isThrowsOnError?: boolean; resolveRequestURL?: ResolveRequestUrl | null; onRequest?: (config: AxiosRequestConfig, currReqs: number) => AxiosRequestConfig | void; onResponse?: (response: AxiosResponse<T>, currReqs: number) => AxiosResponse | void; onRequestError?: (error: AxiosError, currReqs: number) => void; onResponseError?: (error: AxiosError, currReqs: number) => void; onInvalidate?: (which: string, error: AxiosError) => void; }; export interface IAxiosDefaultConfig<T = any> extends AxiosDefaultConfig<T> { } export declare const axios: import("axios").AxiosStatic; export { AxiosError, AxiosRequestConfig, AxiosResponse }; export declare function axiosDefaultConfig<T>(axiosConfig?: AxiosDefaultConfig<T>): void; export declare function reset(): Promise<void>; export declare function cancelAllRequests(message?: string): void;