UNPKG

kui-shell

Version:

This is the monorepo for Kui, the hybrid command-line/GUI electron-based Kubernetes tool

29 lines 1.08 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const electron_events_1 = require("@kui-shell/core/webapp/electron-events"); const core_1 = require("@kui-shell/core"); exports.default = (commandTree) => { commandTree.subtree('/window', { docs: 'Window sizing commands, e.g. "window max" and "window unmax"' }); commandTree.listen('/window/max', () => electron_events_1.tellMain('maximize-window'), { docs: 'Maximize the window', noAuthOk: true }); commandTree.listen('/window/unmax', () => electron_events_1.tellMain('unmaximize-window'), { docs: 'Unmaximize the window', noAuthOk: true }); commandTree.listen('/window/close', () => { if (core_1.Capabilities.inBrowser()) { throw new Error('Unsupported operation'); } else { const remote = require('electron').remote; const w = remote.getCurrentWindow(); w.close(); return true; } }, { noAuthOk: true }); }; //# sourceMappingURL=window.js.map