/** * TAR + Gzip (tar.gz / tgz) Support * * Provides utilities for creating and extracting gzip-compressed TAR archives. * Uses the unified compress module for compression/decompression. */ import type { ArchiveSource } from "../io/archive-source.js"; import { TarArchive, type TarArchiveOptions } from "./tar-archive.js"; import { type TarEntry, type TarParseOptions } from "./tar-parser.js"; export interface TarGzOptions extends TarArchiveOptions { /** Compression level (0-9, default: 6) */ level?: number; } export type ParseTarGzOptions = TarParseOptions; /** * TarGz Archive Builder * * Creates gzip-compressed TAR archives (.tar.gz / .tgz) * * @example * ```ts * const archive = new TarGzArchive({ level: 6 }); * archive.add("file.txt", "Hello, World!"); * const bytes = await archive.bytes(); * ``` */ export declare class TarGzArchive extends TarArchive { private readonly _gzLevel; constructor(options?: TarGzOptions); /** * Generate compressed archive as async iterable (true streaming) */ stream(): AsyncIterable; } /** * Create a gzip-compressed TAR archive */ export declare function targz(entries: Map | Array<{ name: string; source: ArchiveSource; }>, options?: TarGzOptions): Promise; /** * Parse a gzip-compressed TAR archive * * @param source - Compressed archive data * @param options - Parse options * @returns Array of TAR entries */ export declare function parseTarGz(source: ArchiveSource, options?: ParseTarGzOptions): Promise; /** * Parse a gzip-compressed TAR archive as async iterable stream */ export declare function parseTarGzStream(source: ArchiveSource, options?: ParseTarGzOptions): AsyncIterable; /** * Extract gzip-compressed TAR archive to Map * * @param source - Compressed archive data * @param options - Parse options * @returns Map of path → { info, data } */ export declare function untargz(source: ArchiveSource, options?: ParseTarGzOptions): Promise>;