/** * Nexus Connect — In-memory message broker. * * Maintains a pub/sub registry keyed by topic string. * Keeps the last published message per topic for late subscribers * (same semantics as RxJS BehaviorSubject). * * Designed to be a singleton per server process. In multi-process/Edge * environments, replace the singleton with a Redis/Upstash adapter. */ export interface ConnectMessage { topic: string; data: T; id: string; ts: number; } type Subscriber = (msg: ConnectMessage) => void; declare class MessageBroker { private subs; private cache; subscribe(topic: string, fn: Subscriber): () => void; publish(topic: string, data: T): void; /** Number of active SSE listeners for a topic (useful for presence) */ subscriberCount(topic: string): number; /** All currently active topics */ topics(): string[]; } /** Singleton broker shared across all channels in this server process. */ export declare const broker: MessageBroker; export {}; //# sourceMappingURL=broker.d.ts.map