"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SchemaSpecRegistry = void 0;
const prosemirror_model_1 = require("prosemirror-model");
class SchemaSpecRegistry {
    #spec;
    #dynamicModifier;
    constructor(topNode, dynamicModifier) {
        this.#spec = { topNode, nodes: {}, marks: {} };
        this.#dynamicModifier = dynamicModifier;
    }
    addNode(name, spec) {
        const modifiedSpec = this.#dynamicModifier
            ? this.#dynamicModifier.processNodeSpec(name, spec)
            : spec;
        this.#spec.nodes[name] = modifiedSpec;
        return this;
    }
    addMark(name, spec) {
        this.#spec.marks[name] = spec;
        return this;
    }
    createSchema() {
        return new prosemirror_model_1.Schema(this.#spec);
    }
}
exports.SchemaSpecRegistry = SchemaSpecRegistry;
//# sourceMappingURL=SchemaSpecRegistry.js.map
