import type { createRequire } from 'node:module'; export type BrowserRuntimeDefaultExportPolicy = 'emit-default' | 'skip-default'; type RequireFromRoot = ReturnType; /** * Resolves a package specifier to its ESM entry file path from the app root. */ export declare function resolvePackageEsmEntryPath(specifier: string, rootDir: string): string | undefined; /** * Builds a relative import path from a generated runtime entry file to a resolved module path. */ export declare function toRelativeEntryImport(entryDir: string, resolvedPath: string): string; /** * Resolves a browser runtime entry import to an ESM file path when possible. * * @remarks * `createRequire().resolve()` follows the `require` export condition and can * land on `.cjs` entrypoints. Browser vendor bundles then emit runtime * `require()` calls for React externals. Prefer Node's ESM resolver first, then * a `.cjs` → `.js` sibling fallback. */ export declare function resolveBrowserRuntimeEntryImport(options: { specifier: string; requireFromRoot: RequireFromRoot; entryDir: string; rootDir: string; }): string; /** * Decides whether a generated runtime entry should re-export a default binding. * * @remarks * ESM-only packages such as `@tanstack/react-query` expose named exports only. * Legacy CJS packages such as `react` assign `module.exports` directly and have * no `.default` under `require()`, but still need a default re-export for * `import React from 'react'` in browser bundles. * * ESM source inspection is a best-effort fast path; when it is inconclusive the * policy falls back to the shape returned by `require()`. */ export declare function inferBrowserRuntimeDefaultExportPolicy(options: { specifier: string; requireFromRoot: RequireFromRoot; rootDir: string; }): BrowserRuntimeDefaultExportPolicy; /** * Reads the named runtime exports that should be re-exported from a generated runtime entry module. * * @remarks * Default exports are handled separately because generated runtime entry files need to emit a * synthetic default binding only when the caller explicitly asks for it. */ export declare function listBrowserRuntimeModuleExportNames(specifier: string, requireFromRoot: RequireFromRoot): string[]; export {};