import { ResilientSocketOptions } from './ResilientSocket.js'; /** * Typed JSON over a reconnecting socket: `TIn` is what arrives, `TOut` is what * you send. * * This used to carry its own copy of the reconnection logic — the same * constants, the same doubling backoff, its own `new WebSocket` — and no message * queue. It is now what it always meant to be: a serialisation layer on top of * `ResilientSocket`, which owns reconnection for both of them. One * implementation to test, and the queue comes for free. * * A message that is not valid JSON is dropped with a warning rather than thrown: * a peer sending garbage should not take down the listener. That is the one * behaviour that differs from `SessionSocket`, which lets the parse error out. */ export declare class JsonSocket { private readonly socket; private readonly emitMessage; readonly onMessage: (listener: (data: TIn) => void) => () => boolean; readonly onOpen: (listener: (data: Event) => void) => () => boolean; readonly onReconnect: (listener: (data: import("./ResilientSocket.js").SocketReconnectionEvent) => void) => () => boolean; readonly onError: (listener: (data: Event) => void) => () => boolean; readonly onClose: (listener: (data: Event) => void) => () => boolean; get isConnected(): boolean; get uri(): string; constructor(uri: string, options?: ResilientSocketOptions); send(value: TOut): void; close(): void; private processMessage; } //# sourceMappingURL=JsonSocket.d.ts.map