Skip to content

prosekit/extensions/commit

CommitRecorder

Constructors

new CommitRecorder()

new CommitRecorder(): CommitRecorder

Returns

CommitRecorder

Methods

commit()

commit(): null | Commit

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

Returns

null | Commit


Commit

A JSON representation of a commit.

Properties

doc

doc: NodeJSON

The current doc node in the JSON format

parent

parent: NodeJSON

The parent node in the JSON format

steps

steps: StepJSON[]

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


defineCommitRecorder()

defineCommitRecorder(commitRecorder): PlainExtension

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

Parameters

commitRecorder: CommitRecorder

Returns

PlainExtension


defineCommitViewer()

defineCommitViewer(commit): PlainExtension

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

Parameters

commit: Commit

Returns

PlainExtension