"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.YfmTableSpecs = exports.yfmTableCellType = exports.yfmTableRowType = exports.yfmTableBodyType = exports.yfmTableType = exports.YfmTableNode = void 0;
const tslib_1 = require("tslib");
const log_js_1 = tslib_1.__importDefault(require("@diplodoc/transform/lib/log.js"));
const index_js_1 = tslib_1.__importDefault(require("@diplodoc/transform/lib/plugins/table/index.js"));
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, "YfmTableNode", { enumerable: true, get: function () { return const_2.YfmTableNode; } });
var utils_1 = require("./utils.js");
Object.defineProperty(exports, "yfmTableType", { enumerable: true, get: function () { return utils_1.yfmTableType; } });
Object.defineProperty(exports, "yfmTableBodyType", { enumerable: true, get: function () { return utils_1.yfmTableBodyType; } });
Object.defineProperty(exports, "yfmTableRowType", { enumerable: true, get: function () { return utils_1.yfmTableRowType; } });
Object.defineProperty(exports, "yfmTableCellType", { enumerable: true, get: function () { return utils_1.yfmTableCellType; } });
const YfmTableSpecs = (builder, options) => {
    const schemaSpecs = (0, schema_1.getSchemaSpecs)(options, builder.context.get('placeholder'));
    builder
        .configureMd((md) => md.use(index_js_1.default, { log: log_js_1.default }))
        .addNode(const_1.YfmTableNode.Table, () => ({
        spec: schemaSpecs[const_1.YfmTableNode.Table],
        toMd: serializer_1.serializerTokens[const_1.YfmTableNode.Table],
        fromMd: { tokenSpec: parser_1.parserTokens[const_1.YfmTableNode.Table] },
    }))
        .addNode(const_1.YfmTableNode.Body, () => ({
        spec: schemaSpecs[const_1.YfmTableNode.Body],
        toMd: serializer_1.serializerTokens[const_1.YfmTableNode.Body],
        fromMd: { tokenSpec: parser_1.parserTokens[const_1.YfmTableNode.Body] },
    }))
        .addNode(const_1.YfmTableNode.Row, () => ({
        spec: schemaSpecs[const_1.YfmTableNode.Row],
        toMd: serializer_1.serializerTokens[const_1.YfmTableNode.Row],
        fromMd: { tokenSpec: parser_1.parserTokens[const_1.YfmTableNode.Row] },
    }))
        .addNode(const_1.YfmTableNode.Cell, () => ({
        spec: schemaSpecs[const_1.YfmTableNode.Cell],
        toMd: serializer_1.serializerTokens[const_1.YfmTableNode.Cell],
        fromMd: { tokenSpec: parser_1.parserTokens[const_1.YfmTableNode.Cell] },
    }));
};
exports.YfmTableSpecs = YfmTableSpecs;
//# sourceMappingURL=index.js.map
