mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-23 08:47:50 +08:00
21 lines
391 B
TypeScript
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,
|
||
|
}
|
||
|
}
|