"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.serializerTokens = void 0;
const const_1 = require("../const.js");
exports.serializerTokens = {
    [const_1.TableNode.Table]: (state, node) => {
        state.ensureNewLine();
        state.write('\n');
        state.setNoAutoBlank();
        state.renderContent(node);
        state.unsetNoAutoBlank();
        state.ensureNewLine();
        state.closeBlock(node);
    },
    [const_1.TableNode.Head]: (state, node) => {
        state.renderContent(node);
        for (const cellNode of node.content.content[0].content.content) {
            switch (cellNode.attrs[const_1.TableAttrs.CellAlign]) {
                case const_1.CellAlign.Left:
                    state.write('|:---');
                    break;
                case const_1.CellAlign.Center:
                    state.write('|:---:');
                    break;
                case const_1.CellAlign.Right:
                    state.write('|---:');
                    break;
                default:
                    state.write('|---');
                    break;
            }
        }
        state.write('|');
        state.ensureNewLine();
        state.closeBlock(node);
    },
    [const_1.TableNode.Body]: (state, node) => {
        state.renderContent(node);
        state.closeBlock(node);
    },
    [const_1.TableNode.Row]: (state, node) => {
        state.renderContent(node);
        state.closeBlock(node);
        state.write('|');
        state.ensureNewLine();
    },
    [const_1.TableNode.HeaderCell]: (state, node) => {
        state.write('|');
        state.renderInline(node);
        state.closeBlock(node);
    },
    [const_1.TableNode.DataCell]: (state, node) => {
        state.write('|');
        state.renderInline(node);
        state.closeBlock(node);
    },
};
//# sourceMappingURL=serializer.js.map
