Skip to content

EditHistory

Defined in: extensions/commands/types.ts:36

EditHistory(editor, options): any

Defined in: extensions/commands/types.ts:36

PrismEditor<{ }>

EditorOptions<{ }>

any

clear(): void

Defined in: extensions/commands/types.ts:38

Clears the history stack.

void


go(offset): void

Defined in: extensions/commands/types.ts:49

Sets the active entry relative to the current entry.

number

The position you want to move to relative to the current entry.

EditHistory.go(-1) would be equivalent to an undo while EditHistory.go(1) would be equivalent to a redo.

If there’s no entry at the specified offset, the call does nothing.

void


has(offset): boolean

Defined in: extensions/commands/types.ts:57

Returns whether or not there exists a history entry at the specified offset relative to the current entry.

This method can be used to determine whether a call to EditHistory.go with the same offset will succeed or do nothing.

number

boolean