return editor for all core command types

This commit is contained in:
Philipp Kühn
2020-08-17 16:38:13 +02:00
parent 9ad1442bb6
commit 3c60bb6406
14 changed files with 49 additions and 47 deletions

View File

@@ -1,14 +1,14 @@
import { Editor } from '../Editor'
type RemoveMarks = () => any
type RemoveMarksCommand = () => Editor
declare module '../Editor' {
interface Editor {
removeMarks: RemoveMarks,
removeMarks: RemoveMarksCommand,
}
}
export default (next: Function, editor: Editor): RemoveMarks => () => {
export default (next: Function, editor: Editor) => () => {
const { state, view, schema } = editor
const { selection, tr } = state
const { from, to, empty } = selection