Skip to content

Interface: EditorSnapshot ​

Immutable view of the editor state for rendering UI.

Properties ​

PropertyModifierTypeDescription
blockreadonly{ attrs: Readonly<Record<string, unknown>>; type: string; }The text block that holds the selection head.
block.attrsreadonlyReadonly<Record<string, unknown>>Node attributes, e.g. level for a heading.
block.typereadonlystringNode type name, e.g. 'paragraph' or 'heading'.
canRedoreadonlybooleanWhether there is a step to redo.
canUndoreadonlybooleanWhether there is a step to undo.
editablereadonlybooleanWhether the user can edit.
emptyreadonlybooleanWhether the document is a single empty text block.
focusedreadonlybooleanWhether the editable area has focus.
marksreadonlyReadonlySet<string>Marks active at the selection, e.g. 'bold'.
selectionreadonly{ empty: boolean; from: number; to: number; }The current selection as document positions.
selection.emptyreadonlybooleanWhether the selection is a collapsed cursor.
selection.fromreadonlynumberStart position of the selection.
selection.toreadonlynumberEnd position of the selection.
versionreadonlynumberIncreases on every state change.