/**
 * Get the version of a package installed locally.
 *
 * @param moduleName - The name of the package in npm.
 * @param workDir - The working directory to resolve the module from. (aka project root)
 * @returns The version of the package installed locally.
 * @internal
 */
declare function getLocalPackageVersion(moduleName: string, workDir: string): Promise<string | null>;
/**
 * Resolve the filesystem directory of a locally installed package using Node
 * module resolution. Works correctly with hoisted packages in monorepos/workspaces,
 * pnpm symlinks, and other non-standard node_modules layouts.
 *
 * @param moduleName - The name of the package in npm.
 * @param workDir - The working directory to resolve the module from. (aka project root)
 * @returns The absolute path to the package directory.
 * @internal
 */
declare function getLocalPackageDir(moduleName: string, workDir: string): string;
/**
 * Resolves and imports a package from the local project's node_modules,
 * relative to the given working directory. This avoids circular dependencies
 * and ensures the correct version of the package is used.
 *
 * @param packageName - The name of the package to resolve (e.g., 'sanity')
 * @param workDir - The working directory to resolve the package from
 * @returns The imported module
 * @throws If the package cannot be resolved or imported
 *
 * @example
 * ```ts
 * const {createSchema} = await resolveLocalPackage('sanity', workDir)
 * ```
 *
 * @internal
 */
declare function resolveLocalPackage<T = unknown>(packageName: string, workDir: string): Promise<T>;
/**
 * Resolves the URL of a package from the local project's node_modules,
 * relative to the given working directory, without importing it.
 *
 * @param packageName - The name of the package to resolve (e.g., 'sanity')
 * @param workDir - The working directory to resolve the package from
 * @returns The resolved URL of the package entry point
 * @throws If the package cannot be resolved
 *
 * @example
 * ```ts
 * // Resolve a transitive dependency via its parent package:
 * const sanityUrl = resolveLocalPackagePath('sanity', workDir)
 * const uiUrl = resolveLocalPackagePathFrom('@sanity/ui', sanityUrl)
 * ```
 *
 * @internal
 */
declare function resolveLocalPackagePath(packageName: string, workDir: string): URL;
/**
 * Resolves and imports a package relative to another resolved module URL.
 * Useful for resolving transitive dependencies that may not be directly
 * accessible from the project root (e.g., in pnpm strict mode).
 *
 * @param packageName - The name of the package to resolve
 * @param parentUrl - The URL of the parent module to resolve from
 * @returns The imported module
 * @throws If the package cannot be resolved or imported
 *
 * @example
 * ```ts
 * const sanityUrl = resolveLocalPackagePath('sanity', workDir)
 * const ui = await resolveLocalPackageFrom<typeof import('@sanity/ui')>('@sanity/ui', sanityUrl)
 * ```
 *
 * @internal
 */
declare function resolveLocalPackageFrom<T = unknown>(packageName: string, parentUrl: URL): Promise<T>;
export { getLocalPackageVersion as a, getLocalPackageDir as i, resolveLocalPackageFrom as n, resolveLocalPackagePath as r, resolveLocalPackage as t };
//# sourceMappingURL=resolveLocalPackage-Dr-TNTyk.d.ts.map