/** * @file Private internals for `archives/*` modules — defaults, lazy module * accessors (tar-fs, node:path), shared pre-extraction validators * (`assertArchiveExists`, `validatePathWithinBase`). */ import type tarFsType from '../external/tar-fs.js'; export { DEFAULT_MAX_ENTRIES, DEFAULT_MAX_FILE_SIZE, DEFAULT_MAX_TOTAL_SIZE, } from './types.js'; /** * Assert that an archive file exists on disk before handing it to the * underlying extractor. Normalizes the "missing archive" surface across all * three extractors (zip/tar/tar.gz): each now throws a Node-style `ENOENT` * error with the archive path. Without this preflight, `zip` goes through * the underlying extractor. The error includes the missing path. * * @private * * @throws Error with `code: 'ENOENT'` if archivePath doesn't exist. */ export declare function assertArchiveExists(archivePath: string): void; export declare function getTarFs(): typeof tarFsType; /** * Validate that a resolved path is within the target directory. Prevents path * traversal attacks. * * @private * * @param targetPath - The resolved path to validate. * @param baseDir - The base directory that should contain the path. * @param entryName - Original entry name for error reporting. * * @throws Error if path is outside the base directory */ export declare function validatePathWithinBase(targetPath: string, baseDir: string, entryName: string): void;