mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-23 08:47:50 +08:00
19 lines
420 B
TypeScript
19 lines
420 B
TypeScript
|
import { Command } from '../Editor'
|
||
|
import { createExtension } from '../Extension'
|
||
|
|
||
|
export const ClearContent = createExtension({
|
||
|
addCommands() {
|
||
|
return {
|
||
|
clearContent: (emitUpdate: Boolean = false): Command => ({ commands }) => {
|
||
|
return commands.setContent('', emitUpdate)
|
||
|
},
|
||
|
}
|
||
|
},
|
||
|
})
|
||
|
|
||
|
declare module '../Editor' {
|
||
|
interface AllExtensions {
|
||
|
ClearContent: typeof ClearContent,
|
||
|
}
|
||
|
}
|