17 lines
401 B
TypeScript
17 lines
401 B
TypeScript
import { RawCommands } from '../types'
|
|
|
|
declare module '@tiptap/core' {
|
|
interface Commands<ReturnType> {
|
|
clearContent: {
|
|
/**
|
|
* Clear the whole document.
|
|
*/
|
|
clearContent: (emitUpdate?: boolean) => ReturnType,
|
|
}
|
|
}
|
|
}
|
|
|
|
export const clearContent: RawCommands['clearContent'] = (emitUpdate = false) => ({ commands }) => {
|
|
return commands.setContent('', emitUpdate)
|
|
}
|