import type { PackageJson } from './types'; /** * Enhanced module resolver that supports both CommonJS and ESM resolution * Handles package.json "exports" field and ESM-specific resolution rules */ interface ResolveOptions { basedir: string; extensions?: string[]; conditions?: string[]; } interface ResolveResult { resolved: string; isESM: boolean; } /** * Resolve a module specifier with ESM support * Falls back to standard CommonJS resolution if ESM resolution fails * * @param specifier - Module specifier to resolve * @param options - Resolution options * @returns Resolved file path and ESM flag */ export declare function resolveModule(specifier: string, options: ResolveOptions): ResolveResult; export interface PackageImportResult { /** Absolute file path for `file`, else the specifier ("some-pkg", "fs") */ target: string; kind: 'file' | 'bare'; /** The package.json that declares the "imports" field */ packageJson: string; config: PackageJson; } /** * Resolve a package.json "imports" specifier (subpath import, e.g. * `#ansi-styles`) against the nearest package.json of `basedir`. The rules * are in `resolveImportsTarget` (common.ts), which the packaged binary uses * as well. * @param specifier - Specifier starting with '#' * @param basedir - Directory of the importing file * @returns Resolution result, or null without an "imports" field in scope * @throws If the specifier can't be resolved; the message names the reason */ export declare function resolvePackageImport(specifier: string, basedir: string): PackageImportResult | null; export {}; //# sourceMappingURL=resolver.d.ts.map