types.ts
452 字节
import type { AxiosRequestConfig, AxiosResponse } from "axios"
/* eslint-disable */
interface HCInterceptors<T = AxiosResponse> {
requestSuccessFn?: (config: any) => any
requestFailureFn?: (err: any) => any
responseSuccessFn?: (res: T) => T
responseFailureFn?: (err: any) => any
}
// 针对 AxiosRequestConfig 接口进行扩展
export interface HYRequestConfig<T = AxiosResponse> extends AxiosRequestConfig {
interceptors?: HCInterceptors<T>
}