DocumentCompareSnapshot
The captured before-state of a document plus the metadata to reconcile changes later.
The snapshot is a plain object and is safe to JSON.stringify, send between the frontend and backend, store, parse,
and later feed back into DocumentCompare#computePatch.
Properties
channelId: stringmodule:ai/toolkit/documentsnapshot~DocumentCompareSnapshot#channelIdThe collaboration channel the snapshot was captured from.
content: Record<string, string>module:ai/toolkit/documentsnapshot~DocumentCompareSnapshot#contentEach root's content, serialized to HTML, keyed by root name (excluding
$graveyard).module:ai/toolkit/documentsnapshot~DocumentCompareSnapshot#editorConfigThe editor's feature configuration at capture time, so external processing can interpret the serialized HTML within the editor's capabilities.
selection: Record<string, Array<DocumentCompareSnapshotRange>>module:ai/toolkit/documentsnapshot~DocumentCompareSnapshot#selectionEach root's captured selection as character offsets into its HTML, keyed by root name (omitted if root has no selection).
sessionId: stringmodule:ai/toolkit/documentsnapshot~DocumentCompareSnapshot#sessionIdThe editing session the snapshot was captured in.
useDataIds: booleanmodule:ai/toolkit/documentsnapshot~DocumentCompareSnapshot#useDataIdsWhether the snapshot document data is stamped with
data-idattributes. If yes,data-ids are used to pair elements. If no, the elements are paired by their content instead.version: numbermodule:ai/toolkit/documentsnapshot~DocumentCompareSnapshot#versionThe document version the snapshot was captured at.