/**
 * In-process pub/sub for live-preview update events.
 *
 * The admin emits `notifyPreviewUpdate(collection, id, payload)` whenever a
 * draft document changes (today: the `PUT /collections/:slug/:id` route).
 * Active SSE streams subscribe via `subscribePreviewUpdates(collection, id, listener)`
 * and forward every payload through to their connected `EventSource`
 * clients.
 *
 * The bus is intentionally single-instance and in-memory:
 *
 *   - Self-hosted single-node deployments get push-to-iframe updates
 *     "for free" with zero extra infrastructure.
 *   - Multi-node deployments will see each node deliver only its own
 *     update events — fine for the Phase 2 finish-line. A future Slice
 *     can swap this for a Redis/postgres-listen backed bus without
 *     changing the public contract (`notifyPreviewUpdate` /
 *     `subscribePreviewUpdates`).
 *
 * The bus is keyed by `${collection}:${documentId}` so two simultaneously
 * open previews for different docs don't see each other's traffic.
 */
export interface PreviewUpdateEvent {
    collection: string;
    documentId: string;
    /** Free-form payload — the SSE handler stringifies it as the event data. */
    payload: Record<string, unknown>;
    /** Server-side emission timestamp; useful for clients to detect skew. */
    at: number;
}
export type PreviewUpdateListener = (event: PreviewUpdateEvent) => void;
export declare function subscribePreviewUpdates(collection: string, documentId: string, listener: PreviewUpdateListener): () => void;
export declare function notifyPreviewUpdate(collection: string, documentId: string, payload: Record<string, unknown>): void;
export declare function previewSubscriberCount(collection: string, documentId: string): number;
/**
 * Test helper. Drops every subscription. Production code never calls this.
 */
export declare function __resetPreviewEventBus(): void;
//# sourceMappingURL=event-bus.d.ts.map