"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BaseCliMethodOptions = exports.BaseCLiWorkerStartParams = exports.BaseCLiWorkerStartMode = exports.BaseCliWorkerConfigGetContextOptions = void 0;
const lib_1 = require("taon/lib");
const lib_2 = require("tnp-core/lib");
class BaseCliWorkerConfigGetContextOptions {
}
exports.BaseCliWorkerConfigGetContextOptions = BaseCliWorkerConfigGetContextOptions;
/**
 * Default mode: DETACHED_CHILD_PROCESS
 */
var BaseCLiWorkerStartMode;
(function (BaseCLiWorkerStartMode) {
    BaseCLiWorkerStartMode["CHILD_PROCESS"] = "child";
    BaseCLiWorkerStartMode["IN_CURRENT_PROCESS"] = "process";
    BaseCLiWorkerStartMode["DETACHED_WINDOW"] = "window";
})(BaseCLiWorkerStartMode || (exports.BaseCLiWorkerStartMode = BaseCLiWorkerStartMode = {}));
class BaseCLiWorkerStartParams {
}
exports.BaseCLiWorkerStartParams = BaseCLiWorkerStartParams;
class BaseCliMethodOptions extends lib_1.TaonBaseClass {
    static from(opt) {
        opt = opt ?? {};
        opt.cliParams = opt.cliParams ?? {};
        opt.connectionOptions = opt.connectionOptions ?? {};
        const res = new BaseCliMethodOptions().clone(opt);
        res.cliParams = lib_2._.merge(new BaseCLiWorkerStartParams(), opt.cliParams);
        res.cliParams.mode =
            res.cliParams.mode || BaseCLiWorkerStartMode.CHILD_PROCESS;
        res.connectionOptions = lib_2._.merge(new BaseCliWorkerConfigGetContextOptions(), opt.connectionOptions);
        return res;
    }
}
exports.BaseCliMethodOptions = BaseCliMethodOptions;
//# sourceMappingURL=base-cli-worker.models.js.map