lib-curses
Version:
Simple node.js library for work with console
9 lines (8 loc) • 573 B
TypeScript
/**
* Prompts user for input, displaying an optional message, and applies a provided callback to input.
*
* @param {string} [printedString=''] - Message displayed to user when prompting for input.
* @param {function} [callback=(key) => key] - A callback function that processes user input before resolving promise. Defaults to an identity function that returns input unchanged.
* @returns {Promise<string>} A promise that resolves to processed user input.
*/
export declare function input(printedString?: string, callback?: (key: string) => string): Promise<string>;