import Interceptor from "./interceptor"; import { dd } from "../../typings"; import { Ddan } from "../../typings"; export default class Http implements dd.IHttp { host: string; reqConfig: {}; handleError?: (error: any) => void; interceptors: { request: Interceptor; response: Interceptor; }; constructor(_: dd.IHttpConfig); static blockId: string; static requestLock: {}; /** * 加锁 * @param {string} id * @param {function} func */ lockR(id: any, func: any): void; /** * 解锁 * @param {string} id */ unlockR(id: any): void; /** * 根据URL和请求参数构造唯一标识符 * @param {object} req */ getIdFromReq(req: any): string; /** * 根据URL构造唯一标识符 * @param {object} req */ getIdFromReqUrl(req: any): any; fetch(name: string, payload?: Ddan.KV): Promise; }