type NextHandler = (data: unknown) => void; type ErrorHandler = (err: unknown) => void; /** A live multiplexed Hasura subscription socket for one endpoint. */ export declare class HasuraWsClient { private readonly url; private readonly onStatus?; private ws; private acked; private closed; private nextId; private readonly subs; private reconnectTimer; private reconnectDelay; /** * Creates a subscription socket for one GraphQL endpoint. * * **Details** * * - `url`: ws:// or wss:// GraphQL endpoint. * - `onStatus`: Called with the live connection state (ack ⇒ true, drop ⇒ false). */ constructor(url: string, onStatus?: ((connected: boolean) => void) | undefined); /** * Register a subscription. It is (re)sent whenever the socket is live, and * torn down on the returned unsubscribe. */ subscribe(query: string, variables: Record, onNext: NextHandler, onError?: ErrorHandler): () => void; /** Tear down the socket and forget every subscription. Idempotent. */ close(): void; private start; private stop; private ensureSocket; private onMessage; private onDisconnect; private teardownSocket; private detach; private send; } export {};