Files
outline/shared/editor/extensions/History.ts
Tom Moor bf45e97641 chore: Enforce type import consistency (#10968)
* Update types

* fix circular dep

* type imports

* lint type imports and --fix
2025-12-19 23:07:02 -05:00

32 lines
789 B
TypeScript

import { history, undo, redo } from "prosemirror-history";
import { undoInputRule } from "prosemirror-inputrules";
import type { Command } from "prosemirror-state";
import type { CommandFactory } from "../lib/Extension";
import Extension from "../lib/Extension";
export default class History extends Extension {
get name() {
return "history";
}
commands(): Record<string, CommandFactory> {
return {
undo: () => undo,
redo: () => redo,
};
}
keys(): Record<string, Command | CommandFactory> {
return {
"Mod-z": () => this.editor.commands.undo(),
"Mod-y": () => this.editor.commands.redo(),
"Shift-Mod-z": () => this.editor.commands.redo(),
Backspace: undoInputRule,
};
}
get plugins() {
return [history()];
}
}