/** * Utilities for resolving package.json entry points. * @internal */ import type { ResolvedEntryPoints } from '../types'; /** * Represents the relevant fields from package.json. */ interface PackageJson { main?: string; types?: string; typings?: string; module?: string; exports?: PackageExports; } /** * Package.json exports field can be complex. */ type PackageExports = string | { [key: string]: PackageExports | string | undefined; } | undefined; /** * Finds the nearest package.json by searching upward from a directory. * * @param startDir - Directory to start searching from * @returns Path to package.json if found, undefined otherwise */ export declare function findPackageJson(startDir: string): string | undefined; /** * Loads and parses a package.json file. * * @param pkgPath - Path to the package.json file * @returns Parsed package.json or null if file cannot be read */ export declare function loadPackageJson(pkgPath: string): PackageJson | null; /** * Resolves all entry points from a package.json. * * @param pkgPath - Path to the package.json file * @returns Resolved entry points with absolute paths */ export declare function resolveEntryPoints(pkgPath: string): ResolvedEntryPoints; /** * Checks if a file is a package entry point. * * @param filePath - Absolute path to the file being checked * @param pkgPath - Path to the package.json * @returns True if the file is an entry point */ export declare function isEntryPoint(filePath: string, pkgPath: string): boolean; /** * Clears the package.json cache. Useful for testing. */ export declare function clearPackageJsonCache(): void; export {}; //# sourceMappingURL=entry-point.d.ts.map