kinetex - v1.0.0-rc.1
    Preparing search index...

    Class ProgressTracker

    Tracks byte-level progress for uploads and downloads.

    Provides real-time snapshots of loaded bytes, transfer rate (EMA-smoothed), ETA, elapsed time, and completion status. Supports throttled callbacks, pause/resume semantics, and AbortSignal integration.

    const tracker = new ProgressTracker(1_000_000, {
    onProgress: (snap) => console.log(`${snap.percent}%`),
    });
    tracker.update(512_000);
    tracker.complete();
    Index

    Constructors

    Accessors

    Methods

    Constructors

    Accessors

    • get bytesLoaded(): number

      Total number of bytes transferred so far.

      Returns number

    • get isDone(): boolean

      Whether the transfer has been marked complete.

      Returns boolean

    Methods

    • Record a new chunk of bytes transferred.

      Parameters

      • bytes: number

        Number of bytes received/sent in this chunk (ADDED to running total)

      Returns ProgressSnapshot

      Current progress snapshot

      tracker.update(1024);  // loaded = 1024
      tracker.update(2048); // loaded = 3072
    • Mark transfer as complete. Emits final snapshot regardless of throttle.

      Returns ProgressSnapshot

    • Get current snapshot without updating.

      Returns ProgressSnapshot