tiptap/packages/core/src/extensions/insertText.ts
2020-10-23 10:44:30 +02:00

21 lines
391 B
TypeScript

import { Command } from '../Editor'
import { createExtension } from '../Extension'
export const InsertText = createExtension({
addCommands() {
return {
insertText: (value: string): Command => ({ tr }) => {
tr.insertText(value)
return true
},
}
},
})
declare module '../Editor' {
interface AllExtensions {
InsertText: typeof InsertText,
}
}