import { SecureContextOptions } from 'node:tls'; import { tl, BaseTcpTransport, IntermediatePacketCodec } from '@mtcute/node'; /** * An error has occurred while connecting to an HTTP(s) proxy */ export declare class HttpProxyConnectionError extends Error { readonly proxy: HttpProxySettings; constructor(proxy: HttpProxySettings, message: string); } /** * HTTP(s) proxy settings */ export interface HttpProxySettings { /** * Host or IP of the proxy (e.g. `proxy.example.com`, `1.2.3.4`) */ host: string; /** * Port of the proxy (e.g. `8888`) */ port: number; /** * Proxy authorization username, if needed */ user?: string; /** * Proxy authorization password, if needed */ password?: string; /** * Proxy connection headers, if needed */ headers?: Record; /** * Whether this is a HTTPS proxy (i.e. the client * should connect to the proxy server via TLS) */ tls?: boolean; /** * Additional TLS options, used if `tls = true`. * Can contain stuff like custom certificate, host, * or whatever. */ tlsOptions?: SecureContextOptions; } /** * TCP transport that connects via an HTTP(S) proxy. */ export declare abstract class BaseHttpProxyTcpTransport extends BaseTcpTransport { readonly _proxy: HttpProxySettings; constructor(proxy: HttpProxySettings); private _platform; connect(dc: tl.RawDcOption): void; private _onProxyConnected; } /** * HTTP(s) TCP transport using an intermediate packet codec. * * Should be the one passed as `transport` to `TelegramClient` constructor * (unless you want to use a custom codec). */ export declare class HttpProxyTcpTransport extends BaseHttpProxyTcpTransport { _packetCodec: IntermediatePacketCodec; }