return editor for all core command types
This commit is contained in:
@@ -3,15 +3,15 @@ import { MarkType } from 'prosemirror-model'
|
||||
import getMarkType from '../utils/getMarkType'
|
||||
import getMarkRange from '../utils/getMarkRange'
|
||||
|
||||
type RemoveMark = (type: string | MarkType) => any
|
||||
type RemoveMarkCommand = (typeOrName: string | MarkType) => Editor
|
||||
|
||||
declare module '../Editor' {
|
||||
interface Editor {
|
||||
toggleMark: RemoveMark,
|
||||
toggleMark: RemoveMarkCommand,
|
||||
}
|
||||
}
|
||||
|
||||
export default (next: Function, editor: Editor): RemoveMark => typeOrName => {
|
||||
export default (next: Function, editor: Editor) => (typeOrName: string | MarkType) => {
|
||||
const { view, state, schema } = editor
|
||||
const { tr, selection } = state
|
||||
const type = getMarkType(typeOrName, schema)
|
||||
|
||||
Reference in New Issue
Block a user