fix addKeyboardShortcuts type

This commit is contained in:
Philipp Kühn 2021-02-16 22:59:45 +01:00
parent c51081f34e
commit 96bb2e188d
3 changed files with 8 additions and 5 deletions

View File

@ -1,4 +1,5 @@
import { Plugin, Transaction } from 'prosemirror-state'
import { Command as ProseMirrorCommand } from 'prosemirror-commands'
import { InputRule } from 'prosemirror-inputrules'
import { Editor } from './Editor'
import mergeDeep from './utilities/mergeDeep'
@ -37,7 +38,7 @@ export interface ExtensionConfig<Options = any> {
options: Options,
editor: Editor,
}) => {
[key: string]: any
[key: string]: ProseMirrorCommand,
},
/**

View File

@ -5,6 +5,7 @@ import {
MarkType,
} from 'prosemirror-model'
import { Plugin, Transaction } from 'prosemirror-state'
import { Command as ProseMirrorCommand } from 'prosemirror-commands'
import { InputRule } from 'prosemirror-inputrules'
import { ExtensionConfig } from './Extension'
import mergeDeep from './utilities/mergeDeep'
@ -80,7 +81,7 @@ export interface MarkConfig<Options = any> extends Overwrite<ExtensionConfig<Opt
editor: Editor,
type: MarkType,
}) => {
[key: string]: any
[key: string]: ProseMirrorCommand,
},
/**

View File

@ -1,10 +1,10 @@
// @ts-nocheck
import {
DOMOutputSpec,
NodeSpec,
Node as ProseMirrorNode,
NodeType,
} from 'prosemirror-model'
import { Command as ProseMirrorCommand } from 'prosemirror-commands'
import { Plugin, Transaction } from 'prosemirror-state'
import { InputRule } from 'prosemirror-inputrules'
import { ExtensionConfig } from './Extension'
@ -138,8 +138,7 @@ export interface NodeConfig<Options = any> extends Overwrite<ExtensionConfig<Opt
editor: Editor,
type: NodeType,
}) => {
// [key: string]: any
[key: string]: () => boolean
[key: string]: ProseMirrorCommand,
},
/**
@ -292,6 +291,8 @@ export class Node<Options = any> {
onFocus: null,
onBlur: null,
onDestroy: null,
// TODO: remove,
tableRole: null,
}
options!: Options