/**
 * True Streaming ZIP creator - shared implementation.
 *
 * This module is intentionally platform-agnostic.
 * - In Node builds it uses `./crc32` + `./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-entry-info";
/**
 * Internal entry info for central directory
 */
interface ZipEntryInfo {
    name: Uint8Array;
    extraField: 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 _centralDirEntryInfo;
    private _pendingEnd;
    private _emittedDataDescriptor;
    private _localHeader;
    private _completeResolve;
    private _completeReject;
    private _completePromise;
    private _completeError;
    private _dataQueue;
    private _finalQueued;
    readonly name: string;
    readonly level: number;
    readonly nameBytes: Uint8Array;
    readonly dosTime: number;
    readonly dosDate: number;
    readonly extraField: Uint8Array;
    private readonly _flags;
    private readonly _compressionMethod;
    private readonly _modTime;
    constructor(name: string, options?: {
        level?: number;
        modTime?: Date;
        timestamps?: ZipTimestampMode;
    });
    private _buildLocalHeader;
    private _enqueueData;
    private _flushQueue;
    get ondata(): ((data: Uint8Array, final: boolean) => void) | undefined;
    set ondata(cb: (data: Uint8Array, final: boolean) => void);
    private _resolveComplete;
    private _rejectComplete;
    private _ensureCompletePromise;
    private _tapCallback;
    private _emitHeaderIfNeeded;
    private _writeData;
    private _endDeflateAndWait;
    private _finalizeAfterWrite;
    /**
     * 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 fileQueue;
    private fileQueueIndex;
    private activeFile;
    constructor(callback: (err: Error | null, data: Uint8Array, final: boolean) => void);
    add(file: ZipDeflateFile): void;
    private _processNextFile;
    private _finalize;
    end(): void;
}
export { StreamingZip as Zip, ZipDeflateFile as ZipDeflate };
