tiptap/packages/tiptap-core/src/commands/insertText.ts

13 lines
283 B
TypeScript
Raw Normal View History

2019-12-08 07:16:44 +08:00
import { Editor } from '../Editor'
declare module "../Editor" {
interface Editor {
insertText(text: string): Editor,
}
}
export default function insertText(next: Function, { state, view }: Editor, text: string): void {
view.dispatch(state.tr.insertText(text))
next()
}