python2ib
Version:
Convert Python code to IB Pseudocode format
87 lines • 2.12 kB
TypeScript
/**
* Progress tracking utilities for large file processing
*/
export interface ProgressOptions {
total: number;
label?: string;
showPercentage?: boolean;
showETA?: boolean;
width?: number;
}
export declare class ProgressBar {
private options;
private current;
private startTime;
private lastUpdateTime;
private readonly updateInterval;
constructor(options: ProgressOptions);
/**
* Update progress
*/
update(current: number): void;
/**
* Increment progress by 1
*/
increment(): void;
/**
* Mark as complete
*/
complete(): void;
/**
* Render progress bar
*/
private render;
/**
* Format time in human readable format
*/
private formatTime;
}
/**
* Simple progress tracker for batch operations
*/
export declare class BatchProgress {
private total;
private onProgress?;
private completed;
private failed;
private progressBar;
constructor(total: number, onProgress?: ((completed: number, failed: number, total: number) => void) | undefined);
/**
* Mark one item as completed successfully
*/
success(): void;
/**
* Mark one item as failed
*/
failure(): void;
/**
* Update progress display
*/
private update;
/**
* Complete the progress tracking
*/
complete(): void;
/**
* Get current statistics
*/
getStats(): {
completed: number;
failed: number;
total: number;
percentage: number;
};
}
/**
* Create a progress bar for file processing
*/
export declare function createFileProgress(fileCount: number, label?: string): ProgressBar;
/**
* Create a progress bar for line processing
*/
export declare function createLineProgress(lineCount: number, filename?: string): ProgressBar;
/**
* Utility to track progress of async operations
*/
export declare function withProgress<T>(items: T[], processor: (item: T, index: number) => Promise<void>, options?: Partial<ProgressOptions>): Promise<void>;
//# sourceMappingURL=progress.d.ts.map