add Commands interface
This commit is contained in:
@@ -1,12 +1,18 @@
|
||||
import { Command } from '../types'
|
||||
import { Command, Commands } from '../types'
|
||||
|
||||
/**
|
||||
* Scroll the selection into view.
|
||||
*/
|
||||
export const scrollIntoView = (): Command => ({ tr, dispatch }) => {
|
||||
export const scrollIntoView: Commands['scrollIntoView'] = () => ({ tr, dispatch }) => {
|
||||
if (dispatch) {
|
||||
tr.scrollIntoView()
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands {
|
||||
scrollIntoView: () => Command,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user