import { NodeSpec, NodeType } from 'prosemirror-model' import Extension, { ExtensionMethods } from './Extension' import { Editor } from './Editor' export interface NodeProps { name: string editor: Editor options: Options type: NodeType } export interface NodeMethods extends ExtensionMethods { topNode: boolean schema: (params: Omit) => NodeSpec } export default class Node< Options = {}, Props = NodeProps, Methods extends NodeMethods = NodeMethods > extends Extension { type = 'node' public topNode(value: Methods['topNode'] = true) { this.storeConfig('topNode', value, 'overwrite') return this } public schema(value: Methods['schema']) { this.storeConfig('schema', value, 'overwrite') return this } }