"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.__tsfTypeAliases = exports.onServerShutdown = exports.onServerShutdownRequested = exports.onServerMainBootstrapDone = exports.onServerBootstrap = exports.onAppBootstrap = void 0;
exports.AutoConstruct = AutoConstruct;
exports.isAutoConstructProvider = isAutoConstructProvider;
const events_1 = require("../events");
exports.onAppBootstrap = new events_1.EventToken('app.bootstrap');
exports.onServerBootstrap = new events_1.EventToken('server.bootstrap');
exports.onServerMainBootstrapDone = new events_1.EventToken('server.main-bootstrap-done');
exports.onServerShutdownRequested = new events_1.EventToken('server.shutdown-requested');
exports.onServerShutdown = new events_1.EventToken('server.shutdown');
const AutoConstructSymbol = Symbol('AutoConstruct');
function AutoConstruct(options = {}) {
    return target => {
        target[AutoConstructSymbol] = {
            cli: options.cli === true
        };
    };
}
function isAutoConstructProvider(value, options = {}) {
    if (typeof value !== 'function')
        return false;
    const metadata = value[AutoConstructSymbol];
    return !!metadata && (options.cli !== true || metadata.cli);
}
exports.__tsfTypeAliases = JSON.parse("[1,{\"AutoConstructOptions\":{\"kind\":18,\"typeName\":\"AutoConstructOptions\",\"types\":[{\"kind\":20,\"name\":\"cli\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true}]}}]")[1];
//# sourceMappingURL=lifecycle.js.map