import type { ModuleConfig } from '../module-config'; import type { ResolvedMount, ResolverEnvLinks, SupplyEntry } from './resolver'; import type { Diagnostic } from './types'; export { lowerDeclaration } from './lower'; export type { PackageRecord, ReadDeclarationResult } from './reader'; export { readDeclaration, readPackageRecord } from './reader'; export type { ResolvedMount, ResolveMountsResult, ResolverEnvLinks, SupplyEntry, SupplyGroup } from './resolver'; export { resolveMounts, selectSupplyGroup } from './resolver'; export type { ValidateDeclarationResult } from './schema'; export { esmxDeclarationSchema, validateDeclaration } from './schema'; export { parseSemver, satisfiesRange } from './semver'; export type { Diagnostic, DiagnosticCheck, DiagnosticCodeValue, DiagnosticSeverity, EsmxDeclaration, EsmxDeclarationEntry, EsmxDeclarationExportFork, EsmxDeclarationExportValue } from './types'; export { DiagnosticCode } from './types'; export interface ResolveDeclarationOptions { /** * Explicit mount overrides (environment fact): module name → artifact * directory, same semantics as today's `ModuleConfig.links` values, * resolved relative to `rootDir`. */ envLinks?: ResolverEnvLinks; } export interface ResolveDeclarationResult { /** The declaration lowered to today's internal ModuleConfig IR. */ config: ModuleConfig; /** Merged supply table: bare package → per-major group winners. */ supply: Record; /** Resolved mount table: module name → mounted artifact location. */ mounts: Record; diagnostics: Diagnostic[]; } /** * One-call helper composing reader + resolver + lowering (RFC Phase 1). * Returns null when the package at `rootDir` has no `esmx` declaration. */ export declare function resolveDeclaration(rootDir: string, options?: ResolveDeclarationOptions): ResolveDeclarationResult | null; /** * Integration point for `Esmx.init`: decides between the legacy * `options.modules` path and the declaration path. * * - No `esmx` field in package.json → legacy path, untouched. * - `esmx` field present and `options.modules` carries protocol facts * (lib/imports/exports) → E_PROTOCOL_IN_BEHAVIOR (protocol facts * must live in package.json only). * - `links` alone is an environment fact and is passed to the resolver as * explicit mount overrides. */ export declare function resolveModuleOptions(rootDir: string, packageJson: Record, modules?: ModuleConfig): ModuleConfig | undefined;