tiptap/packages/core/src/commands/undoInputRule.ts

18 lines
442 B
TypeScript
Raw Normal View History

2021-01-06 20:02:30 +08:00
import { undoInputRule as originalUndoInputRule } from 'prosemirror-inputrules'
2021-02-10 16:59:35 +08:00
import { Command, Commands } from '../types'
2021-01-06 20:02:30 +08:00
2021-02-10 16:59:35 +08:00
declare module '@tiptap/core' {
2021-02-16 18:27:58 +08:00
interface AllCommands {
undoInputRule: {
/**
* Undo an input rule.
*/
undoInputRule: () => Command,
}
2021-02-10 16:59:35 +08:00
}
}
2021-02-11 01:05:02 +08:00
export const undoInputRule: Commands['undoInputRule'] = () => ({ state, dispatch }) => {
return originalUndoInputRule(state, dispatch)
}