import type { TarAuditOptions, TarAuditReport, TarEntry, TarIssue, TarNormalizeOptions, TarNormalizeReport, TarReaderOptions } from './types.js'; /** * Read TAR archives from bytes, streams, or URLs. * * @example * ```ts * import { TarReader } from "../../mod.ts"; * * const reader = await TarReader.fromUint8Array(bytes, { safetyProfile: "strict" }); * const report = await reader.audit(); * console.log(report.isSafe); * ``` */ export declare class TarReader { private readonly data; /** * Resolved safety profile used for TAR audit/open defaults. * @internal */ private readonly safetyProfile; /** * Effective strict-mode flag derived from the safety profile. * @internal */ private readonly strict; /** * Fully resolved resource ceilings applied to this reader. * @internal */ private readonly limits; /** * Accumulated non-fatal TAR issues discovered during parse/open flows. * @internal */ private readonly warningsList; /** * Cached TAR entries when `shouldStoreEntries` is enabled. * @internal */ private entriesList; /** * Whether entries should remain cached after initialization. * @internal */ private readonly storeEntries; /** * Reader-level abort signal reused across audit/open/normalize calls. * @internal */ private readonly signal; private constructor(); /** Create a reader from in-memory bytes. */ static fromUint8Array(data: Uint8Array, options?: TarReaderOptions): Promise; /** Create a reader from a readable stream. */ static fromStream(stream: ReadableStream, options?: TarReaderOptions): Promise; /** Create a reader from a URL via fetch(). */ static fromUrl(url: string | URL, options?: TarReaderOptions): Promise; /** Return stored entries (requires shouldStoreEntries=true). */ entries(): TarEntry[]; /** Return non-fatal warnings encountered during parsing. */ warnings(): TarIssue[]; /** Iterate entries (from cached entries). */ iterEntries(): AsyncGenerator; /** Open a stream for a specific entry's contents. */ open(entry: TarEntry): Promise>; /** Audit the archive and return a report of issues. */ audit(options?: TarAuditOptions): Promise; /** Audit and throw if the archive fails the selected safety profile. */ assertSafe(options?: TarAuditOptions): Promise; /** Normalize to a writable stream, producing a report. */ normalizeToWritable(writable: WritableStream, options?: TarNormalizeOptions): Promise; /** * Resolve the effective audit settings for one audit call. * * Per-call options can tighten resource ceilings without changing the reader's * validation policy. */ private resolveAuditSettings; /** * Parse the TAR headers once and populate cached entries/warnings for later operations. * * @throws {ArchiveError} When the archive headers are malformed or configured * limits are exceeded during initialization. */ private init; } //# sourceMappingURL=TarReader.d.ts.map