rest-vir - v1.0.0
    Preparing search index...

    Type Alias GenericConnectWebSocketParams<WebSocketClass>

    Generic connection parameters for connectWebSocket.

    type GenericConnectWebSocketParams<WebSocketClass extends CommonWebSocket> = {
        listeners?: ConnectWebSocketListeners<NoParam, WebSocketClass>;
        pathParams?: Record<string, string>;
        protocols?: string[];
        searchParams?: BaseSearchParams;
        webSocketConstructor?: new (
            url: string,
            protocols: string[] | undefined,
            webSocketDefinition: WebSocketDefinition,
        ) => WebSocketClass;
    }

    Type Parameters

    Index

    Properties

    Optional listeners that can be immediately attached to the WebSocket instance instead of requiring externally adding them.

    pathParams?: Record<string, string>

    Parameters for WebSocket paths that need them, like '/my-path/:param1/:param2'.

    protocols?: string[]

    A list of WebSocket protocols. This is the standard built-in argument for the WebSocket constructor.

    searchParams?: BaseSearchParams
    webSocketConstructor?: new (
        url: string,
        protocols: string[] | undefined,
        webSocketDefinition: WebSocketDefinition,
    ) => WebSocketClass

    A custom WebSocket constructor. Useful for debugging or unit testing. This can safely be omitted to use the default JavaScript built-in global WebSocket class.

    globalThis.WebSocket