import { Editor } from '../../core/Editor.js'; import { CommentInfo, CommentStatus, CommentTrackedChangeLink, StoryLocator, TextTarget, TrackChangeType } from '../../../../../../document-api/src/index.js'; export { buildCommentJsonFromText } from '../../utils/comment-content.js'; export interface CommentEntityRecord { commentId?: string; importedId?: string; parentCommentId?: string; commentText?: string; commentJSON?: unknown; elements?: unknown; isInternal?: boolean; isDone?: boolean; resolvedTime?: number | null; resolvedByEmail?: string | null; resolvedByName?: string | null; creatorName?: string; creatorEmail?: string; creatorImage?: string; createdTime?: number; trackedChange?: boolean; trackedChangeParentId?: string | null; trackedChangeType?: TrackChangeType | null; trackedChangeDisplayType?: string | null; trackedChangeStory?: StoryLocator | null; trackedChangeStoryKind?: string | null; trackedChangeStoryLabel?: string | null; trackedChangeAnchorKey?: string | null; trackedChangeText?: string | null; deletedText?: string | null; [key: string]: unknown; } export declare function getCommentEntityStore(editor: Editor): CommentEntityRecord[]; export declare function findCommentEntity(store: CommentEntityRecord[], commentId: string): CommentEntityRecord | undefined; export declare function upsertCommentEntity(store: CommentEntityRecord[], commentId: string, patch: Partial): CommentEntityRecord; export declare function removeCommentEntityTree(store: CommentEntityRecord[], commentId: string): CommentEntityRecord[]; export declare function stashRemovedCommentEntities(editor: Editor, removed: ReadonlyArray): void; export declare function restoreStashedCommentEntityTree(editor: Editor, rootCommentId: string): CommentEntityRecord[]; export declare function reconcileCommentEntityStoreWithAnchors(editor: Editor, anchoredCommentIds: Iterable): { restored: CommentEntityRecord[]; removed: CommentEntityRecord[]; }; export declare function extractCommentText(entry: CommentEntityRecord): string | undefined; export declare function isCommentResolved(entry: CommentEntityRecord): boolean; /** * Sync remote comment metadata from a collaboration channel (e.g. the Yjs * `ydoc.getArray('comments')` used by browser SuperDoc clients) into the * editor's CommentEntityStore. * * Without this sync, the headless SDK only sees PM-anchor-derived fields * (id, target, anchoredText, status) for browser-authored comments — the * Y.Array metadata (text, creatorName, creatorEmail, createdTime) never * reaches `doc.comments.list()`. See SD-3214. * * Behavior: * - Each entry with a `commentId` is upserted into the store. Existing * entries are merged (collaborator-authored fields override locally * captured ones; missing fields are left alone). * - Synthetic tracked-change projection rows are skipped — those belong to * the tracked-changes domain, not the comments store. Linked user * comments on tracked content are still synced. * - When `options.previouslySynced` is provided, any id present in the * prior set but absent from the current entries is treated as a remote * deletion and pruned via `removeCommentEntityTree`. Locally-authored * entries that were never collab-synced are left alone. * - Returns the set of commentIds observed during the sync. Callers should * pass this back as `previouslySynced` on the next call to detect * subsequent remote deletions. */ export declare function syncCommentEntitiesFromCollaboration(editor: Editor, entries: ReadonlyArray>, options?: { previouslySynced?: ReadonlySet; }): Set; export declare function toCommentInfo(entry: CommentEntityRecord, options?: { target?: TextTarget; status?: CommentStatus; anchoredText?: string; trackedChangeLink?: CommentTrackedChangeLink | null; }): CommentInfo; //# sourceMappingURL=comment-entity-store.d.ts.map