/** * Unified progress types and utilities for archive operations. * * This module defines common progress structures used across zip and unzip operations. * Having them in a shared location reduces duplication and enables cross-module type reuse. * * @module */ /** * Common progress phase states for archive operations. */ export type ArchiveProgressPhase = "running" | "done" | "aborted" | "error"; /** * Common streaming options shared between zip and unzip. */ export interface ArchiveStreamOptions
{ /** Abort signal for cancellation */ signal?: AbortSignal; /** Progress callback */ onProgress?: (p: P) => void; /** Throttle progress callbacks; 0 emits on the next microtask */ progressIntervalMs?: number; } /** * Base operation result type. */ export interface ArchiveOperationBase
{
/** Abort signal linked to this operation */
signal: AbortSignal;
/** Abort the operation */
abort(reason?: unknown): void;
/** Returns bytes processed so far */
pointer(): number;
/** Latest progress snapshot */
progress(): P;
}
export type ProgressListener