import type { ServerResponse } from 'http'; /** * Manages Server-Sent Events (SSE) connections for real-time updates. */ export declare class SSEManager { private clients; private heartbeatInterval; private readonly maxClients; constructor(); /** * Set up listeners for dashboard state events. * Each listener is wrapped in try-catch to prevent unhandled rejections. */ private setupEventListeners; /** * Start sending heartbeat messages to keep connections alive */ startHeartbeat(): void; /** * Stop the heartbeat interval */ stopHeartbeat(): void; /** * Add a new SSE client connection. * Returns false if max clients reached. */ addClient(res: ServerResponse): boolean; /** * Send a message to a specific client */ private sendToClient; /** * Broadcast an event to all connected clients */ broadcast(event: string, data: unknown): void; /** * Get the number of connected clients */ getClientCount(): number; /** * Close all client connections */ closeAll(): void; } /** * Broadcast a log message to all connected dashboard clients */ export declare function broadcastLog(level: 'info' | 'warn' | 'error', message: string): void; /** * Update the progress message displayed in the dashboard. * This updates just the message text without changing the progress numbers. * Useful for showing sub-progress (e.g., Ollama batch progress). */ export declare function updateProgressMessage(message: string): void; /** * Update sub-progress within the current phase with percentage. * Allows embedding backends to report their own progress with a working progress bar. */ export declare function updateSubProgress(current: number, total: number, message: string): void; /** * Singleton instance of the SSE manager */ export declare const sseManager: SSEManager; //# sourceMappingURL=events.d.ts.map