UNPKG

@pwc-ra/components

Version:

PwC RA shared components library

20 lines (19 loc) 871 B
import type { AxiosResponse, AxiosRequestConfig } from 'axios'; interface CustomRequestConfig { /** * 控制数据格式转换行为 * - true: 启用数据格式转换 * - false: 禁用数据格式转换 * - 默认为 true */ transformKeys?: boolean; } type ExtendedRequestConfig = AxiosRequestConfig & CustomRequestConfig; export declare const setAutoTransformKeys: (enabled: boolean) => void; export declare const http: { get: <T>(url: string, config?: ExtendedRequestConfig) => Promise<AxiosResponse<T, any>>; post: <T>(url: string, data?: any, config?: ExtendedRequestConfig) => Promise<AxiosResponse<T, any>>; put: <T>(url: string, data?: any, config?: ExtendedRequestConfig) => Promise<AxiosResponse<T, any>>; delete: <T>(url: string, config?: ExtendedRequestConfig) => Promise<AxiosResponse<T, any>>; }; export {};