import type { XlsxSource } from '../io/source'; import type { DecompressionLimits } from './decompression-guard'; export interface ZipArchive { /** Sorted list of all entry paths in the archive. */ list(): string[]; /** Synchronous read; throws OpenXmlIoError when the path is unknown. */ read(path: string): Uint8Array; /** Promise variant for symmetry with the future streaming reader. */ readAsync(path: string): Promise; /** * Streaming read: returns the entry's inflated bytes as a Web * `ReadableStream` chunk-by-chunk. Lets callers (the streaming * worksheet iterator, in particular) push the inflated payload through a SAX * parser without first materialising it in full — peak memory for a sheet * walk drops to the inflate window + SAX state instead of the entire * uncompressed worksheet body. Throws OpenXmlIoError when the path is * unknown. */ readStream(path: string): ReadableStream; /** Whether the archive holds an entry at the given path. */ has(path: string): boolean; /** Release the in-memory entry table. Subsequent reads throw. */ close(): void; } /** Options for {@link openZip}. */ export interface OpenZipOptions { /** * Decompression-bomb safeguards applied while inflating archive entries. The * default limits admit any legitimate xlsx and reject pathological archives * (extreme compression ratios, gigabyte-scale entries). Pass `false` to * disable the guard entirely — only safe when the source is fully trusted. * See {@link DecompressionLimits} for the individual knobs. */ decompressionLimits?: DecompressionLimits | false; } /** * Open a zip archive from any {@link XlsxSource}. The source is fully * materialised in memory, the central directory is parsed once, and each * entry is inflated on demand by {@link openRandomAccessArchive} — peak memory * stays at compressed-archive size plus per-entry inflate scratch rather than * holding every uncompressed entry resident. The fflate `unzipSync` fallback * is preserved internally for ZIP64 / non-standard archives the random-access * reader rejects. */ export declare function openZip(source: XlsxSource, opts?: OpenZipOptions): Promise;