/** * Subscription Management — Ref-counted channel subscriptions + event buffer replay. * * Manages daemon pub/sub subscriptions with reference counting so channels * are subscribed only when at least one client is viewing them. * Buffers recent events for delta-sync on reconnect. */ import type { AnyPhotonInfo } from '../types.js'; export interface SubscriptionManagerDeps { photons: AnyPhotonInfo[]; workingDir: string; } export declare class SubscriptionManager { private channelSubscriptions; private channelEventBuffers; private sessionViewState; private deps; constructor(deps: SubscriptionManagerDeps); /** Store an event in the channel buffer */ bufferEvent(channel: string, method: string, params: Record): number; /** Replay missed events to a session, or signal full sync needed */ replayEventsToSession(sessionId: string, channel: string, lastTimestamp?: number): { replayed: number; refreshNeeded: boolean; }; /** Subscribe to a channel (increment ref count, actually subscribe if first) */ subscribeToChannel(channel: string): Promise; /** Unsubscribe from a channel (decrement ref count, actually unsubscribe if last) */ unsubscribeFromChannel(channel: string): void; /** Called when a client starts viewing a board */ onClientViewingBoard(sessionId: string, photonId: string, itemId: string, lastTimestamp?: number): void; /** Called when a client disconnects */ onClientDisconnect(sessionId: string): void; } //# sourceMappingURL=subscription.d.ts.map