import { PluginSimple } from "markdown-it"; import { InputRule } from "prosemirror-inputrules"; import { NodeType, MarkType, Schema } from "prosemirror-model"; import { Command, Plugin } from "prosemirror-state"; import { Primitive } from "utility-types"; import { Editor } from "../../../app/editor"; export type CommandFactory = (attrs?: Record) => Command; export default class Extension { options: any; editor: Editor; constructor(options: Record = {}) { this.options = { ...this.defaultOptions, ...options, }; } bindEditor(editor: Editor) { this.editor = editor; } get type() { return "extension"; } get name() { return ""; } get plugins(): Plugin[] { return []; } get rulePlugins(): PluginSimple[] { return []; } get defaultOptions() { return {}; } get allowInReadOnly(): boolean { return false; } keys(_options: { type?: NodeType | MarkType; schema: Schema; }): Record { return {}; } inputRules(_options: { type?: NodeType | MarkType; schema: Schema; }): InputRule[] { return []; } commands(_options: { type?: NodeType | MarkType; schema: Schema; }): Record | CommandFactory | undefined { return {}; } }