import { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios'; import { ICommonRes } from '../../typings/interface/common.interface'; interface AxiosIns extends AxiosInstance { (config: AxiosRequestConfig): Promise | Promise; (url: string, config?: AxiosRequestConfig): Promise | Promise; } declare const axiosIns: AxiosIns; /** * axios实例的默认值扩充(深度合并) * @param requestConfig 扩充的config默认值 */ declare const setRequestConfig: (requestConfig: any) => void; /** * 请求拦截器 * @param successFunc 在发送请求之前做些什么 * @param errorFunc 对请求错误做些什么 */ declare const setInterceptorsRequest: (successFunc: (config: AxiosRequestConfig) => AxiosRequestConfig, errorFunc: (error: any) => Promise) => void; /** * 响应拦截器 * @param successFunc 对响应数据做点什么 * @param errorFunc 对响应错误做点什么 */ declare const setInterceptorsResponse: (successFunc: (response: AxiosResponse) => Promise, errorFunc: (error: any) => Promise) => void; /** * 合并当前请求拦截器配置 */ declare const mergeInterceptorsRequest: (callback: (requestConfig: AxiosRequestConfig) => AxiosRequestConfig) => void; export { axiosIns, setRequestConfig, setInterceptorsRequest, setInterceptorsResponse, mergeInterceptorsRequest, AxiosRequestConfig, };