"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleManagementOsRequests = handleManagementOsRequests;
const osCommands_1 = require("./osCommands");
function handleManagementOsRequests(onCommand, dispatch, frontApplet) {
    onCommand(async (commandEvent) => {
        switch (commandEvent.command.type) {
            case osCommands_1.ManagementOsGetInfoRequest:
                await dispatch({
                    type: osCommands_1.ManagementOsGetInfoResult,
                    result: await frontApplet.management.os.getInfo(),
                });
                break;
            case osCommands_1.ManagementOsGetCpuUsageRequest:
                await dispatch({
                    type: osCommands_1.ManagementOsGetCpuUsageResult,
                    result: await frontApplet.management.os.getCpuUsage(),
                });
                break;
            case osCommands_1.ManagementOsGetMemoryUsageRequest:
                await dispatch({
                    type: osCommands_1.ManagementOsGetMemoryUsageResult,
                    result: await frontApplet.management.os.getMemoryUsage(),
                });
                break;
            default:
        }
    });
}
//# sourceMappingURL=managementOsRequests.js.map