Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...

    A unzipit Reader over HTTP, structurally typed so neither unzipit nor its types need to become a direct dependency.

    Index
    MAX_RETAINED_BYTES: number = ...

    Backstop so a pathological archive (a huge comment, a colossal directory) cannot balloon the heap. The preamble is ~141 kB at a thousand members and scales at ~70 B/member, so this holds a very large directory and still refuses to hold a whole archive.

    url: string
    lifetime?: AbortSignal

    Aborted when the owning store is disposed; cancels reads in flight.

    • Arm or disarm retention of fetched ranges.

      Armed by LuxarZipStore around the directory read and disarmed afterwards, so what survives is the archive's structure — not its data.

      Parameters

      • on: boolean

      Returns void

    • Record what a fresh HEAD already told us, so getLength does not repeat it. The identity probe and the length lookup ask the same question of the same URL; paying for it twice adds a serialised round trip to every load.

      Parameters

      • length: number

      Returns void

    • Fresh identity of the archive, bypassing every cache — ETag, else Last-Modified + Content-Length. null means "cannot tell", which is never evidence that the archive changed.

      Lives here rather than in the caller because it is a HEAD on this exact URL: doing it here lets the length it reports seed getLength.

      Parameters

      • Optionalsignal: AbortSignal
      • OptionaltimeoutMs: number

      Returns Promise<string | null>

    • Total archive size.

      Prefers HEAD, but falls back to a one-byte ranged GET when HEAD is rejected or answers without a usable Content-Length — some static hosts and signed-URL schemes allow only GET. The fallback doubles as an early probe: a host that answers it with 200 is telling us it ignores Range, and we would rather say so here than at the first chunk.

      Returns Promise<number>

    • Read size bytes at offset, insisting on a real partial response.

      Parameters

      • offset: number
      • size: number
      • Optionalsignal: AbortSignal

      Returns Promise<Uint8Array<ArrayBuffer>>