/** * @file Package isolation utilities for testing. Provides tools to set up * isolated test environments for packages. */ import type { PackageJson } from './types.js'; export type IsolatePackageOptions = { imports?: Record | undefined; install?: ((cwd: string) => Promise) | undefined; onPackageJson?: ((pkgJson: PackageJson) => PackageJson | Promise) | undefined; sourcePath?: string | undefined; }; export type IsolatePackageResult = { exports?: Record | undefined; tmpdir: string; }; /** * Isolates a package in a temporary test environment. * * Supports multiple input types: 1. Absolute or relative file system path 2. * Package name with optional version spec 3. npm package spec (parsed via * npm-package-arg) * * @throws {Error} When package installation or setup fails. */ export declare function isolatePackage(packageSpec: string, options?: IsolatePackageOptions | undefined): Promise; /** * Merge and write package.json with original and new values. */ export declare function mergePackageJson(pkgJsonPath: string, originalPkgJson: PackageJson | undefined): Promise; /** * Resolve a path to its real location, handling symlinks. Falls back to a * non-realpath resolution if the OS rejects the lookup (ENOENT, EACCES, etc.) — * caller still gets a usable absolute path either way. */ export declare function resolveRealPath(pathStr: string): Promise;