Files
tiptap/packages/core/src/commands/clearContent.ts
2020-08-17 16:38:13 +02:00

15 lines
317 B
TypeScript

import { Editor } from '../Editor'
type ClearContentCommand = (emitUpdate?: Boolean) => Editor
declare module '../Editor' {
interface Editor {
clearContent: ClearContentCommand,
}
}
export default (next: Function, editor: Editor) => (emitUpdate = false) => {
editor.setContent('', emitUpdate)
next()
}