import type { ValueIr } from "../../../core/domain/facts/value-ir.js"; import type { SelectorStep } from "../../../core/ports/config.port.js"; import type { ParsedFile } from "../../../core/ports/parser.port.js"; import { type SyntaxNode } from "../../../infrastructure/parser/ts-utils.js"; import { type GoImportIndex } from "../index/go/imports.js"; import type { GoPackageIndex } from "../index/go/packages.js"; import type { RecordValue } from "../value/record.js"; export type GoModule = { readonly file: ParsedFile; readonly imports: GoImportIndex; readonly directory: string; }; export type GoAncestor = { readonly name: string; readonly origin: string | null; readonly declared: boolean; }; /** * The types a Go type composes, most derived first. Composition is embedding: * a member with a type and no name of its own. A qualified embedding yields its * import origin, so a type declared outside the unit is still recognized. */ export declare function goAncestry(typeName: string, module: GoModule, packages: GoPackageIndex): readonly GoAncestor[]; export declare function goOriginClaims(ancestors: readonly GoAncestor[], baseType: string): boolean; /** Applies a selector chain: an `arg` step, then `field` steps over a record. */ export declare function resolveChain(steps: readonly SelectorStep[], args: readonly SyntaxNode[], records: ReadonlyMap): SyntaxNode | null; export type GoFoldContext = { readonly module: GoModule; readonly packages: GoPackageIndex; }; /** * Folds a Go expression, following a qualified constant into the package that * declares it. A typed constant is the ordinary way an HTTP verb is written. * The next edge is looked up before the budget is spent, so a value with no * further edge reads as absent and one whose edge is refused reads as bounded. */ export declare function foldGoSinkValue(node: SyntaxNode | null, context: GoFoldContext, depth?: number): ValueIr; /** * The declared type of a name bound in the enclosing function's parameters, * qualified by the import it resolves through. A configuration locator names * that type rather than the variable that happened to carry it. */ export declare function parameterType(name: string, scope: SyntaxNode, module: GoModule): string | null; export declare function enclosingFunction(node: SyntaxNode): SyntaxNode | null; /** * The fields a constructor gives a record. A field the caller never assigns * keeps whatever the summary bound it to, which is how a default verb survives. */ export type ConstructorSummary = { readonly fields: ReadonlyMap; /** The package that declared the literal, for folding its bare names. */ readonly directory: string | null; }; export declare function constructorSummary(value: SyntaxNode, context: GoFoldContext): ConstructorSummary; export declare function goConfigFold(node: SyntaxNode | null, context: GoFoldContext): ValueIr; export declare function goModulesOf(files: readonly ParsedFile[], imports: (file: ParsedFile) => GoImportIndex): readonly GoModule[];