Skip to content
GitHub

prosekit/pm/history

Re-exports from prosemirror-history.

function closeHistory(tr: Transaction): Transaction

Set a flag on the given transaction that will prevent further steps from being appended to an existing history event (so that they require a separate undo command to undo).

function history(config?: HistoryOptions): ProseMirrorPlugin

Returns a plugin that enables the undo history for an editor. The plugin will track undo and redo stacks, which can be used with the undo and redo commands.

You can set an "addToHistory" metadata property of false on a transaction to prevent it from being rolled back by undo.

A command function that redoes the last undone change, if any.

function redo(state: EditorState, dispatch?: (tr: Transaction) => void, view?: EditorView): boolean
function redoDepth(state: EditorState): any

The amount of redoable events available in a given editor state.

A command function that redoes the last undone change. Don’t scroll the selection into view.

function redoNoScroll(state: EditorState, dispatch?: (tr: Transaction) => void, view?: EditorView): boolean

A command function that undoes the last change, if any.

function undo(state: EditorState, dispatch?: (tr: Transaction) => void, view?: EditorView): boolean
function undoDepth(state: EditorState): any

The amount of undoable events available in a given state.

A command function that undoes the last change. Don’t scroll the selection into view.

function undoNoScroll(state: EditorState, dispatch?: (tr: Transaction) => void, view?: EditorView): boolean