import log from '@diplodoc/transform/lib/log';
import yfmTable from '@diplodoc/transform/lib/plugins/table';
import { YfmTableNode } from "./const.js";
import { parserTokens } from "./parser.js";
import { getSchemaSpecs } from "./schema.js";
import { serializerTokens } from "./serializer.js";
export { YfmTableNode } from "./const.js";
export { yfmTableType, yfmTableBodyType, yfmTableRowType, yfmTableCellType } from "./utils.js";
export const YfmTableSpecs = (builder, options) => {
    const schemaSpecs = getSchemaSpecs(options, builder.context.get('placeholder'));
    builder
        .configureMd((md) => md.use(yfmTable, { log }))
        .addNode(YfmTableNode.Table, () => ({
        spec: schemaSpecs[YfmTableNode.Table],
        toMd: serializerTokens[YfmTableNode.Table],
        fromMd: { tokenSpec: parserTokens[YfmTableNode.Table] },
    }))
        .addNode(YfmTableNode.Body, () => ({
        spec: schemaSpecs[YfmTableNode.Body],
        toMd: serializerTokens[YfmTableNode.Body],
        fromMd: { tokenSpec: parserTokens[YfmTableNode.Body] },
    }))
        .addNode(YfmTableNode.Row, () => ({
        spec: schemaSpecs[YfmTableNode.Row],
        toMd: serializerTokens[YfmTableNode.Row],
        fromMd: { tokenSpec: parserTokens[YfmTableNode.Row] },
    }))
        .addNode(YfmTableNode.Cell, () => ({
        spec: schemaSpecs[YfmTableNode.Cell],
        toMd: serializerTokens[YfmTableNode.Cell],
        fromMd: { tokenSpec: parserTokens[YfmTableNode.Cell] },
    }));
};
//# sourceMappingURL=index.js.map
