import http from 'node:http'; export interface StreamEvent { type: string; data: unknown; } /** * SSEStream — Server-Sent Events endpoint for real-time dashboard push. * * Lightweight alternative to ObservationStream (WebSocket). Attaches to an * existing http.Server by handling requests to '/sse'. Broadcasts typed * events (observation:new, stats:update, etc.) to all connected clients. * Heartbeat comment every 30s to keep connections alive. */ export declare class SSEStream { private clients; private heartbeatInterval; private static readonly MAX_CLIENTS; constructor(); /** * Handle an incoming HTTP request. Returns true if the request was handled * (i.e. it was a GET to /sse), false otherwise so the caller can route it * elsewhere. */ handleRequest(req: http.IncomingMessage, res: http.ServerResponse): boolean; /** * Broadcast an event to all connected SSE clients. * Format: `event: \ndata: \n\n` */ broadcast(event: StreamEvent): void; /** * Gracefully stop — clear heartbeat, end all client connections. */ stop(): void; /** Number of connected clients (useful for diagnostics). */ get clientCount(): number; private heartbeat; } //# sourceMappingURL=sse-stream.d.ts.map