import { AxiosInstance, AxiosRequestConfig, AxiosResponse, InternalAxiosRequestConfig } from 'axios'; import { UC } from '@/auth/interface'; export declare enum STATUS { pending = 1, finish = 2, error = 3 } export interface RequestInstance extends AxiosInstance { clear?: (url?: string) => void; } export interface AxiosRequestExtendConfig extends AxiosRequestConfig { key?: string; force?: boolean; loading?: (c: AxiosRequestConfig) => void; loadingTime?: number; shouldBlock?: (error: any) => boolean; block?: (c: AxiosRequestConfig) => boolean; blockTime?: number; shouldRetry?: (error: any) => boolean; retry?: number; failover?: (error: any, c: AxiosRequestConfig) => AxiosRequestConfig | void; error?: (error: any, c: AxiosRequestConfig) => void; complete?: (c: AxiosRequestConfig) => void; ttl?: number; } export interface InternalAxiosRequestExtendConfig extends InternalAxiosRequestConfig { block?: (c: AxiosRequestConfig) => boolean; _retry?: number; sdpCryptoConfig?: { env: string; publicKey: string | null; cryptoType: string; bodyEncryptAll: boolean; bodyEncryptKeys: string; queryEncryptKeys: string; }; } export interface InternalAxiosReponseExtendConfig extends AxiosResponse { config: InternalAxiosRequestExtendConfig; } export interface RawAPIParams { sdpBizType?: string; sdpOrgId?: string; sdpAppId?: string; originBaseURL?: string; baseURL?: string; } export interface UCRequestParams extends RawAPIParams { noAuth?: boolean; uc: UC; env: string; originBaseURL: string; handleError?: (error: any, response?: AxiosResponse) => void; }