@ipp/cli
Version:
An image build orchestrator for the modern web
29 lines (28 loc) • 1.07 kB
JavaScript
;
/**
* Image Processing Pipeline - Copyright (c) Marcus Cemes
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.DynamicUI = void 0;
const ink_1 = require("ink");
const react_1 = __importDefault(require("react"));
const Summary_1 = require("./Summary");
const View_1 = require("./View");
// const enterAltScreenBuffer = "\x1b[?1049h";
// const exitAltScreenBuffer = "\x1b[?1049l";
const DynamicUI = (ctx) => {
const ui = (0, ink_1.render)(react_1.default.createElement(View_1.View, { observable: ctx.state }), { exitOnCtrlC: true });
return {
stop: async (state) => {
ui.rerender(react_1.default.createElement(Summary_1.Summary, { state: state }));
await ui.waitUntilExit();
},
};
};
exports.DynamicUI = DynamicUI;