tiptap/packages/core/src/commands/insertText.ts
2020-09-22 10:49:38 +02:00

16 lines
292 B
TypeScript

import { Command } from '../Editor'
type InsertTextCommand = (value: string) => Command
declare module '../Editor' {
interface Commands {
insertText: InsertTextCommand,
}
}
export const insertText: InsertTextCommand = value => ({ tr }) => {
tr.insertText(value)
return true
}