rename package folders
This commit is contained in:
15
packages/core/src/commands/insertText.ts
Normal file
15
packages/core/src/commands/insertText.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { Editor } from '../Editor'
|
||||
|
||||
declare module '../Editor' {
|
||||
interface Editor {
|
||||
insertText(value: string): Editor,
|
||||
}
|
||||
}
|
||||
|
||||
export default function insertText(next: Function, editor: Editor, value: string): void {
|
||||
const { view, state } = editor
|
||||
const transaction = state.tr.insertText(value)
|
||||
|
||||
view.dispatch(transaction)
|
||||
next()
|
||||
}
|
||||
Reference in New Issue
Block a user