@tiptap/core
Version:
headless rich text editor
20 lines (16 loc) • 529 B
text/typescript
import { selectParentNode as originalSelectParentNode } from '@tiptap/pm/commands'
import { RawCommands } from '../types.js'
declare module '@tiptap/core' {
interface Commands<ReturnType> {
selectParentNode: {
/**
* Select the parent node.
* @example editor.commands.selectParentNode()
*/
selectParentNode: () => ReturnType
}
}
}
export const selectParentNode: RawCommands['selectParentNode'] = () => ({ state, dispatch }) => {
return originalSelectParentNode(state, dispatch)
}