refactoring

This commit is contained in:
Philipp Kühn
2021-02-10 18:05:02 +01:00
parent f70974678b
commit 55ff908423
69 changed files with 519 additions and 527 deletions

View File

@@ -8,7 +8,13 @@ export interface HistoryOptions {
declare module '@tiptap/core' {
interface Commands {
/**
* Undo recent changes
*/
undo: () => Command,
/**
* Reapply reverted changes
*/
redo: () => Command,
}
}
@@ -23,15 +29,9 @@ export const History = Extension.create({
addCommands() {
return {
/**
* Undo recent changes
*/
undo: () => ({ state, dispatch }) => {
return undo(state, dispatch)
},
/**
* Reapply reverted changes
*/
redo: () => ({ state, dispatch }) => {
return redo(state, dispatch)
},