/**
 * Progress Tracker
 *
 * Tracks progress for long-running operations and provides
 * utilities for calculating and reporting progress.
 */
import { EventEmitter } from 'events';
/**
 * Progress stage
 */
export interface ProgressStage {
    /** Stage name */
    name: string;
    /** Stage weight (for total progress calculation) */
    weight: number;
    /** Current progress within stage (0-100) */
    progress: number;
    /** Stage status */
    status: 'pending' | 'active' | 'completed' | 'failed';
    /** Optional message */
    message?: string;
}
/**
 * Progress update
 */
export interface ProgressUpdate {
    /** Overall progress (0-100) */
    totalProgress: number;
    /** Current stage name */
    currentStage: string;
    /** Current stage progress (0-100) */
    stageProgress: number;
    /** Status message */
    message: string;
    /** Estimated time remaining in milliseconds */
    estimatedTimeRemaining?: number;
    /** Elapsed time in milliseconds */
    elapsedTime: number;
}
/**
 * Progress tracker configuration
 */
export interface ProgressTrackerConfig {
    /** Stages to track */
    stages: Array<{
        name: string;
        weight: number;
    }>;
    /** Whether to estimate time remaining */
    estimateTime: boolean;
    /** Minimum progress update interval in milliseconds */
    updateIntervalMs: number;
}
/**
 * Tracks progress across multiple stages
 */
export declare class ProgressTracker extends EventEmitter {
    private stages;
    private stageOrder;
    private currentStageIndex;
    private startTime;
    private lastUpdate;
    private config;
    private progressHistory;
    constructor(config?: Partial<ProgressTrackerConfig>);
    /**
     * Initialize stages from config
     */
    private initializeStages;
    /**
     * Start tracking
     */
    start(): void;
    /**
     * Update progress for current or specified stage
     */
    updateProgress(progress: number, stageName?: string, message?: string): void;
    /**
     * Complete current stage and move to next
     */
    completeStage(stageName?: string): void;
    /**
     * Mark stage as failed
     */
    failStage(stageName?: string, message?: string): void;
    /**
     * Calculate total progress across all stages
     */
    calculateTotalProgress(): number;
    /**
     * Estimate time remaining
     */
    estimateTimeRemaining(): number | undefined;
    /**
     * Get current progress update
     */
    getUpdate(): ProgressUpdate;
    /**
     * Emit progress update event
     */
    private emitUpdate;
    /**
     * Get all stages
     */
    getStages(): ProgressStage[];
    /**
     * Reset tracker
     */
    reset(): void;
    /**
     * Check if all stages are completed
     */
    isCompleted(): boolean;
    /**
     * Check if any stage has failed
     */
    hasFailed(): boolean;
}
/**
 * Create a simple progress tracker for single operations
 */
export declare function createSimpleTracker(onProgress?: (progress: number, message?: string) => void): {
    update: (progress: number, message?: string) => void;
    complete: () => void;
    fail: (message?: string) => void;
};
/**
 * Calculate progress for iterating over items
 */
export declare function calculateIterationProgress(current: number, total: number, baseProgress?: number, maxProgress?: number): number;
