/**
 * True Streaming ZIP creator - shared implementation.
 *
 * This module is intentionally platform-agnostic.
 * - In Node builds it uses `./compression/crc32` + `./compression/streaming-compress` (zlib-backed).
 * - In browser builds the bundler aliases those imports to their browser variants.
 */
import type { ZipTimestampMode } from "@archive/utils/timestamps";
import type { ZipEntryInfo as UnzipZipEntryInfo } from "@archive/zip-spec/zip-entry-info";
/**
 * Internal entry info for central directory
 */
interface ZipEntryInfo {
    name: Uint8Array;
    extraField: Uint8Array;
    comment: Uint8Array;
    flags: number;
    crc: number;
    compressedSize: number;
    uncompressedSize: number;
    compressionMethod: number;
    dosTime: number;
    dosDate: number;
    offset: number;
}
type CentralDirectoryEntryInfo = ZipEntryInfo;
/**
 * True Streaming ZIP File - compresses chunk by chunk
 */
export declare class ZipDeflateFile {
    private _deflate;
    private _crc;
    private _uncompressedSize;
    private _compressedSize;
    private _finalized;
    private _headerEmitted;
    private _ondata;
    private _onerror;
    private _centralDirEntryInfo;
    private _pendingEnd;
    private _emittedDataDescriptor;
    private _localHeader;
    private _deflateWanted;
    private _pendingChunks;
    private _sampleBuffer;
    private _sampleLen;
    private _smartStore;
    private _completeResolve;
    private _completeReject;
    private _completePromise;
    private _completeError;
    private _dataQueue;
    private _finalQueued;
    private _pushChain;
    readonly name: string;
    readonly level: number;
    readonly nameBytes: Uint8Array;
    readonly commentBytes: Uint8Array;
    readonly dosTime: number;
    readonly dosDate: number;
    readonly extraField: Uint8Array;
    private readonly _flags;
    private _compressionMethod;
    private readonly _modTime;
    constructor(name: string, options?: {
        level?: number;
        modTime?: Date;
        timestamps?: ZipTimestampMode;
        comment?: string;
        smartStore?: boolean;
    });
    private _buildCompressionMethod;
    private _initDeflateStream;
    private _buildLocalHeader;
    private _accumulateSample;
    private _shouldDecide;
    private _decideCompressionIfNeeded;
    private _emitHeaderIfNeeded;
    private _flushPendingChunks;
    private _enqueueData;
    private _flushQueue;
    get ondata(): ((data: Uint8Array, final: boolean) => void) | undefined;
    set ondata(cb: (data: Uint8Array, final: boolean) => void);
    get onerror(): ((err: Error) => void) | undefined;
    set onerror(cb: (err: Error) => void);
    private _resolveComplete;
    private _rejectComplete;
    private _ensureCompletePromise;
    private _tapCallback;
    private _writeData;
    private _endDeflateAndWait;
    private _finalizeAfterWrite;
    private _pushUnchained;
    /**
     * Push data - immediately compresses and outputs
     * Returns a Promise that resolves when the write is complete.
     * If final=true, it resolves after the data descriptor is emitted.
     */
    push(data: Uint8Array, final?: boolean, callback?: (err?: Error | null) => void): Promise<void>;
    /**
     * Emit local file header with Data Descriptor flag
     */
    private _emitHeader;
    /**
     * Emit Data Descriptor with CRC and sizes
     */
    private _emitDataDescriptor;
    /**
     * Returns a promise that resolves when the file is completely written
     * (including data descriptor)
     */
    complete(): Promise<void>;
    /**
     * Get entry metadata in the same shape as unzip parser outputs.
     * This is best-effort: writer-only fields like encryption are always false.
     */
    getEntryInfo(): UnzipZipEntryInfo | null;
    /** Writer-only metadata for building the Central Directory. */
    getCentralDirectoryEntryInfo(): CentralDirectoryEntryInfo | null;
    isComplete(): boolean;
}
/**
 * Streaming ZIP Creator - processes files sequentially
 */
export declare class StreamingZip {
    private callback;
    private entries;
    private currentOffset;
    private ended;
    private endPending;
    private zipComment;
    private fileQueue;
    private fileQueueIndex;
    private activeFile;
    constructor(callback: (err: Error | null, data: Uint8Array, final: boolean) => void, options?: {
        comment?: string;
    });
    add(file: ZipDeflateFile): void;
    private _processNextFile;
    private _finalize;
    end(): void;
}
export { StreamingZip as Zip, ZipDeflateFile as ZipDeflate };
