"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
function _export(target, all) {
    for(var name in all)Object.defineProperty(target, name, {
        enumerable: true,
        get: all[name]
    });
}
_export(exports, {
    ServerTasks: function() {
        return ServerTasks;
    },
    registerTask: function() {
        return registerTask;
    }
});
const _taskpresets = require("./task.presets");
const _containertokens = require("./container.tokens");
function registerTask(task, preset, milliseconds = 0, runImmediately = false) {
    let timingPreset = {
        ...preset
    };
    timingPreset.milliseconds = preset.milliseconds || milliseconds;
    timingPreset.runImmediately = runImmediately || false;
    return {
        id: task.name || task,
        task,
        preset: timingPreset
    };
}
class ServerTasks {
    static SERVER_BOOT_TASK = registerTask(_containertokens.DITokens.bootTask, _taskpresets.TASK_PRESETS.PERIODIC_DISABLED, 5000, false);
    static BOOT_TASKS = [
        registerTask(_containertokens.DITokens.softwareUpdateTask, _taskpresets.TASK_PRESETS.RUNDELAYED, 1500),
        registerTask(_containertokens.DITokens.clientDistDownloadTask, _taskpresets.TASK_PRESETS.RUNONCE),
        registerTask(_containertokens.DITokens.socketIoTask, _taskpresets.TASK_PRESETS.PERIODIC, 500),
        registerTask(_containertokens.DITokens.printerFileCleanTask, _taskpresets.TASK_PRESETS.RUNONCE, 60 * 1000, true),
        registerTask(_containertokens.DITokens.printerWebsocketTask, _taskpresets.TASK_PRESETS.PERIODIC, 2000, true),
        registerTask(_containertokens.DITokens.printerWebsocketRestoreTask, _taskpresets.TASK_PRESETS.PERIODIC, 15 * 1000, false)
    ];
}

//# sourceMappingURL=tasks.js.map