Skip to content

prosekit/extensions/commit

CommitRecorder

constructor

new CommitRecorder(): CommitRecorder

commit

Return a commit object including all changes since the last commit. null will be returned if there is no change.

ts
const commit: () => null | Commit

Commit

A JSON representation of a commit.

doc: NodeJSON

The current doc node in the JSON format

parent: NodeJSON

The parent node in the JSON format

steps: StepJSON[]

An array of steps in the JSON format that transform the parent node to the current doc node.

defineCommitRecorder

ts
function defineCommitRecorder(commitRecorder: CommitRecorder): PlainExtension

Define an extension that can record the changes in the editor.

defineCommitViewer

ts
function defineCommitViewer(commit: Commit): PlainExtension

Define an extension to display the changes from the given commit in the editor.