import type io from 'socket.io'; import { BaseHost, CallerIdentity, type Message } from '@dazl/engine-core'; import { type IDisposable } from '@dazl/patterns'; export interface IConnectionEvent { clientId: string; socket: io.Socket; } export type IConnectionHandler = (event: IConnectionEvent) => void; export interface ConnectionHandlers { onConnectionOpen?: IConnectionHandler; onConnectionClose?: IConnectionHandler; onConnectionReconnect?: IConnectionHandler; } export declare class WsHost extends BaseHost { private socket; constructor(socket: io.Socket); postMessage(data: any): void; } /** * Extracts caller identity from Socket.IO handshake. */ export type IdentityExtractor = (handshake: io.Socket['handshake'], clientId: string) => CallerIdentity | undefined; export declare class WsServerHost extends BaseHost implements IDisposable { private server; private connectionHandlers; private disconnectionHandlers; private reconnectionHandlers; private socketToEnvId; private clientIdToSocket; private disposables; private identityStore; private identityExtractor?; dispose: () => Promise; isDisposed: () => boolean; constructor(server: io.Server | io.Namespace, identityExtractor?: IdentityExtractor); registerConnectionHandler(handler: IConnectionHandler): () => void; registerDisconnectionHandler(handler: IConnectionHandler): () => void; registerReconnectionHandler(handler: IConnectionHandler): () => void; postMessage(data: Message): void; private callWithErrorHandling; private onConnection; } //# sourceMappingURL=ws-node-host.d.ts.map