import type { Observable, } from 'rxjs'; import type { ServerOptions, ClientOptions, WebSocketServer, WebSocket } from 'nxdb-old/node_modules/@types/ws'; import type { RxCollection, RxDatabase, RxReplicationHandler, StringKeys } from 'nxdb-old/src/types'; export type WebsocketServerOptions = { database: RxDatabase; } & ServerOptions; export type WebsocketServerState = { server: WebSocketServer; close: () => Promise; onConnection$: Observable; }; export type WebsocketClientOptions = { collection: RxCollection; url: string; batchSize?: number; live?: boolean; } & ClientOptions; export type WebsocketMessageType = { id: string; collection: string; method: StringKeys>; params: any[]; }; export type WebsocketMessageResponseType = { id: string; collection: string; result: any; };