import SummaryManager from './summary-manager'; import { ProgressManagerOptions } from '../interfaces'; interface ProgressCallback { onModuleStart?: (moduleName: string) => void; onModuleComplete?: (moduleName: string, success: boolean, error?: string) => void; onProgress?: (moduleName: string, success: boolean, itemName: string, error?: string) => void; } export default class CLIProgressManager { private static globalSummary; private showConsoleLogs; private total; private moduleName; private enableNestedProgress; private successCount; private failureCount; private failures; private spinner; private progressBar; private processes; private multiBar; private currentProcess; private callbacks; private branchName; constructor({ showConsoleLogs, total, moduleName, enableNestedProgress, }?: ProgressManagerOptions); /** * Initialize global summary manager for the entire operation */ static initializeGlobalSummary(operationName: string, branchName: string, headerTitle?: string): SummaryManager; /** * Display operation header with branch information */ static displayOperationHeader(branchName: string, headerTitle?: string): void; /** * Print the final summary for all modules using strategies. * When showConsoleLogs is enabled, skip the Progress Manager summary block * so output is pure timestamped log lines (per documentation). */ static printGlobalSummary(): void; /** * Check if there are any failures in the global summary */ static hasFailures(): boolean; /** * Apply strategy-based corrections to module data */ private static applyStrategyCorrections; /** * Clear global summary (for cleanup) */ static clearGlobalSummary(): void; /** * Create a simple progress manager (no nested processes) */ static createSimple(moduleName: string, total?: number, showConsoleLogs?: boolean): CLIProgressManager; /** * Create a nested progress manager (with sub-processes) */ static createNested(moduleName: string, showConsoleLogs?: boolean): CLIProgressManager; /** * Show a loading spinner before initializing progress */ static withLoadingSpinner(message: string, asyncOperation: () => Promise): Promise; private setupGlobalSummaryIntegration; /** * Register process data with summary manager for strategy calculations */ private registerProcessDataWithSummary; /** * Set callbacks for external integration */ setCallbacks(callbacks: ProgressCallback): void; /** * Convert module name from UPPERCASE to PascalCase */ private formatModuleName; /** * Format process name with smart truncation (modules should use short names) */ private formatProcessName; /** * Format percentage for consistent alignment (always 3 characters) */ private formatPercentage; private initializeProgress; /** * Add a new process to track (for nested progress) */ addProcess(processName: string, total: number): this; /** * Update the total for a specific process (for dynamic totals after API calls) */ updateProcessTotal(processName: string, newTotal: number): this; /** * Start a specific process */ startProcess(processName: string): this; /** * Complete a specific process */ completeProcess(processName: string, success?: boolean): this; /** * Update status message */ updateStatus(message: string, processName?: string): this; /** * Update progress */ tick(success?: boolean, itemName?: string, errorMessage?: string | null, processName?: string): this; /** * Complete the entire module */ complete(success?: boolean, error?: string): this; /** * Log message (respects showConsoleLogs mode) */ log(msg: string): void; /** * Stop all progress indicators */ stop(): void; private printSummary; /** * Get the current failure count */ getFailureCount(): number; } export {};