import { Options as JsonpOptions } from 'fetch-jsonp'; import { AxiosRequestConfig as AxiosOptions } from 'axios'; import { Ctx, ReqType, Middleware, WxApiConfig, WebApiConfig, SelfApiConfig, CtxReqFnParams, RuntimeOptions, DefaultApiConfig, AnyPromiseFunction } from './interfaces'; declare class TuaApi { baseUrl: string; reqType: ReqType; middleware: Middleware[]; customFetch: AnyPromiseFunction; axiosOptions: AxiosOptions; jsonpOptions: JsonpOptions; defaultErrorData: any; constructor({ baseUrl, reqType, middleware, customFetch, axiosOptions, jsonpOptions, defaultErrorData, }?: DefaultApiConfig); /** * 添加一个中间件函数 * @param fn * @return self */ use(fn: Middleware): this; /** * 根据 apiConfig 生成请求函数组成的 map */ getApi(apiConfig: WebApiConfig | WxApiConfig): T; _reqFn(options: CtxReqFnParams): Promise; /** * 检查 reqType 是否合法 */ _checkReqType(reqType: any): void; /** * 组合生成中间件函数 * @param {function[]} middleware * @param {Boolean} useGlobalMiddleware 是否使用全局中间件 */ _getMiddlewareFn(middleware: any, useGlobalMiddleware: any): any; _getOneReqMap({ mock, name, path, body, prefix, method, baseUrl, params: rawParams, afterFn, beforeFn, middleware, useGlobalMiddleware, ...rest }: SelfApiConfig): { [x: string]: { (rawArgs: any, runtimeOptions?: RuntimeOptions): Promise; key: string; url: string; mock: any; params: import("./interfaces").ParamsConfig; }; }; private mergeByDefault; } export default TuaApi; export * from './exportUtils'; export * from './middlewareFns'; //# sourceMappingURL=index.d.ts.map