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

16 lines
424 B
TypeScript
Raw Normal View History

2021-01-06 20:02:30 +08:00
import { selectNodeBackward as originalSelectNodeBackward } from 'prosemirror-commands'
2021-02-10 16:59:35 +08:00
import { Command, Commands } from '../types'
2021-01-06 20:02:30 +08:00
/**
* Select a node backward.
*/
2021-02-10 16:59:35 +08:00
export const selectNodeBackward: Commands['selectNodeBackward'] = () => ({ state, dispatch }) => {
2021-01-06 20:02:30 +08:00
return originalSelectNodeBackward(state, dispatch)
}
2021-02-10 16:59:35 +08:00
declare module '@tiptap/core' {
interface Commands {
selectNodeBackward: () => Command,
}
}