@tiptap/core
Version:
headless rich text editor
22 lines (18 loc) • 549 B
text/typescript
import { deleteSelection as originalDeleteSelection } from '@tiptap/pm/commands'
import type { RawCommands } from '../types.js'
declare module '@tiptap/core' {
interface Commands<ReturnType> {
deleteSelection: {
/**
* Delete the selection, if there is one.
* @example editor.commands.deleteSelection()
*/
deleteSelection: () => ReturnType
}
}
}
export const deleteSelection: RawCommands['deleteSelection'] =
() =>
({ state, dispatch }) => {
return originalDeleteSelection(state, dispatch)
}