SpinnerHandle
Handle returned by Out.spinner for lifecycle control.
Terminal methods (succeed, fail, stop) are idempotent — calling any of them after the handle is already stopped is a no-op, not an error.
- Import:
@kjanat/dreamcli - Export kind: interface
- Declared in:
src/core/schema/activity.ts - Source link:
src/core/schema/activity.ts:41
Signatures
ts
interface SpinnerHandle {}Members
Methods
update
Update the spinner text (no-op if stopped).
ts
update(text: string): void;succeed
Stop with a success symbol and optional final text.
ts
succeed(text?: string): void;fail
Stop with a failure symbol and optional final text.
ts
fail(text?: string): void;stop
Stop the spinner without a status symbol.
ts
stop(): void;wrap
Wrap a promise: auto-succeed on resolve, auto-fail on reject.
ts
wrap<T>(promise: Promise<T>, options?: { succeed?: string | { (value: T): string; }; fail?: string | { (error: unknown): string; }; }): Promise<T>;