This repository has been archived on 2026-03-06. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
openclaw-extensions/wecom/node_modules/ipull/dist/download/transfer-visualize/progress-statistics-builder.d.ts
T

37 lines
1.5 KiB
TypeScript

import BaseDownloadEngine from "../download-engine/engine/base-download-engine.js";
import { EventEmitter } from "eventemitter3";
import { FormattedStatus } from "./format-transfer-status.js";
import DownloadEngineFile from "../download-engine/download-file/download-engine-file.js";
import { DownloadStatus } from "../download-engine/download-file/progress-status-file.js";
import DownloadEngineMultiDownload from "../download-engine/engine/download-engine-multi-download.js";
export type ProgressStatusWithIndex = FormattedStatus & {
index: number;
};
interface CliProgressBuilderEvents {
progress: (progress: ProgressStatusWithIndex) => void;
}
export type AnyEngine = DownloadEngineFile | BaseDownloadEngine | DownloadEngineMultiDownload;
export default class ProgressStatisticsBuilder extends EventEmitter<CliProgressBuilderEvents> {
private _engines;
private _activeTransfers;
private _totalBytes;
private _transferredBytes;
private _activeDownloadPart;
private _startTime;
private _statistics;
private _lastStatus?;
downloadStatus: DownloadStatus;
get totalBytes(): number;
get transferredBytesWithActiveTransfers(): number;
get status(): ProgressStatusWithIndex | undefined;
/**
* Add engines to the progress statistics builder, will only add engines once
*/
add(...engines: AnyEngine[]): void;
private _initEvents;
private _sendProgress;
static oneStatistics(engine: DownloadEngineFile): FormattedStatus;
static loadingStatusEmptyStatistics(): FormattedStatus;
}
export {};