UNPKG

@sanpjs/runtime

Version:

San Pro Runtime

11 lines (10 loc) 795 B
/** * 简单包装 axios 请求 */ import type { AxiosResponse, AxiosRequestConfig } from 'axios'; import axios from 'axios'; export declare const get: <T = any, R = AxiosResponse<T, any>, D = any>(url: string, config?: AxiosRequestConfig<D> | undefined) => Promise<R>; export declare const post: <T = any, R = AxiosResponse<T, any>, D = any>(url: string, data?: D | undefined, config?: AxiosRequestConfig<D> | undefined) => Promise<R>; export declare const put: <T = any, R = AxiosResponse<T, any>, D = any>(url: string, data?: D | undefined, config?: AxiosRequestConfig<D> | undefined) => Promise<R>; export declare const patch: <T = any, R = AxiosResponse<T, any>, D = any>(url: string, data?: D | undefined, config?: AxiosRequestConfig<D> | undefined) => Promise<R>; export default axios;