import type { ServerResponse } from 'node:http'; export type ChangeKind = 'nodes' | 'inbox'; export interface EventHub { /** Register an SSE client: writes the event-stream headers, streams events * until the connection closes, and self-removes on close. */ addClient: (res: ServerResponse) => void; /** Internal, in-process subscription to the same invalidations SSE clients * receive — for a server-side consumer (the push diff engine) that needs * the trigger without opening an HTTP/SSE connection to itself. Returns an * unsubscribe function. */ subscribe: (listener: (kind: ChangeKind) => void) => () => void; /** Tear down watchers + heartbeat and end all open streams. */ close: () => void; } /** Start the change-event hub: open the two fs watchers once, fan their * debounced invalidations out to every connected SSE client. Watchers run for * the server's lifetime (cheap — two inotify/FSEvents registrations), not * per-client, so N browsers share one watch. */ export declare function startEventHub(): EventHub;