tiptap/packages/core/src/extensions/deleteSelection.ts
Philipp Kühn 2c150f5192 refactoring
2020-10-27 12:37:00 +01:00

20 lines
464 B
TypeScript

import { deleteSelection } from 'prosemirror-commands'
import { Command } from '../Editor'
import { createExtension } from '../Extension'
export const DeleteSelection = createExtension({
addCommands() {
return {
deleteSelection: (): Command => ({ state, dispatch }) => {
return deleteSelection(state, dispatch)
},
}
},
})
declare module '../Editor' {
interface AllExtensions {
DeleteSelection: typeof DeleteSelection,
}
}