"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
Object.defineProperty(exports, "__esModule", { value: true });
const publishDoc = require('./doc');
function publish(type) {
    return __awaiter(this, void 0, void 0, function* () {
        const publishHandler = {
            doc: publishDoc, // 处理文档生成
        };
        if (Object.prototype.hasOwnProperty.call(publishHandler, type)) {
            yield publishHandler[type]();
        }
    });
}
// 发布命令的核心逻辑
function execPublish(options) {
    return __awaiter(this, void 0, void 0, function* () {
        Object.keys(options).forEach((type) => __awaiter(this, void 0, void 0, function* () {
            yield publish(type);
        }));
    });
}
exports.default = execPublish;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9jb21tYW5kcy9wdWJsaXNoL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7O0FBQUEsTUFBTSxVQUFVLEdBQUcsT0FBTyxDQUFDLE9BQU8sQ0FBQyxDQUFBO0FBTW5DLFNBQWUsT0FBTyxDQUFDLElBQTBCOztRQUMvQyxNQUFNLGNBQWMsR0FBbUI7WUFDckMsR0FBRyxFQUFFLFVBQVUsRUFBRSxTQUFTO1NBQzNCLENBQUE7UUFDRCxJQUFJLE1BQU0sQ0FBQyxTQUFTLENBQUMsY0FBYyxDQUFDLElBQUksQ0FBQyxjQUFjLEVBQUUsSUFBSSxDQUFDLEVBQUU7WUFDOUQsTUFBTSxjQUFjLENBQUMsSUFBSSxDQUFDLEVBQUUsQ0FBQTtTQUM3QjtJQUNILENBQUM7Q0FBQTtBQUVELFlBQVk7QUFDWixTQUFlLFdBQVcsQ0FBQyxPQUFlOztRQUN4QyxNQUFNLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxDQUFDLE9BQU8sQ0FBQyxDQUFPLElBQUksRUFBRSxFQUFFO1lBQzFDLE1BQU0sT0FBTyxDQUFDLElBQTRCLENBQUMsQ0FBQTtRQUM3QyxDQUFDLENBQUEsQ0FBQyxDQUFBO0lBQ0osQ0FBQztDQUFBO0FBRUQsa0JBQWUsV0FBVyxDQUFBIn0=