"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.YfmNoteSpecs = exports.noteTitleType = exports.noteType = exports.YfmNoteNode = void 0;
const tslib_1 = require("tslib");
const log_1 = tslib_1.__importDefault(require("@diplodoc/transform/lib/log"));
const notes_1 = tslib_1.__importDefault(require("@diplodoc/transform/lib/plugins/notes"));
const const_1 = require("./const.js");
const parser_1 = require("./parser.js");
const schema_1 = require("./schema.js");
const serializer_1 = require("./serializer.js");
var const_2 = require("./const.js");
Object.defineProperty(exports, "YfmNoteNode", { enumerable: true, get: function () { return const_2.NoteNode; } });
var utils_1 = require("./utils.js");
Object.defineProperty(exports, "noteType", { enumerable: true, get: function () { return utils_1.noteType; } });
Object.defineProperty(exports, "noteTitleType", { enumerable: true, get: function () { return utils_1.noteTitleType; } });
const YfmNoteSpecs = (builder, opts) => {
    const schemaSpecs = (0, schema_1.getSchemaSpecs)(opts, builder.context.get('placeholder'));
    builder
        .configureMd((md) => md.use(notes_1.default, { log: log_1.default }))
        .addNode(const_1.NoteNode.Note, () => ({
        spec: schemaSpecs[const_1.NoteNode.Note],
        toMd: serializer_1.serializerTokens[const_1.NoteNode.Note],
        fromMd: {
            tokenSpec: parser_1.parserTokens[const_1.NoteNode.Note],
        },
    }))
        .addNode(const_1.NoteNode.NoteTitle, () => ({
        spec: schemaSpecs[const_1.NoteNode.NoteTitle],
        toMd: serializer_1.serializerTokens[const_1.NoteNode.NoteTitle],
        fromMd: {
            tokenSpec: parser_1.parserTokens[const_1.NoteNode.NoteTitle],
        },
    }))
        .addNode(const_1.NoteNode.NoteContent, () => ({
        spec: schemaSpecs[const_1.NoteNode.NoteContent],
        toMd: serializer_1.serializerTokens[const_1.NoteNode.NoteContent],
        fromMd: {
            tokenSpec: parser_1.parserTokens[const_1.NoteNode.NoteContent],
        },
    }));
};
exports.YfmNoteSpecs = YfmNoteSpecs;
//# sourceMappingURL=index.js.map
