import { EventEmitter } from "node:events"; export type WebSocketRawData = Buffer; export interface WebSocketClientOptions { headers?: Record; maxPayload?: number; } /** * Narrow RFC 6455 client for the daemon control plane. * * It intentionally supports only text, binary, and control frames, no extensions, and one * configured subprotocol. Keeping this transport on Node built-ins preserves the daemon's zero * production-dependency release invariant. */ export declare class WebSocketClient extends EventEmitter { private readonly options; static readonly CONNECTING = 0; static readonly OPEN = 1; static readonly CLOSING = 2; static readonly CLOSED = 3; readonly url: URL; readonly requestedProtocol: string; readonly maxPayload: number; protocol: string; readyState: number; private socket; private handshakeBuffer; private frameBuffer; private fragmentedOpcode; private fragmentedChunks; private fragmentedBytes; private closeEmitted; private closeSent; constructor(rawUrl: string, protocol: string, options?: WebSocketClientOptions); send(data: string | Buffer, callback?: (error?: Error) => void): void; close(code?: number, reason?: string): void; private connect; private sendHandshake; private onData; private consumeFrames; private emitFragmentedMessage; private failProtocol; private emitClose; }