// Type definitions for hailuo-http type ErrorMessageMode = "none" | "modal" | "message" | undefined; type ref = any interface RequestOptions { // Splicing request parameters to url joinParamsToUrl?: boolean; // Format request parameter time formatDate?: boolean; // Whether to process the request result isTransformResponse?: boolean; // Whether to return native response headers // For example: use this attribute when you need to get the response headers isReturnNativeResponse?: boolean; // Whether to join url joinPrefix?: boolean; // Interface address, use the default apiUrl if you leave it blank apiUrl?: string; // 请求拼接路径 urlPrefix?: string; // Error message prompt type errorMessageMode?: ErrorMessageMode; // Whether to add a timestamp joinTime?: boolean; ignoreCancelToken?: boolean; // Whether to send token in header withToken?: boolean; } declare module "hailuo-http" { type AxiosRequestConfig = import("axios").AxiosRequestConfig; interface VAxios { get( config: AxiosRequestConfig, options?: RequestOptions ): Promise; post( config: AxiosRequestConfig, options?: RequestOptions ): Promise; put( config: AxiosRequestConfig, options?: RequestOptions ): Promise; delete( config: AxiosRequestConfig, options?: RequestOptions ): Promise; // FIXME: axios does not support patch method head( config: AxiosRequestConfig, options?: RequestOptions ): Promise; // FIXME: axios does not support patch method options( config: AxiosRequestConfig, options?: RequestOptions ): Promise; // FIXME: axios does not support patch method patch( config: AxiosRequestConfig, options?: RequestOptions ): Promise; } var defHttp: VAxios; // exports.defHttp = defHttp; }