IFClite TypeScript API
    Preparing search index...

    Function readWithProgress

    • Reads a successful response body to an ArrayBuffer, reporting progress through a provider's DownloadOptions.onProgress as the bytes arrive.

      The contract every caller can rely on:

      • received never decreases between two calls.
      • The first call is (0, total), before any byte arrives, so a host can tell "started" from "queued".
      • Intermediate calls are throttled to about 10 Hz (PROGRESS_INTERVAL_MS).
      • The last call is (byteLength, byteLength) for the buffer returned.

      total is the response's Content-Length when present and usable, else fallbackTotal (typically the listing's SourceFile.sizeBytes), else undefined, in which case the host shows an indeterminate state. A total the stream outgrows is dropped rather than reported below received.

      Without onProgress this is exactly response.arrayBuffer().

      Parameters

      • response: Response
      • onProgress: ((received: number, total?: number) => void) | undefined
      • OptionalfallbackTotal: number

      Returns Promise<ArrayBuffer>