export interface LoopbackBridge { connect(socket: LoopbackWebSocket): void | Promise; send(socket: LoopbackWebSocket, data: string): void | Promise; disconnect(socket: LoopbackWebSocket, code: number, reason: string): void | Promise; } /** * In-memory WebSocket implementation used to bridge Convex clients to an embedded runtime. */ export declare class LoopbackWebSocket { private readonly bridge; static readonly CONNECTING = 0; static readonly OPEN = 1; static readonly CLOSING = 2; static readonly CLOSED = 3; readonly CONNECTING = 0; readonly OPEN = 1; readonly CLOSING = 2; readonly CLOSED = 3; readonly url: string; readonly protocol = ""; readonly extensions = ""; readonly binaryType = "blob"; readyState: number; bufferedAmount: number; onopen: ((event: any) => void) | null; onmessage: ((event: any) => void) | null; onclose: ((event: any) => void) | null; onerror: ((event: any) => void) | null; private readonly listeners; constructor(bridge: LoopbackBridge, url: string, _protocols?: string | string[]); send(data: string): void; close(code?: number, reason?: string): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject | null): void; removeEventListener(type: string, listener: EventListenerOrEventListenerObject | null): void; openFromBridge(): void; messageFromBridge(data: string): void; closeFromBridge(code: number, reason: string): void; errorFromBridge(error: unknown): void; private runBridgeCall; private emit; private propertyHandler; private setPropertyHandler; } export declare function createLoopbackWebSocketConstructor(bridge: LoopbackBridge): typeof WebSocket;