"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleDisplayRequests = handleDisplayRequests;
const displayCommands_1 = require("./displayCommands");
function handleDisplayRequests(onCommand, dispatch, frontApplet) {
    onCommand(async (commandEvent) => {
        switch (commandEvent.command.type) {
            case displayCommands_1.DisplaySupportsRequest:
                await dispatch({
                    type: displayCommands_1.DisplaySupportsResult,
                    supports: await frontApplet.display.supports(commandEvent.command.capability),
                });
                break;
            case displayCommands_1.DisplayGetCapabilitiesRequest:
                await dispatch({
                    type: displayCommands_1.DisplayGetCapabilitiesResult,
                    result: await frontApplet.display.getCapabilities(),
                });
                break;
            default:
        }
    });
}
//# sourceMappingURL=handleDisplayRequests.js.map