Skip to content
GitHubDiscord

prosekit/pm/history

Re-exports from prosemirror-history.

const redo: Command

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


const redoNoScroll: Command

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


const undo: Command

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


const undoNoScroll: Command

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

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.


function redoDepth(state: EditorState): any

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


function undoDepth(state: EditorState): any

The amount of undoable events available in a given state.