import type { WebSocketConnection } from "../../base.js"; export interface DeferredWebSocketTransport { send(data: string | ArrayBuffer): void | number; close(code?: number, reason?: string): void; terminate?(): void; } /** * EventTarget-compatible socket used while a native server transport finishes * its upgrade handshake. Runtime adapters attach exactly one native transport * and feed its lifecycle events into this bridge. */ export declare class DeferredWebSocket implements WebSocketConnection { private readonly runtimeName; static readonly CONNECTING = 0; static readonly OPEN = 1; static readonly CLOSING = 2; static readonly CLOSED = 3; readyState: number; onopen: ((event: Event) => void) | null; onclose: ((event: CloseEvent) => void) | null; onerror: ((event: Event) => void) | null; onmessage: ((event: MessageEvent) => void) | null; private transport; private pendingClose; private openDispatched; private closeDispatched; private readonly listeners; constructor(runtimeName: string); protected attachTransport(transport: DeferredWebSocketTransport): void; protected emitMessage(data: unknown): void; protected emitClose(code?: number, reason?: string): void; protected emitTransportError(error: unknown): void; protected fail(error: unknown): void; send(data: string | ArrayBuffer): void; close(code?: number, reason?: string): void; addEventListener(type: string, listener: EventListener, options?: AddEventListenerOptions): void; removeEventListener(type: string, listener: EventListener): void; private sendNow; private dispatchOpen; private finishClose; private dispatch; private clearListeners; } //# sourceMappingURL=deferred-websocket.d.ts.map