import type { Transport } from './provider.js'; /** The structural slice of `WebSocket` this transport uses. */ export interface WebSocketLike { binaryType: string; readyState: number; send: (data: Uint8Array) => void; close: () => void; onopen: ((event: unknown) => void) | null; onclose: ((event: { reason?: string; }) => void) | null; onerror: ((event: unknown) => void) | null; onmessage: ((event: { data: unknown; }) => void) | null; } export type WebSocketConstructor = new (url: string) => WebSocketLike; export interface WebSocketTransportOptions { /** Full URL including the room, for example `wss://host/room-id` (see {@link roomUrl}). */ url: string; WebSocket?: WebSocketConstructor; /** First reconnect delay in ms; doubles up to `maxDelayMs`. Default 250. */ baseDelayMs?: number; maxDelayMs?: number; /** Give up after this many consecutive failed attempts. Default unlimited. */ maxRetries?: number; /** Page protocol for the mixed-content check; defaults to the ambient location. */ pageProtocol?: string | undefined; } /** Join a server base URL and a validated room id: `roomUrl('wss://h/collab', 'r1')`. */ export declare function roomUrl(server: string, roomId: string): string; export declare function createWebSocketTransport(options: WebSocketTransportOptions): Transport; //# sourceMappingURL=websocket-transport.d.ts.map