import { type Sink } from './Sink.js'; import type { ZipWriterAddOptions, ZipWriterCloseOptions, ZipWriterOptions } from '../types.js'; /** * Write ZIP archives to a writable stream. * * @example * ```ts * import { ZipWriter } from "../../mod.ts"; * * const writer = ZipWriter.toWritable(writable, { defaultMethod: 8 }); * await writer.add("notes.txt", new TextEncoder().encode("hello")); * await writer.close(); * ``` */ export declare class ZipWriter { private readonly sink; /** * Central-directory entry records accumulated for finalization. * @internal */ private readonly entries; /** Writer lifecycle state. @internal */ private state; /** * Force Zip64 structures even when archive sizes would fit legacy ZIP. * @internal */ private readonly forceZip64; /** * Compression method applied when callers omit `options.method`. * @internal */ private readonly defaultMethod; /** * Whether local headers are patched in place for seekable sinks. * @internal */ private readonly patchLocalHeaders; /** * Default encryption policy applied to entries written through this writer. * @internal */ private readonly defaultEncryption; /** * Throttled progress callback configuration shared across entry writes. * @internal */ private readonly progress; /** * Writer-level abort signal merged into each add/close operation. * @internal */ private readonly signal; /** @internal */ protected constructor(sink: Sink, options?: ZipWriterOptions); /** Create a ZIP writer that targets a WritableStream. */ static toWritable(writable: WritableStream, options?: ZipWriterOptions): ZipWriter; /** Add an entry to the ZIP archive. */ add(name: string, source: Uint8Array | ArrayBuffer | ReadableStream | AsyncIterable, options?: ZipWriterAddOptions & { declaredUncompressedSize?: bigint; }): Promise; /** Finalize and close the ZIP archive. */ close(comment?: string, options?: ZipWriterCloseOptions): Promise; /** Abort without writing central-directory or end-of-archive records. */ abort(reason?: unknown): Promise; /** Async dispose hook for using with `using` in supported runtimes. */ [Symbol.asyncDispose](): Promise; } //# sourceMappingURL=ZipWriter.d.ts.map