UNPKG

lib-curses

Version:

Simple node.js library for work with console

12 lines (11 loc) 720 B
/** * Executes a given asynchronous callback function in a loop until callback returns false. * loop can include an optional pause between iterations. * * @param {function} callback - An asynchronous function that returns a boolean value. * Loop will continue executing as long as this function returns true. * @param {number} [milliseconds=0] - Amount of time to wait between each iteration of loop in milliseconds. * If set to 0, no delay will be applied. * @returns {Promise<void>} A promise that resolves when loop is exited. */ export declare function loop(callback: () => Promise<boolean> | boolean, milliseconds?: number): Promise<void>;