/** * OpenCode-style Knight Rider Spinner * Accurate port from: https://github.com/sst/opencode/blob/dev/packages/opencode/src/cli/cmd/tui/ui/spinner.ts * * Features: * - Bidirectional sweep (left→right→left) * - Hold frames at each end (pause effect) * - Color gradient trail using ANSI 256 colors * - Same characters as OpenCode: ■ (active) / ⬝ (inactive) */ type ColorName = "cyan" | "green" | "magenta" | "yellow" | "red" | "blue" | "white"; interface SpinnerOptions { /** Width of the spinner in characters (default: 8) */ width?: number; /** Frames to hold at start position (default: 30) */ holdStart?: number; /** Frames to hold at end position (default: 9) */ holdEnd?: number; /** Trail length - number of colored blocks behind lead (default: 4) */ trailLength?: number; /** Color theme (default: "cyan") */ color?: ColorName; /** Frame interval in ms (default: 40) */ interval?: number; } export declare class Spinner { private intervalId; private frameIndex; private width; private holdStart; private holdEnd; private trailLength; private gradient; private interval; private message; private totalFrames; constructor(options?: SpinnerOptions); /** * Start the spinner with a message */ start(message: string): void; /** * Update the spinner message while running */ update(message: string): void; /** * Stop the spinner and show a success message */ success(message: string): void; /** * Stop the spinner and show an error message */ error(message: string): void; /** * Stop the spinner without a message */ stop(): void; /** * Check if spinner is currently running */ isSpinning(): boolean; } /** * Create a spinner with default OpenCode settings */ export declare function createSpinner(options?: SpinnerOptions): Spinner; /** * Run an async function with a spinner */ export declare function withSpinner(message: string, fn: () => Promise, options?: SpinnerOptions & { successMessage?: string; errorMessage?: string; }): Promise; export {}; //# sourceMappingURL=spinner.d.ts.map