/** * @file Package exports field utilities. */ /** * Find types definition for a specific subpath in package exports. * * @example * ;```typescript * const exports = { * '.': { types: './dist/index.d.ts', import: './dist/index.js' }, * } * const types = findTypesForSubpath(exports, './dist/index.js') * // types === './dist/index.d.ts' * ``` */ export declare function findTypesForSubpath(entryExports: unknown, subpath: string): string | undefined; /** * Get file paths from package exports. * * @example * ;```typescript * const exports = { '.': './dist/index.js', './utils': './dist/utils.js' } * getExportFilePaths(exports) // ['./dist/index.js', './dist/utils.js'] * ``` */ export declare function getExportFilePaths(entryExports: unknown): string[]; /** * Get subpaths from package exports. * * @example * ;```typescript * const exports = { '.': './index.js', './utils': './utils.js' } * getSubpaths(exports) // ['.', './utils'] * ``` */ export declare function getSubpaths(entryExports: unknown): string[]; /** * Check if package exports use conditional patterns (e.g., import/require). * * @example * ;```typescript * isConditionalExports({ import: './index.mjs', require: './index.cjs' }) // true * isConditionalExports({ '.': './index.js' }) // false * ``` */ export declare function isConditionalExports(entryExports: unknown): boolean; /** * Check if package exports use subpath patterns (keys starting with '.'). * * @example * ;```typescript * isSubpathExports({ '.': './index.js', './utils': './utils.js' }) // true * isSubpathExports({ import: './index.mjs' }) // false * ``` */ export declare function isSubpathExports(entryExports: unknown): boolean; /** * Normalize package.json exports field to canonical format. * * @example * ;```typescript * resolvePackageJsonEntryExports('./index.js') * // { '.': './index.js' } * * resolvePackageJsonEntryExports({ '.': './index.js' }) * // { '.': './index.js' } * ``` */ export declare function resolvePackageJsonEntryExports(entryExports: unknown): unknown;