// Derived from Node.js v24.16.0 (MIT; Copyright Node.js contributors, and Joyent, Inc. and // other Node contributors). See LICENSE-node. // node:readline, ported from Node v24 (see each module). node:readline/promises // (./promises.ts) rides the same Interface: node:readline's own `promises` property // is that module's exports object, as Node's is. import type { GuestProcess } from "../process"; import type { Timers } from "../timers"; import { clearLine, clearScreenDown, cursorTo, moveCursor } from "./callbacks"; import { makeEmitKeypressEvents } from "./emitKeypressEvents"; import { Interface, createInterface, installReadline } from "./interface"; import { createInterface as createInterfacePromises, Interface as InterfacePromises, Readline } from "./promises"; export function makeReadline(deps: { process: () => GuestProcess; timers: () => Timers }) { const emitKeypressEvents = makeEmitKeypressEvents(deps.timers); installReadline({ ...deps, emitKeypressEvents: emitKeypressEvents as never }); const promises = { Interface: InterfacePromises, Readline, createInterface: createInterfacePromises }; return { Interface, clearLine, clearScreenDown, createInterface, cursorTo, emitKeypressEvents, moveCursor, promises }; }