/** * YjsPresenceManager - Manages presence signaling for collaborative editing. * * Responsibilities: * - Track which documents the user is viewing * - Signal focus/blur state to the server * - Track session state (active, participants) * - Provide callbacks for session state changes */ import type { DocumentKey, LiveEditingRetryConfig, SessionState, YjsTransport } from "./types.js"; interface PresenceManagerConfig { clientId: string; connId: string; liveEditingRetry?: Partial; } /** * Manages presence signaling for collaborative editing. */ export declare class YjsPresenceManager { private readonly presenceStates; private readonly config; private readonly liveEditingRetryConfig; private transport; private transportConnectionState; private unsubscribeTransportMessage; private unsubscribeTransportConnection; private readonly sessionStateCallbacks; constructor(config: PresenceManagerConfig); setTransport(transport: YjsTransport): void; /** * Start viewing a document. * This signals to the server that the user has opened the document. */ startViewing(docKey: DocumentKey): void; /** * Stop viewing a document. * This signals to the server that the user has closed the document. */ stopViewing(docKey: DocumentKey): void; /** * Signal that the user has focused the editor. * This indicates active editing intent. */ focus(docKey: DocumentKey): void; /** * Signal that the user has blurred the editor. * This indicates the user is no longer actively editing. */ blur(docKey: DocumentKey): void; isViewing(docKey: DocumentKey): boolean; isEditing(docKey: DocumentKey): boolean; getSessionState(docKey: DocumentKey): SessionState | null; onSessionStateChange(docKey: DocumentKey, callback: (state: SessionState) => void): () => void; cleanup(): void; private handleTransportConnectionStateChange; private replayActivePresenceState; private static clearRetryTimer; private static resetRetryState; private resetAllRetryState; private pruneSessionStateCallbacks; private schedulePresenceReplay; private sendDocView; private sendDocFocus; private handleMessage; private handleSessionState; private handleError; } export {}; //# sourceMappingURL=presence-manager.d.ts.map