Sign up (with export icon)

DocumentCompareSnapshot

Api-interface iconinterface

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

  • Chevron-right icon

    channelId: string

    The collaboration channel the snapshot was captured from.

  • Chevron-right icon

    content: Record<string, string>

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

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

  • Chevron-right icon

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

  • Chevron-right icon

    sessionId: string

    The editing session the snapshot was captured in.

  • Chevron-right icon

    useDataIds: boolean

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

  • Chevron-right icon

    version: number

    The document version the snapshot was captured at.