/** * Streaming ZIP writer — build an archive incrementally without ever holding * the whole thing in memory. * * {@link zipStream} consumes entries one at a time (from a sync or async * iterable) and emits archive bytes through a web-standard * `ReadableStream` you can pipe straight to a file, an HTTP * response, or `FileSystemWritableFileStream`. Peak memory is bounded by the * single largest entry, not the archive total — so hundreds-of-MB / multi-GB * archives never OOM in Node, Bun, or the browser. * * Each entry is compressed as one buffer (the engine is one-shot), so its * CRC-32 and sizes are known before its local header is written — the output is * byte-compatible with {@link import('./index.js').zip}, ZIP64 and all, and * reads back with {@link import('./index.js').unzip} or any standard tool. * * @example * ```ts * import { zipStream } from '@myrialabs/zipkit'; * const stream = zipStream(async function* () { * for await (const file of files) yield { name: file.name, data: await file.bytes() }; * }()); * await stream.pipeTo(destinationWritable); * ``` */ import type { ZipEntryInput } from './index.js'; /** Options for {@link zipStream}. */ export interface ZipStreamOptions { /** Invoked after each entry is written, with the running entry/byte counts. */ onProgress?: (entriesWritten: number, bytesWritten: number) => void; } /** * Stream a ZIP archive built from `entries` (a sync or async iterable). Returns * a `ReadableStream` of the archive bytes. Uses ZIP64 automatically * for entries/offsets past 4 GB or more than 65 535 entries. */ export declare function zipStream(entries: Iterable | AsyncIterable, opts?: ZipStreamOptions): ReadableStream; //# sourceMappingURL=stream.d.ts.map