Stone.js API
    Preparing search index...

    A WebSocket connection, duck-typed over the ws WebSocket instance.

    The adapter never imports ws types at runtime; it relies on this minimal shape so ws stays an optional peer dependency and a fake socket can drive the tests.

    interface WsSocket {
        close: (code?: number, reason?: string) => void;
        on: (event: string, listener: (...args: any[]) => void) => void;
        send: (data: string) => void;
        terminate?: () => void;
    }
    Index
    close: (code?: number, reason?: string) => void

    Close the connection.

    on: (event: string, listener: (...args: any[]) => void) => void

    Subscribe to a socket event (message, close, error).

    send: (data: string) => void

    Send a serialized frame to the client.

    terminate?: () => void

    Drop the connection without waiting for a close handshake.