mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-23 08:47:50 +08:00
20 lines
499 B
TypeScript
20 lines
499 B
TypeScript
|
import { deleteSelection as originalDeleteSelection } from 'prosemirror-commands'
|
||
|
import { Command } from '../Editor'
|
||
|
import { createExtension } from '../Extension'
|
||
|
|
||
|
export const DeleteSelection = createExtension({
|
||
|
addCommands() {
|
||
|
return {
|
||
|
deleteSelection: (): Command => ({ state, dispatch }) => {
|
||
|
return originalDeleteSelection(state, dispatch)
|
||
|
},
|
||
|
}
|
||
|
},
|
||
|
})
|
||
|
|
||
|
declare module '../Editor' {
|
||
|
interface AllExtensions {
|
||
|
DeleteSelection: typeof DeleteSelection,
|
||
|
}
|
||
|
}
|