import { RequestResponse } from "./RequestResponse"; declare const methods: readonly [ "GET", "POST", "PUT", "DELETE", "HEAD", "OPTIONS", "TRACE", "CONNECT", "PATCH" ]; /** * @value 'GET' HTTP 请求 GET * @value 'POST' HTTP 请求 POST * @value 'OPTIONS' HTTP 请求 OPTIONS * @value 'HEAD' HTTP 请求 HEAD * @value 'PUT' HTTP 请求 PUT * @value 'DELETE' HTTP 请求 DELETE * @value 'TRACE' HTTP 请求 TRACE * @value 'CONNECT' HTTP 请求 CONNECT * @value 'PATCH' HTTP 请求 PATCH */ declare type Method = typeof methods[number]; declare type RequestCallbackOptions = import("../../common").CallbackOptions; export interface RequestOptions extends RequestCallbackOptions { /** * 开发者服务器接口地址 */ url: string; /** * HTTP 请求方法 */ method?: Method; /** * 请求的参数 */ data?: string | unknown[] | Record; /** * 返回的数据格式 * @value 'json' 返回的数据为 JSON,返回后会对返回的数据进行一次 JSON.parse * @value 其他 不对返回的内容进行 JSON.parse */ dataType?: string; /** * 响应的数据类型 * @value 'text' 响应的数据为文本 */ responseType?: string; /** * 是否使用预拉取的缓存 */ usePrefetchCache?: boolean; /** * 超时时间,单位为毫秒 */ timeout?: number; /** * 设置请求的 header,header 中不能设置 Referer。 `content-type` 默认为 `application/json` */ header?: Record & { Referer?: never; }; /** * 是否开启返回性能参数,默认开启 */ enableProfile: boolean; } export {};