import type { ArchiveAuditReport, ArchiveInput } from '@ismail-elkorchi/bytefold'; import type { DetectResult, ExtractOptions, ExtractResult, ListResult, NormalizeOptions, NormalizeResult, ReadOptions, WriteOptions, WriteResult } from './types.ts'; /** * Detects an archive format without extracting or listing its contents. * * This is the lightest-weight way to confirm the container and compression * layers before choosing a follow-up operation. * * @param input Archive bytes, path, URL, stream, or blob to inspect. * @param options Format hints and parse controls applied during detection. * @returns The resolved archive format and any Bytefold detection metadata. */ export declare const detect: (input: ArchiveInput, options?: ReadOptions) => Promise; /** * Lists archive entries without extracting anything to disk. * * Each entry is projected into a JSON-safe summary so CLI and API callers can * inspect paths, sizes, and link metadata before deciding to extract. * * @param input Archive bytes, path, URL, stream, or blob to inspect. * @param options Format hints and parse controls applied while reading the * archive directory. * @returns Archive metadata plus the entry summaries visible to callers. */ export declare const list: (input: ArchiveInput, options?: ReadOptions) => Promise; /** * Audits an archive against the selected Bytefold safety profile. * * Use this before extraction when you need a report of unsafe paths, link * entries, or format-specific concerns without writing files to disk. * * @param input Archive bytes, path, URL, stream, or blob to audit. * @param options Safety profile, limits, and format hints used during the * audit pass. * @returns The Bytefold audit report for the requested profile. */ export declare const audit: (input: ArchiveInput, options?: ReadOptions) => Promise; /** * Rewrites an archive into its normalized deterministic representation. * * Normalization is available only when the opened archive reader exposes * Bytefold normalization support. Unsupported formats throw * `DIRARCHIVER_NORMALIZE_UNSUPPORTED`. * * @param input Archive bytes, path, URL, stream, or blob to normalize. * @param destination Output archive path that will receive the normalized * bytes. * @param options Format hints and normalization controls applied during the * read and write pass. * @returns The source format and Bytefold normalization report. * @throws {DirArchiverError} When the selected archive format cannot be * normalized by the active runtime. */ export declare const normalize: (input: ArchiveInput, destination: string, options?: NormalizeOptions) => Promise; /** * Extracts an archive into a destination directory with safety enforcement. * * `extract()` defaults to `safetyProfile: 'strict'`. It audits before bytes are * written and rejects a report that does not satisfy the selected profile. * * @param input Archive bytes, path, URL, stream, or blob to extract. * @param destination Directory that will receive extracted files. * @param options Extraction policy, safety profile, and resource limits. * @returns A summary of what was extracted, skipped, and flagged. * @throws {DirArchiverError} When audit checks fail, resource limits are * exceeded, or unsupported entry types are encountered. */ export declare const extract: (input: ArchiveInput, destination: string, options?: ExtractOptions) => Promise; /** * Writes an archive from a file or directory source path. * * Directory sources are traversed deterministically and emitted through one * of Bytefold's archive writers. * * @param source File or directory path to archive. * @param destination Output archive path. * @param options Format selection, traversal rules, and exclusion controls. * @returns A summary of the emitted archive format and entry count. */ export declare const write: (source: string, destination: string, options?: WriteOptions) => Promise;