Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...

    The subset of WebSocket this client uses, so a test can supply a fake.

    Only the event payloads this client reads are declared. A real WebSocket therefore satisfies this structurally except for its handler arity, which the module-private openPlatformSocket bridges.

    interface ControlSocketLike {
        send(data: string): void;
        close(): void;
        onopen: (() => void) | null;
        onclose: ((event?: { code?: number; reason?: string }) => void) | null;
        onerror: (() => void) | null;
        onmessage: ((event: { data: unknown }) => void) | null;
    }
    Index
    onopen: (() => void) | null
    onclose: ((event?: { code?: number; reason?: string }) => void) | null

    Close handler.

    The code is optional in the type and load-bearing in practice: the hub accepts a handshake it means to refuse and then closes it with a code, so that a client can tell "no hub here" from "your token is wrong". A handler that ignored the code would make that choice pointless.

    onerror: (() => void) | null
    onmessage: ((event: { data: unknown }) => void) | null