ipull
Version:
The only file downloader you'll ever need. For node.js and the browser, CLI and library for fast and reliable file downloads.
26 lines (25 loc) • 1.17 kB
TypeScript
import { TransferCliProgressBar } from "../progress-bars/base-transfer-cli-progress-bar.js";
import { FormattedStatus } from "../../format-transfer-status.js";
import cliSpinners from "cli-spinners";
export type MultiProgressBarOptions = {
maxViewDownloads: number;
createProgressBar: TransferCliProgressBar;
loadingAnimation: cliSpinners.SpinnerName;
};
export type CLIProgressPrintType = "update" | "log";
export declare class BaseMultiProgressBar {
protected options: MultiProgressBarOptions;
readonly updateIntervalMs: null | number;
readonly printType: CLIProgressPrintType;
constructor(options: MultiProgressBarOptions);
protected createProgresses(statuses: FormattedStatus[]): string;
/**
* Sorts the statuses by importance, active downloads first, then remaining, then finished (by end time - latest first)
*/
protected recorderStatusByImportance(statuses: FormattedStatus[]): {
notFinished: boolean;
remaining: number;
allStatusesSorted: FormattedStatus[];
};
createMultiProgressBar(statuses: FormattedStatus[], oneStatus: FormattedStatus, loadingDownloads?: number): string;
}