/// import http from 'http'; import { Readable } from 'stream'; import { HttpProxyAgentOptions } from 'http-proxy-agent'; import { HttpsProxyAgentOptions } from 'https-proxy-agent'; import { SocksProxyAgentOptions } from 'socks-proxy-agent'; import { Agent, AgentCallbackReturn, AgentOptions, ClientRequest, RequestOptions } from 'agent-base'; declare type FindProxyForURL = (req: http.ClientRequest, opts: http.RequestOptions, url: string) => Promise; /** * The `PacProxyAgent` class. * * A few different "protocol" modes are supported (supported protocols are * backed by the `get-uri` module): * * - "pac+data", "data" - refers to an embedded "data:" URI * - "pac+file", "file" - refers to a local file * - "pac+ftp", "ftp" - refers to a file located on an FTP server * - "pac+http", "http" - refers to an HTTP endpoint * - "pac+https", "https" - refers to an HTTPS endpoint * * @api public */ declare class _PacProxyAgent extends Agent { resolver: FindProxyForURL; opts: createPacProxyAgent.PacProxyAgentOptions; cache?: Readable; constructor(resolver: FindProxyForURL, opts?: createPacProxyAgent.PacProxyAgentOptions); /** * Called when the node-core HTTP client library is creating a new HTTP request. * * @api protected */ callback(req: ClientRequest, opts: RequestOptions): Promise; } declare function createPacProxyAgent(resolver: FindProxyForURL, opts?: createPacProxyAgent.PacProxyAgentOptions): _PacProxyAgent; declare namespace createPacProxyAgent { interface PacProxyAgentOptions extends AgentOptions, HttpProxyAgentOptions, HttpsProxyAgentOptions, SocksProxyAgentOptions { fallbackToDirect?: boolean; originalAgent?: false | http.Agent; } type PacProxyAgent = _PacProxyAgent; const PacProxyAgent: typeof _PacProxyAgent; } export = createPacProxyAgent;