import { EventEmitter } from 'events'; import net from 'net'; import type { CipherNameAndProtocol, SecureVersion, TLSSocket } from 'tls'; import type { Logger } from '../../types/common'; export type TlsConnectionOptions = { readonly rejectUnauthorized?: boolean; readonly minVersion?: SecureVersion; readonly maxVersion?: SecureVersion; readonly minDHSize?: number; readonly ca?: string | Buffer | (string | Buffer)[]; readonly cert?: string | Buffer | (string | Buffer)[]; readonly key?: string | Buffer | (string | Buffer)[]; readonly passphrase?: string; readonly ciphers?: string; readonly ecdhCurve?: string; readonly secureProtocol?: string; readonly ALPNProtocols?: string[]; }; export type SocketManagerOptions = { readonly host: string; readonly port: number; readonly secure?: boolean; readonly servername?: string; readonly tls?: TlsConnectionOptions; readonly connectionTimeout?: number; readonly socketTimeout?: number; readonly keepAliveInterval?: number; readonly logger?: Logger; readonly cid?: string; }; export type SocketInfo = { readonly remoteAddress?: string; readonly remotePort?: number; readonly localAddress?: string; readonly localPort?: number; readonly secure: boolean; readonly tls?: CipherNameAndProtocol & { authorized?: boolean; }; }; export type SocketManagerEvents = { connect: []; data: [Buffer]; error: [Error]; close: []; end: []; timeout: []; }; export declare class SocketManager extends EventEmitter implements AsyncDisposable { private socket; private writeSocket; private inflateStream; private deflateStream; private readonly pipedDestinations; private readonly listenerTracker; private readonly timerManager; private disposed; private compressed; private readonly host; private readonly port; private readonly secure; private readonly servername?; private readonly tlsOptions?; private readonly connectionTimeout; private readonly socketTimeout; private readonly keepAliveInterval; private readonly logger?; private readonly cid?; constructor(options: SocketManagerOptions); get isConnected(): boolean; get isDisposed(): boolean; get isCompressed(): boolean; get socketInfo(): SocketInfo | null; connect(): Promise; upgradeToTls(): Promise; enableCompression(): void; write(data: Buffer | string): boolean; pipe(destination: T): T; unpipe(destination?: NodeJS.WritableStream): this; setWriteSocket(socket: net.Socket | TLSSocket): void; getSocket(): net.Socket | TLSSocket | null; getWriteSocket(): net.Socket | TLSSocket | null; destroy(): void; dispose(): void; [Symbol.asyncDispose](): Promise; private setupSocketListeners; private isTlsSocket; } export declare const createSocketManager: (options: SocketManagerOptions) => SocketManager; //# sourceMappingURL=socket-manager.d.ts.map