# DocumentCompareSnapshot

interface

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`.

<a id="properties"></a>

## Properties

<a id="member-channelId"></a>

### `channelId: string`

The collaboration channel the snapshot was captured from.

<a id="member-content"></a>

### `content: Record<string, string>`

Each root's content, serialized to HTML, keyed by root name (excluding `$graveyard`).

<a id="member-editorConfig"></a>

### `editorConfig: AIEditorConfigSnapshot`

The editor's feature configuration at capture time, so external processing can interpret the serialized HTML within the editor's capabilities.

<a id="member-selection"></a>

### `selection: Record<string, Array<DocumentCompareSnapshotRange>>`

Each root's captured selection as character offsets into its HTML, keyed by root name (omitted if root has no selection).

<a id="member-sessionId"></a>

### `sessionId: string`

The editing session the snapshot was captured in.

<a id="member-useDataIds"></a>

### `useDataIds: boolean`

Whether the snapshot document data is stamped with `data-id` attributes. If yes, `data-id`s are used to pair elements. If no, the elements are paired by their content instead.

<a id="member-version"></a>

### `version: number`

The document version the snapshot was captured at.

---

Full index of the CKEditor 5 API reference: [llms.txt](llms.txt)
