UNPKG

@lyleunderwood/streaming-zipper

Version:

Memory-efficient streaming ZIP creation with automatic backpressure control. Supports parallel reading + sequential writing for both Web Streams and Node.js streams with ZIP64 support.

67 lines 1.77 kB
/** * Parallel reader for concurrent entry stream processing */ import { EntryBuffer } from './entry-buffer.js'; import { ZipEntry } from './zip-format.js'; import { CompressionMethod } from './compression.js'; export interface ParallelReaderOptions { maxBufferSize?: number; maxConcurrentReads?: number; compression?: CompressionMethod; } export declare class ParallelReader { private entryBuffers; private readingPromises; private options; private activeReads; constructor(options?: ParallelReaderOptions); /** * Add an entry to be read in parallel */ addEntry(entry: ZipEntry): EntryBuffer; /** * Get all entry buffers */ getEntryBuffers(): EntryBuffer[]; /** * Get entry buffer by index */ getEntryBuffer(index: number): EntryBuffer | undefined; /** * Get the next ready entry in order */ getNextReadyEntry(): EntryBuffer | null; /** * Check if there are any entries still being read */ hasActiveReads(): boolean; /** * Wait for the next entry to become ready */ waitForNextReady(): Promise<EntryBuffer | null>; /** * Wait for all entries to complete reading */ waitForAllComplete(): Promise<void>; /** * Get statistics about reading progress */ getStats(): { total: number; pending: number; reading: number; ready: number; writing: number; completed: number; errors: number; }; /** * Start reading an entry if we have capacity */ private startReadingIfPossible; /** * Try to start reading the next pending entry */ private startNextPendingEntry; } //# sourceMappingURL=parallel-reader.d.ts.map