import { TLSSocket } from 'node:tls'; import { Socket } from 'net'; export { Socket }; export interface TcpConnection { clientId: string; socket: Socket; tlsSocket?: TLSSocket; buffer: Buffer; isIdle: boolean; ref?: T; } export declare abstract class TcpBase { protected connections: Record>; private _connectionCount; protected abstract onConnected(connection: TcpConnection): Promise; protected abstract onClose(connection: TcpConnection, error?: Error): Promise; protected abstract onData(connection: TcpConnection, data?: Buffer): Promise; term(): Promise; protected addConnection(socket: Socket, tlsSocket: TLSSocket, clientId: string, ref?: T, keepAliveInterval?: number, idleTimeout?: number): Promise>; protected removeConnection(clientId: string): boolean; private onDataEvent; private onCloseEvent; protected get connectionCount(): number; protected static socketWrite(socket: Socket | TLSSocket, data: Buffer): Promise; protected static resetIdleTimeout(socket: Socket | TLSSocket, idleTimeout: number): void; }