Skip to content

narrateWait

narrateWait<T>(activity, emit, work, options?): Promise<T>

Defined in: packages/core/src/core/waitNarration.ts:167

Run work, and if it has not settled within the threshold, say once what is being waited on.

emit is the surface’s status callback, so the signal reaches whatever that surface already does with an StatusLevel.INFO line — displayInfo on the plain surfaces, and on the Ink TUI the status-bar routing described in this module’s header.

The timer is armed before work is called and disarmed in finally, so the three ways a wait can end — resolve, reject, and the caller’s own timeout racing it — all disarm it, and a rejected wait cannot leave a live handle behind holding the process open. An emit that throws is swallowed: narrating a wait is commentary, and commentary is never allowed to be the thing that fails the operation it was describing.

T

"rating"

(level, message) => void

() => Promise<T>

number

number

Promise<T>