import BaseConfig from '../base'; import { AxiosError, AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios'; import ResponseMapping from '../../configure/mapping/types/response'; import { RequestCacheType } from './cache'; export declare type SendBeforeType = (config: AxiosRequestConfig) => void; export declare type ResponseAfterType = (response: AxiosResponse) => void; export declare type ErrorHandlerType = (error: AxiosError) => Promise; export declare type CheckResponseType = (response: AxiosResponse) => boolean; export declare type LoadingType = ((config: AxiosRequestConfig) => Function) | false | string; declare module 'axios/index' { interface AxiosRequestConfig { loading: LoadingType; loadingId?: string | string[] | Function; download?: boolean; downloadFileName?: string; errorTip: boolean; skipErrorInterception?: boolean; mock?: (params: any) => any; merge?: boolean; cache?: RequestCacheType; json?: boolean; appendPage2Url?: boolean; deleteBodyPageParam?: boolean; _ap?: string; } } export default class HttpConfig implements BaseConfig { private _axiosInstance?; private _builded; private _baseUrl?; private _loading; private _appendPage2Url; private _errorTip; private _heads?; private _timeout?; private _sendBeforeHandler; private _responseAfterHandler; private _errorHandler; private _checkResponse; api(apiDir: RequireContext): HttpConfig; baseUrl(url: string): HttpConfig; loading(loading: LoadingType): HttpConfig; appendPage2Url(): HttpConfig; headers(heads: Dictionary): HttpConfig; timeout(timeout?: number): HttpConfig; before(fun: SendBeforeType): HttpConfig; after(fun: (response: AxiosResponse) => void): HttpConfig; checkResponse(fun: (response: AxiosResponse) => boolean): HttpConfig; disabledErrorTip(): HttpConfig; error(fun: (error: AxiosError) => Promise): HttpConfig; build(options?: AxiosRequestConfig): void; getInstance(): AxiosInstance | undefined; bind2Prototype(): void; private createAxiosInstance; }