import type { FetchOptions } from 'ofetch'; import 'nuxt/app'; type Params = Record; export declare class Http { /** $fetch 配置参数 */ options: FetchOptions; constructor(options?: FetchOptions); /** * 基于当前实例 options 创建一个新实例 * @param options $fetch 配置参数 * @returns 返回一个基于当前实例选项新建的 http */ create(options?: FetchOptions): Http; /** * 发送一个自定义请求 * @param url 请求地址 * @param options ofetch options */ request(url: string, options?: FetchOptions): Promise>; /** * 发送 get 请求 * @param url 请求地址 * @param params 请求参数 * @param options ofetch options */ get(url: string, params?: Params, options?: FetchOptions): Promise>; /** * 发送 post 请求 * @param url 请求地址 * @param params 请求参数 * @param options ofetch options */ post(url: string, params?: Params, options?: FetchOptions): Promise>; /** * 发送 put 请求 * @param url 请求地址 * @param params 请求参数 * @param options ofetch options */ put(url: string, params?: Params, options?: FetchOptions): Promise>; /** * 发送 delete 请求 * @param url 请求地址 * @param params 请求参数 * @param options ofetch options */ delete(url: string, params?: Params, options?: FetchOptions): Promise>; } export {};