"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DeflistSpecs = exports.defDescType = exports.defTermType = exports.defListType = exports.DeflistNode = void 0;
const tslib_1 = require("tslib");
const deflist_1 = tslib_1.__importDefault(require("@diplodoc/transform/lib/plugins/deflist"));
const schema_1 = require("../../../../utils/schema.js");
const const_1 = require("./const.js");
const parser_1 = require("./parser.js");
const schema_2 = require("./schema.js");
const serializer_1 = require("./serializer.js");
var const_2 = require("./const.js");
Object.defineProperty(exports, "DeflistNode", { enumerable: true, get: function () { return const_2.DeflistNode; } });
exports.defListType = (0, schema_1.nodeTypeFactory)(const_1.DeflistNode.List);
exports.defTermType = (0, schema_1.nodeTypeFactory)(const_1.DeflistNode.Term);
exports.defDescType = (0, schema_1.nodeTypeFactory)(const_1.DeflistNode.Desc);
const DeflistSpecs = (builder, opts) => {
    const schemaSpecs = (0, schema_2.getSchemaSpecs)(opts, builder.context.get('placeholder'));
    builder.configureMd((md) => md.use(deflist_1.default));
    builder
        .addNode(const_1.DeflistNode.List, () => ({
        spec: schemaSpecs[const_1.DeflistNode.List],
        fromMd: { tokenSpec: parser_1.parserTokens[const_1.DeflistNode.List] },
        toMd: serializer_1.serializerTokens[const_1.DeflistNode.List],
    }))
        .addNode(const_1.DeflistNode.Term, () => ({
        spec: schemaSpecs[const_1.DeflistNode.Term],
        fromMd: { tokenSpec: parser_1.parserTokens[const_1.DeflistNode.Term] },
        toMd: serializer_1.serializerTokens[const_1.DeflistNode.Term],
    }))
        .addNode(const_1.DeflistNode.Desc, () => ({
        spec: schemaSpecs[const_1.DeflistNode.Desc],
        fromMd: { tokenSpec: parser_1.parserTokens[const_1.DeflistNode.Desc] },
        toMd: serializer_1.serializerTokens[const_1.DeflistNode.Desc],
    }));
};
exports.DeflistSpecs = DeflistSpecs;
//# sourceMappingURL=index.js.map
