add deleteSelection command

This commit is contained in:
Philipp Kühn
2020-04-22 14:59:34 +02:00
parent 4cfadf7d7f
commit 8aca2852ba
3 changed files with 20 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
import { Editor } from '../Editor'
import { deleteSelection } from 'prosemirror-commands'
type DeleteSelection = () => any
declare module '../Editor' {
interface Editor {
deleteSelection: DeleteSelection,
}
}
export default (next: Function, { state, view }: Editor): DeleteSelection => () => {
deleteSelection(state, view.dispatch)
next()
}