/** * @license * Copyright Elegante All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://elegante.dev/license */ import WebSocket, { CloseEvent, Event, MessageEvent } from 'isomorphic-ws'; export interface WebSocketFactory { onConnect: (ws: WebSocket) => void; onOpen: (ws: WebSocket, ev: Event) => void; onError: (ws: WebSocket, err: Event) => void; onClose: (ws: WebSocket, ev: CloseEvent) => void; onMessage: (ws: WebSocket, message: MessageEvent) => void; } export declare function webSocketServer(socketURL: string, apiKey?: string, token?: string | null, secret?: string | null): (factory: WebSocketFactory) => void; export declare function getUrl(): string;