import type InteractiveManager from "./interactive/interactive-manager.d.ts"; export type ProgressBarStyle = "shades_classic" | "shades_grey" | "rect" | "filled" | "solid" | "ascii" | "custom"; export interface ProgressBarOptions { barCompleteChar?: string | string[]; barGlue?: string; barIncompleteChar?: string | string[]; current?: number; format?: string; fps?: number; style?: ProgressBarStyle; total: number; width?: number; } export interface SingleBarOptions extends ProgressBarOptions { format?: string; } export interface MultiBarOptions { barCompleteChar?: string | string[]; barGlue?: string; barIncompleteChar?: string | string[]; composite?: boolean; format?: string; fps?: number; style?: ProgressBarStyle; } export interface ProgressBarPayload { [key: string]: string | number | boolean; } /** * Gets the appropriate bar character based on style and completion state. * @param char Custom character override * @param style Progress bar style to use * @param complete Whether to get completed or incomplete character * @returns The appropriate character for the given style */ export declare const getBarChar: (char: string | undefined, style: ProgressBarStyle, complete?: boolean) => string; export declare const applyStyleToOptions: (options: T) => T; export declare class ProgressBar { protected options: ProgressBarOptions; protected current: number; private startTime; private interactiveManager?; private isActive; private payload?; /** * Creates a new progress bar instance. * @param options Configuration options for the progress bar * @param interactiveManager Optional interactive manager for rendering * @param payload Optional initial payload data for format placeholders */ constructor(options: ProgressBarOptions, interactiveManager?: InteractiveManager, payload?: ProgressBarPayload); /** * Updates the progress bar to a new value. * @param current The current progress value * @param payload Optional payload data to merge with existing data */ update(current: number, payload?: ProgressBarPayload): void; /** * Increments the progress bar by a specified step. * @param step Amount to increment (default: 1) * @param payload Optional payload data to merge with existing data */ increment(step?: number, payload?: ProgressBarPayload): void; /** * Renders the progress bar as a formatted string. * @returns Formatted progress bar string with all placeholders replaced */ render(): string; /** * Starts the progress bar. * @param total Optional total value to set * @param startValue Optional starting value * @param payload Optional initial payload data */ start(total?: number, startValue?: number, payload?: ProgressBarPayload): void; /** * Stops the progress bar and cleanup. */ stop(): void; private calculateETA; } export declare class MultiBarInstance extends ProgressBar { private multiBar; constructor(multiBar: MultiProgressBar, options: ProgressBarOptions, payload?: ProgressBarPayload); update(current: number, payload?: ProgressBarPayload): void; getBarState(): { char: string; current: number; total: number; }; } export declare class MultiProgressBar { private bars; private options; private interactiveManager?; private isActive; private nextBarId; private composite; private barColors; /** * Creates a new multi progress bar manager. * @param options Configuration options for the progress bars * @param interactiveManager Optional interactive manager for rendering */ constructor(options?: MultiBarOptions, interactiveManager?: InteractiveManager); /** * Creates a new progress bar within this multi-bar manager. * @param total Total value for the progress bar * @param current Starting current value (default: 0) * @param payload Optional initial payload data for format placeholders * @returns The created progress bar instance */ create(total: number, current?: number, payload?: ProgressBarPayload): ProgressBar; /** * Removes a progress bar from the manager. * @param bar The progress bar instance to remove * @returns True if the bar was removed, false if not found */ remove(bar: ProgressBar): boolean; /** * Renders all progress bars. */ renderAll(): void; /** * Sets or removes a color function for a specific bar. * @param bar The progress bar instance to color (must be from this MultiProgressBar) * @param color Color function or undefined to remove color */ setBarColor(bar: MultiBarInstance, color: ((text: string) => string) | undefined): void; /** * Stops all progress bars and cleanup. */ stop(): void; private renderComposite; private getCompositeChar; }