picgo
Version:
A tool for image uploading
12 lines (11 loc) • 562 B
TypeScript
/**
* Render a fixed 20-character progress bar (`█████░░░░░`).
*
* - `total <= 0` returns all-empty (`░ × 20`); the caller is responsible for any N/A label.
* - `current >= total` returns all-filled (`█ × 20`); never overflows.
* - Intermediate states round to the nearest cell based on `current / total`.
*
* Pure function with no external state — shared across the CLI (import progress, file
* upload progress, future progress events).
*/
export declare const renderProgressBar: (current: number, total: number) => string;