import { BaseHelper } from '../../../base/base.helper'; import { ValueOrPromise } from '../../../common'; import { TcpSocketConnectOpts as PlainConnectionOptions, Socket as PlainSocketClient } from 'node:net'; import { ConnectionOptions as TlsConnectionOptions, TLSSocket as TlsSocketClient } from 'node:tls'; export interface INetworkTcpClientProps { identifier: string; scope?: string; options: SocketClientOptions; reconnect?: boolean; maxRetry?: number; encoding?: BufferEncoding; createClientFn: (options: SocketClientOptions, connectionListener?: () => void) => SocketClientType; onConnected?: (opts: { client: SocketClientType; }) => ValueOrPromise; onData?: (opts: { identifier: string; message: string | Buffer; }) => ValueOrPromise; onClosed?: (opts: { client: SocketClientType; }) => void; onError?: (error: any) => void; } export declare class BaseNetworkTcpClient extends BaseHelper { protected client?: SocketClientType | null; protected options: SocketClientOptions; protected reconnect?: boolean; protected retry: { maxReconnect: number; currentReconnect: number; }; protected reconnectTimeout: any; protected encoding?: BufferEncoding; protected createClientFn: (options: SocketClientOptions, connectionListener?: () => void) => SocketClientType; protected onConnected: (opts: { client: SocketClientType; }) => void; protected onData: (opts: { identifier: string; message: string | Buffer; }) => void; protected onClosed?: (opts: { client: SocketClientType; }) => void; protected onError?: (error: any) => void; constructor(opts: INetworkTcpClientProps); getClient(): SocketClientType; handleConnected(): void; handleData(_opts: { identifier: string; message: string | Buffer; }): void; handleClosed(): void; handleError(error: any): void; connect(opts: { resetReconnectCounter: boolean; }): void; disconnect(): void; forceReconnect(): void; isConnected(): boolean; emit(opts: { payload: Buffer | string; }): void; } //# sourceMappingURL=base-tcp-client.helper.d.ts.map