import type { NormalizedStructuralImport, NormalizedStructure, SourceSpan, StructuralEdgeKind, StructuralTarget } from "./types.js"; import type { StructuralFqnResolution, StructuralFqnCandidate, StructuralIdentity, StructuralIdentityInput } from "./fqn-codec.js"; export interface StructuralResolverDefinition { identity: StructuralIdentityInput; /** Generation-owned identity; sessions populate this once during construction. */ resolvedIdentity?: StructuralIdentity; exported: boolean; defaultExport?: boolean; } export interface StructuralPathAlias { pattern: string; targets: readonly string[]; } export interface StructuralBuildMetadata { knownFiles: readonly string[]; pathAliases?: readonly StructuralPathAlias[]; /** Exact caller-file aliases; prevents monorepo package aliases leaking across packages. */ pathAliasesByFile?: Readonly>; importsByFile?: Readonly>; } export interface StructuralResolverFile { file: string; dialect: string; resolverVersion: string; imports: readonly NormalizedStructuralImport[]; } export interface StructuralReference { kind: StructuralEdgeKind; span: SourceSpan; target: StructuralTarget; /** Qualified name of the declaration containing the reference. */ lexicalScope?: string; } export type StructuralResolutionSource = "same_file" | "import" | "global" | "legacy" | "exact"; export type StructuralResolverOutcome = { status: "resolved"; fqn: string; identity?: StructuralIdentity; source: StructuralResolutionSource; } | { status: "ambiguous"; name: string; qualifier?: string; candidates: readonly StructuralFqnCandidate[]; } | { status: "unresolved"; name: string; qualifier?: string; }; export interface StructuralLanguageResolver { readonly version: string; readonly dialects: readonly string[]; resolve(file: StructuralResolverFile, reference: StructuralReference, definitions: readonly StructuralResolverDefinition[], build: StructuralBuildMetadata): StructuralResolverOutcome; resolveLegacy(legacyFqn: string, definitions: readonly StructuralResolverDefinition[]): StructuralResolverOutcome; } export declare class StructuralResolverRegistry { #private; constructor(resolvers?: readonly StructuralLanguageResolver[]); register(resolver: StructuralLanguageResolver): void; forDialect(dialect: string, version: string): StructuralLanguageResolver | undefined; requireDialect(dialect: string, version: string): StructuralLanguageResolver; } export interface ResolvableDefinition { identity: StructuralIdentity; arity?: number; exported: boolean; defaultExport: boolean; } export interface StructuralResolverDocument { file: string; language: string; dialect: string; resolverVersion: string; structure: NormalizedStructure; } /** Converts one immutable parse generation into FQN-ready resolver definitions. */ export declare function buildStructuralResolverDefinitions(documents: readonly StructuralResolverDocument[]): readonly StructuralResolverDefinition[]; /** Generation-scoped adapter over normalized syntax documents and build metadata. */ export declare class StructuralResolverSession { #private; constructor(documents: readonly StructuralResolverDocument[], build: StructuralBuildMetadata, registry: StructuralResolverRegistry, seedDefinitions?: readonly StructuralResolverDefinition[]); identitiesFor(file: string): readonly StructuralIdentity[]; resolveFqn(fqn: string): StructuralFqnResolution; resolve(file: string, reference: StructuralReference): StructuralResolverOutcome; } //# sourceMappingURL=resolver.d.ts.map