UNPKG

ccexp

Version:

CLI tool for exploring and managing Claude Code settings and slash commands

78 lines (76 loc) 1.52 kB
import { render as render$1 } from "ink"; import { EventEmitter } from "node:events"; //#region node_modules/ink-testing-library/build/index.js var Stdout = class extends EventEmitter { get columns() { return 100; } frames = []; _lastFrame; write = (frame) => { this.frames.push(frame); this._lastFrame = frame; }; lastFrame = () => this._lastFrame; }; var Stderr = class extends EventEmitter { frames = []; _lastFrame; write = (frame) => { this.frames.push(frame); this._lastFrame = frame; }; lastFrame = () => this._lastFrame; }; var Stdin = class extends EventEmitter { isTTY = true; data = null; constructor(options = {}) { super(); this.isTTY = options.isTTY ?? true; } write = (data) => { this.data = data; this.emit("readable"); this.emit("data", data); }; setEncoding() {} setRawMode() {} resume() {} pause() {} ref() {} unref() {} read = () => { const { data } = this; this.data = null; return data; }; }; const instances = []; const render = (tree) => { const stdout = new Stdout(); const stderr = new Stderr(); const stdin = new Stdin(); const instance = render$1(tree, { stdout, stderr, stdin, debug: true, exitOnCtrlC: false, patchConsole: false }); instances.push(instance); return { rerender: instance.rerender, unmount: instance.unmount, cleanup: instance.cleanup, stdout, stderr, stdin, frames: stdout.frames, lastFrame: stdout.lastFrame }; }; //#endregion export { render }; //# sourceMappingURL=build-BLDJginc.js.map