/** * Mock WebSocket implementation for testing. * Captures all messages sent and tracks connection state. */ import type { ConnectionData } from "../context/base-context.js"; import type { AdapterWebSocket } from "../ws/platform-adapter.js"; import type { OutgoingFrame } from "./types.js"; /** * In-memory AdapterWebSocket that records all sent messages. */ export declare class TestWebSocket implements AdapterWebSocket { readonly clientId: string; readyState: "CONNECTING" | "OPEN" | "CLOSING" | "CLOSED"; initialData?: Record; private sentMessages; private sentRaw; constructor(clientId: string, initialData?: Record); /** * Send message (records to sentMessages). */ send(data: string | ArrayBuffer): void; /** * Close connection. */ close(code?: number, reason?: string): void; /** * Get all messages sent to this connection. */ getSentMessages(): readonly OutgoingFrame[]; /** * Get all raw sent messages (for debugging malformed/binary frames). */ getSentMessagesRaw(): readonly (string | ArrayBuffer)[]; /** * Clear sent messages (for testing). */ clearSentMessages(): void; private decode; } /** * Connection state for test adapter. */ export interface ConnectionState { ws: TestWebSocket; data: TContext; headers?: Record; subscriptions: Set; } //# sourceMappingURL=test-websocket.d.ts.map