/**
 * @file Package isolation utilities for testing. Provides tools to set up
 *   isolated test environments for packages.
 */
import type { PackageJson } from './types';
export type IsolatePackageOptions = {
    imports?: Record<string, string> | undefined;
    install?: ((cwd: string) => Promise<void>) | undefined;
    onPackageJson?: ((pkgJson: PackageJson) => PackageJson | Promise<PackageJson>) | undefined;
    sourcePath?: string | undefined;
};
export type IsolatePackageResult = {
    exports?: Record<string, unknown> | undefined;
    tmpdir: string;
};
/**
 * Isolates a package in a temporary test environment.
 *
 * Supports multiple input types: 1. File system path (absolute or relative) 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<IsolatePackageResult>;
/**
 * Merge and write package.json with original and new values.
 */
export declare function mergePackageJson(pkgJsonPath: string, originalPkgJson: PackageJson | undefined): Promise<PackageJson>;
/**
 * 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<string>;
