fix types

This commit is contained in:
Philipp Kühn
2020-10-30 17:43:59 +01:00
parent a56f396e02
commit a71221d8df
2 changed files with 6 additions and 1 deletions

View File

@@ -113,6 +113,7 @@ export default class ExtensionManager {
type: getSchemaTypeByName(extension.name, this.schema),
}
// @ts-ignore
const renderer = extension.addNodeView?.bind(context)?.() as NodeViewRenderer
const nodeview = (

View File

@@ -148,7 +148,11 @@ export interface NodeExtensionSpec<Options = {}, Commands = {}> extends Overwrit
/**
* Node View
*/
addNodeView?: (() => NodeViewRenderer) | null,
addNodeView?: ((this: {
options: Options,
editor: Editor,
type: NodeType,
}) => NodeViewRenderer) | null,
}> {}
export type NodeExtension = Required<Omit<NodeExtensionSpec, 'defaultOptions'> & {