mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-06-11 11:45:15 +08:00
17 lines
394 B
TypeScript
17 lines
394 B
TypeScript
import { Command, RawCommands } from '../types'
|
|
|
|
declare module '@tiptap/core' {
|
|
interface Commands {
|
|
clearContent: {
|
|
/**
|
|
* Clear the whole document.
|
|
*/
|
|
clearContent: (emitUpdate: Boolean) => Command,
|
|
}
|
|
}
|
|
}
|
|
|
|
export const clearContent: RawCommands['clearContent'] = (emitUpdate = false) => ({ commands }) => {
|
|
return commands.setContent('', emitUpdate)
|
|
}
|