import type { WebSocket } from 'ws'; /** * Metadata decoded from the JWT on the HTTP upgrade request. * Consumers augment this via declaration merging: * * @example * declare module '@atlex/core' { * interface WsClientMeta { * userId: string * familyId: string * } * } */ export interface WsClientMeta { sub?: string; [key: string]: unknown; } /** * Typed wrapper around a raw ws.WebSocket connection. */ export declare class WsClient { readonly socket: WebSocket; /** Rooms this client is currently joined to. */ readonly rooms: Set; /** JWT claims decoded at upgrade time. */ readonly meta: WsClientMeta; constructor(socket: WebSocket, meta: WsClientMeta); /** * Join a room. Idempotent. * * @param room - room name, e.g. `'family:abc'` */ join(room: string): void; /** * Leave a room. No-op if not joined. * * @param room - room name to leave */ leave(room: string): void; /** * Send a typed event to this specific client. * No-op if socket is not in OPEN state. * * @param event - event name * @param payload - JSON-serialisable data */ send(event: string, payload: unknown): void; } //# sourceMappingURL=WsClient.d.ts.map