Documentation
    Preparing search index...

    Interface UniversalWebSocket

    Common WebSocket interface that can be implemented by different WebSocket-like classes This is compatible with the standard WebSocket API but allows for custom implementations

    interface UniversalWebSocket {
        binaryType: "arraybuffer" | "blob";
        bufferedAmount: number;
        CLOSED: 3;
        CLOSING: 2;
        CONNECTING: 0;
        extensions: string;
        onclose?: ((event: RivetCloseEvent) => void) | null;
        onerror?: ((event: RivetEvent) => void) | null;
        onmessage?: ((event: RivetMessageEvent) => void) | null;
        onopen?: ((event: RivetEvent) => void) | null;
        OPEN: 1;
        protocol: string;
        readyState: 0 | 1 | 2 | 3;
        url: string;
        addEventListener(type: string, listener: (event: any) => void): void;
        close(code?: number, reason?: string): void;
        dispatchEvent(event: RivetEvent): boolean;
        removeEventListener(type: string, listener: (event: any) => void): void;
        send(
            data:
                | string
                | ArrayBufferLike
                | Blob
                | ArrayBufferView<ArrayBufferLike>,
        ): void;
    }

    Implemented by

    Index

    Properties

    binaryType: "arraybuffer" | "blob"
    bufferedAmount: number
    CLOSED: 3
    CLOSING: 2
    CONNECTING: 0
    extensions: string
    onclose?: ((event: RivetCloseEvent) => void) | null
    onerror?: ((event: RivetEvent) => void) | null
    onmessage?: ((event: RivetMessageEvent) => void) | null
    onopen?: ((event: RivetEvent) => void) | null
    OPEN: 1
    protocol: string
    readyState: 0 | 1 | 2 | 3
    url: string

    Methods