/** * APIClaw MCP Auto-Setup - Spinner Utilities * * Ora-based spinner wrapper with consistent styling and state management. * Provides a fluent API for progress indication during CLI operations. */ import { Ora, Options as OraOptions } from 'ora'; export interface SpinnerOptions { /** Spinner text */ text?: string; /** Prefix text before spinner */ prefix?: string; /** Suffix text after spinner */ suffix?: string; /** Whether to show spinner in CI environments */ showInCI?: boolean; /** Custom spinner frames */ spinner?: OraOptions['spinner']; } export interface TaskSpinner { /** Start the spinner with optional text */ start(text?: string): TaskSpinner; /** Update spinner text */ text(text: string): TaskSpinner; /** Mark as successful with optional message */ succeed(text?: string): TaskSpinner; /** Mark as failed with optional message */ fail(text?: string): TaskSpinner; /** Mark as warning with optional message */ warn(text?: string): TaskSpinner; /** Show info message without stopping */ info(text?: string): TaskSpinner; /** Stop spinner without status */ stop(): TaskSpinner; /** Stop and clear spinner */ clear(): TaskSpinner; /** Check if spinner is currently spinning */ isSpinning(): boolean; /** Access underlying ora instance */ readonly ora: Ora; } /** * Create a task spinner with APIClaw styling */ export declare function createSpinner(options?: SpinnerOptions): TaskSpinner; /** * Convenience function for common spinner patterns */ export declare const spinner: { /** * Create and start a spinner in one call */ start(text: string): TaskSpinner; /** * Run an async task with spinner, auto-succeed/fail */ task(text: string, fn: (spinner: TaskSpinner) => Promise, options?: { successText?: string | ((result: T) => string); failText?: string | ((error: Error) => string); }): Promise; /** * Run multiple tasks in sequence with spinners */ sequence(tasks: Array<{ text: string; task: () => Promise; successText?: string; failText?: string; }>): Promise; }; /** * Progress tracker for multi-step operations */ export declare class ProgressTracker { private current; private readonly total; private readonly items; private readonly taskSpinner; constructor(items: string[]); /** * Start tracking progress */ start(): void; /** * Move to next item */ next(): void; /** * Mark current item as done and move to next */ done(message?: string): void; /** * Mark as complete */ complete(message: string): void; /** * Mark as failed */ fail(message: string): void; private updateText; private formatProgress; } /** * Silent spinner for non-interactive/CI environments * Logs plain text instead of animated spinners */ export declare function createSilentSpinner(options?: SpinnerOptions): TaskSpinner; /** * Get appropriate spinner based on environment */ export declare function getSpinner(options?: SpinnerOptions): TaskSpinner; //# sourceMappingURL=spinner.d.ts.map