import type { TarWriterAddOptions, TarWriterOptions } from './types.js'; /** * Write TAR archives to a writable stream. * * @example * ```ts * import { TarWriter } from "../../mod.ts"; * * const writer = TarWriter.toWritable(writable, { isDeterministic: true }); * await writer.add("docs/readme.txt", new TextEncoder().encode("hello")); * await writer.close(); * ``` */ export declare class TarWriter { /** * Writable-stream sink used for TAR block writes. * @internal */ private readonly writer; /** * Whether deterministic metadata defaults are enabled. * @internal */ private readonly deterministic; /** * Writer-level abort signal reused across add/close operations. * @internal */ private readonly signal; /** Writer lifecycle state. @internal */ private state; /** * Monotonic counter used to name generated PAX header entries. * @internal */ private paxCounter; private constructor(); /** Create a TAR writer that targets a WritableStream. */ static toWritable(writable: WritableStream, options?: TarWriterOptions): TarWriter; /** Add an entry to the TAR archive. */ add(name: string, source?: Uint8Array | ArrayBuffer | ReadableStream | AsyncIterable, options?: TarWriterAddOptions): Promise; /** Finalize and close the TAR archive. */ close(): Promise; /** Abort without writing end-of-archive blocks. */ abort(reason?: unknown): Promise; /** * Emit a PAX extended-header record before the next TAR member. * * This is used when names, sizes, or timestamps no longer fit the fixed TAR * header fields and must be carried in portable key-value metadata instead. */ private writePaxHeader; /** * Drain one entry payload stream into the underlying TAR writer. * * @throws {ArchiveError} When the writer signal is aborted while streaming payload bytes. */ private pipeData; /** * Append zero-byte padding so the current TAR member ends on a 512-byte block boundary. */ private writePadding; /** * Write one raw byte chunk to the underlying TAR sink after checking for cancellation. * * @throws {ArchiveError} When the writer signal has already been aborted. */ private writeChunk; } //# sourceMappingURL=TarWriter.d.ts.map