import type { AxiosRequestConfig, CreateAxiosDefaults } from 'axios'; import type { Agent } from 'node:http'; /** * Returns the proxy URL that applies to `targetUrl` based on the standard proxy * environment variables (`HTTP_PROXY`, `HTTPS_PROXY`, `ALL_PROXY`, `NO_PROXY`, * and their lowercase variants), or `undefined` when the connection should be * made directly. */ export declare function getProxyUrl(targetUrl: string): string | undefined; /** * Returns a proxy agent for connecting to `targetUrl` based on the standard * proxy environment variables (`HTTP_PROXY`, `HTTPS_PROXY`, `ALL_PROXY`, * `NO_PROXY`, and their lowercase variants), or `undefined` when no proxy * applies and the connection should be made directly. * * `http(s)://` proxies are tunneled via the agent matching the target's scheme; * `socks://`, `socks4://`, and `socks5://` proxies use the SOCKS agent (which * handles both HTTP and HTTPS targets). */ export declare function createProxyAgent(targetUrl: string): Agent | undefined; /** * Installs a proxy agent on an axios config for requests to `targetUrl` and * disables axios's own proxy handling. * * `proxy: false` is mandatory: without it, axios re-reads the proxy environment * variables itself and rewrites the request, appending the proxy's port to * portless target URLs (e.g. `https://api.checklyhq.com` becomes * `https://api.checklyhq.com:8080`). Letting the agent own all proxy behavior * keeps the target URL intact. When no proxy applies the agent is omitted and * the request connects directly. */ export declare function assignProxy(targetUrl: string, axiosConfig: T): T;