/** * 定义请求参数的接口 */ export interface IRequestOptions { method?: 'GET' | 'POST' | 'PUT' | 'DELETE'; headers?: Record; body?: BodyInit; } /** * 定义拦截器的接口 */ export interface Interceptor { onFulfilled?: (value: T) => T | Promise; onRejected?: (error: T) => T | Promise; } /** * 添加拦截器的 request 函数 * * @param url * @param options */ export declare function request(url: string, options?: IRequestOptions): Promise;