import { type Socket } from "socket.io-client"; import { ClientConfig, ClientProcHandler, ConnectionState } from "../client"; import { Connection, Proc } from "../core"; export declare function createClient(io: Socket, config: ClientConfig): SocketIOChatterClient; declare class SocketIOChatterClient implements Connection { #private; constructor(socket: Socket, config: ClientConfig); /** * The current connection state. */ get state(): ConnectionState; /** * True when the socket is open and ready. */ get isConnected(): boolean; /** * Registers a callback to run when the `state` value changes. * Returns a function that stops listening for changes. */ onStateChange(callback: (state: ConnectionState) => void): () => void; /** * Implements a `Proc` so it can be called from the other end of the connection. */ on(proc: Proc, handler: ClientProcHandler): void; call(proc: Proc): Promise; call(proc: Proc, input: null): Promise; call(proc: Proc, input: I): Promise; } export {};