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

16 lines
421 B
TypeScript
Raw Normal View History

2020-11-18 23:43:27 +08:00
import { deleteSelection as originalDeleteSelection } from 'prosemirror-commands'
2021-02-10 16:59:35 +08:00
import { Command, Commands } from '../types'
2020-11-05 05:38:52 +08:00
2020-11-18 23:43:27 +08:00
/**
* Delete the selection, if there is one.
*/
2021-02-10 16:59:35 +08:00
export const deleteSelection: Commands['deleteSelection'] = () => ({ state, dispatch }) => {
2020-11-18 23:43:27 +08:00
return originalDeleteSelection(state, dispatch)
2020-11-05 05:38:52 +08:00
}
2021-02-10 16:59:35 +08:00
declare module '@tiptap/core' {
interface Commands {
deleteSelection: () => Command,
}
}