tiptap/packages/core/src/extensions/insertText.ts

21 lines
391 B
TypeScript
Raw Normal View History

2020-10-23 16:44:30 +08:00
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,
}
}