import deflistPlugin from '@diplodoc/transform/lib/plugins/deflist';
import { nodeTypeFactory } from "../../../../utils/schema.js";
import { DeflistNode } from "./const.js";
import { parserTokens } from "./parser.js";
import { getSchemaSpecs } from "./schema.js";
import { serializerTokens } from "./serializer.js";
export { DeflistNode } from "./const.js";
export const defListType = nodeTypeFactory(DeflistNode.List);
export const defTermType = nodeTypeFactory(DeflistNode.Term);
export const defDescType = nodeTypeFactory(DeflistNode.Desc);
export const DeflistSpecs = (builder, opts) => {
    const schemaSpecs = getSchemaSpecs(opts, builder.context.get('placeholder'));
    builder.configureMd((md) => md.use(deflistPlugin));
    builder
        .addNode(DeflistNode.List, () => ({
        spec: schemaSpecs[DeflistNode.List],
        fromMd: { tokenSpec: parserTokens[DeflistNode.List] },
        toMd: serializerTokens[DeflistNode.List],
    }))
        .addNode(DeflistNode.Term, () => ({
        spec: schemaSpecs[DeflistNode.Term],
        fromMd: { tokenSpec: parserTokens[DeflistNode.Term] },
        toMd: serializerTokens[DeflistNode.Term],
    }))
        .addNode(DeflistNode.Desc, () => ({
        spec: schemaSpecs[DeflistNode.Desc],
        fromMd: { tokenSpec: parserTokens[DeflistNode.Desc] },
        toMd: serializerTokens[DeflistNode.Desc],
    }));
};
//# sourceMappingURL=index.js.map
