fix focus type

This commit is contained in:
Philipp Kühn
2020-08-14 15:03:03 +02:00
parent 82a1d695bb
commit b233e808c1

View File

@@ -3,11 +3,9 @@ import { TextSelection } from 'prosemirror-state'
import sleep from '../utils/sleep' import sleep from '../utils/sleep'
import minMax from '../utils/minMax' import minMax from '../utils/minMax'
type Focus = (position?: Position) => any
declare module '../Editor' { declare module '../Editor' {
interface Editor { interface Editor {
focus: Focus, focus(position?: Position): Editor,
} }
} }
@@ -45,7 +43,7 @@ function resolveSelection(editor: Editor, position: Position = null): ResolvedSe
} }
} }
export default (next: Function, editor: Editor): Focus => async (position = null) => { export default (next: Function, editor: Editor) => async (position = null) => {
const { view, state } = editor const { view, state } = editor
if ((view.hasFocus() && position === null)) { if ((view.hasFocus() && position === null)) {