/**
 * 封装 fetch 请求
 * TODO: 请求模块需要 编写测试用例
 */
import * as Types from "./types";
export declare function normalizeUrl(urlStr: string, defMethod?: string): {
    url: string;
    method: Types.ReqMethod;
};
export declare function getUrlByOption(this: Types.ReqConfig, option: Types.ReqOption & Partial<Types.ReqConfig>): {
    url: string;
    method: "GET" | "PUT" | "DELETE" | "POST" | "PATCH" | "HEAD" | "OPTIONS" | undefined;
};
export declare class Request<IS = {}, IP = {}> {
    constructor(config?: Types.ReqConfig);
    domains: {
        [domain: string]: string;
    };
    isMock?: boolean;
    onPreRequest?: (option: Types.ReqOption) => Types.ReqOption;
    onRequest?: (option: Types.ReqOption) => Types.ReqOption;
    onError?: (response: Types.ReqResponse, option: Types.ReqOption, error: Error) => void;
    onSuccess?: (source: any, option: Types.ReqOption, response: Types.ReqResponse) => any;
    onFinish?: (response: Types.ReqResponse, option: Types.ReqOption, error?: Error) => void;
    setConfig(config?: Types.ReqConfig): void;
    getUrlByOption(option: Types.ReqOption<IS, IP>): {
        url: string;
        method: "GET" | "PUT" | "DELETE" | "POST" | "PATCH" | "HEAD" | "OPTIONS" | undefined;
    };
    request<S = {}, P = {}>(option: Types.ReqOption<S | IS, P | IP>): Promise<Types.ReqResponse<S | IS> | undefined>;
}
