import { RxReplicationState } from '../replication'; import { WebsocketClientOptions } from './websocket-types'; import ReconnectingWebSocket from 'reconnecting-websocket'; import IsomorphicWebSocket from 'isomorphic-ws'; import { Subject, BehaviorSubject } from 'rxjs'; import { RxError } from '../../types'; export type WebsocketClient = { url: string; socket: ReconnectingWebSocket; connected$: BehaviorSubject; message$: Subject; error$: Subject; }; /** * Copied and adapter from the 'reconnecting-websocket' npm module. * Some bundlers have problems with bundling the isomorphic-ws plugin * so we directly check the correctness in NxDB to ensure that we can * throw a helpful error. */ export declare function ensureIsWebsocket(w: typeof IsomorphicWebSocket): void; export declare function createWebSocketClient(url: string): Promise; export declare function replicateWithWebsocketServer(options: WebsocketClientOptions): Promise>;