add Commands interface
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { Command, Range } from '../types'
|
||||
import { Command, Commands, Range } from '../types'
|
||||
|
||||
/**
|
||||
* Delete a given range.
|
||||
*/
|
||||
export const deleteRange = (range: Range): Command => ({ tr, dispatch }) => {
|
||||
export const deleteRange: Commands['deleteRange'] = range => ({ tr, dispatch }) => {
|
||||
const { from, to } = range
|
||||
|
||||
if (dispatch) {
|
||||
@@ -12,3 +12,9 @@ export const deleteRange = (range: Range): Command => ({ tr, dispatch }) => {
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands {
|
||||
deleteRange: (range: Range) => Command,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user