import { AxiosHeaders, AxiosRequestConfig } from "axios"; import { ILogger } from "./util.log.js"; import { HttpProxyAgent } from "http-proxy-agent"; import { HttpsProxyAgent } from "https-proxy-agent"; import nodeHttp from "http"; import * as https from "node:https"; export declare class HttpError extends Error { status?: number; statusText?: string; code?: string; request?: { baseURL: string; url: string; method: string; params?: any; data?: any; }; response?: { data: any; headers: AxiosHeaders; }; cause?: any; constructor(error: any); } export declare const HttpCommonError: typeof HttpError; export type GlobalProxyOptions = { httpProxy?: string; httpsProxy?: string; noProxy?: string; }; export declare function setGlobalProxy(opts: GlobalProxyOptions): void; export declare function getGlobalAgents(): { httpAgent: nodeHttp.Agent | HttpProxyAgent; httpsAgent: HttpsProxyAgent | https.Agent; }; export declare function setGlobalHeaders(headers?: Record): void; export declare function getGlobalHeaders(): Record; /** * @description 创建请求实例 */ export declare function createAxiosService({ logger }: { logger: ILogger; }): import("axios").AxiosInstance; export declare const http: HttpClient; export type HttpClientResponse = any; export type HttpRequestConfig = { skipSslVerify?: boolean; skipCheckRes?: boolean; logReq?: boolean; logParams?: boolean; logRes?: boolean; logData?: boolean; httpProxy?: string; returnOriginRes?: boolean; } & AxiosRequestConfig; export type HttpClient = { request(config: HttpRequestConfig): Promise>; }; export type CreateAgentOptions = { httpProxy?: string; httpsProxy?: string; } & nodeHttp.AgentOptions; export declare function createAgent(opts?: CreateAgentOptions): { httpAgent: nodeHttp.Agent | HttpProxyAgent; httpsAgent: HttpsProxyAgent | https.Agent; }; export declare function isNoProxyMatched(rule: string, target: { hostname: string; port: string; }): boolean; export declare function download(req: { http: HttpClient; config: HttpRequestConfig; savePath: string; logger: ILogger; }): Promise; export declare function getCookie(response: any, name: string): any; //# sourceMappingURL=util.request.d.ts.map