import type { ValueIr } from "../../../../core/domain/facts/value-ir.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 { RouterValue } from "./router-scope.js"; /** * A field of a record the analysis proved. A field the seeding literal never * assigned holds the zero value its declared type fixes, which is a proof the * source language gives rather than a guess. */ export type FieldValue = { readonly kind: "router"; readonly value: RouterValue; } | { readonly kind: "syntax"; readonly node: SyntaxNode; readonly imports: GoImportIndex; readonly directory: string; } | { readonly kind: "zero"; readonly goType: string; }; export type RouterRecord = ReadonlyMap; export type RecordSeed = { readonly imports: GoImportIndex; readonly directory: string; readonly packages: GoPackageIndex; readonly routerOf: (node: SyntaxNode) => RouterValue | null; }; /** Go fixes the zero value of every type; only a string carries a segment. */ export declare function zeroValueOf(goType: string): ValueIr; /** * Seeds a record from a composite literal. The declared field set is read * through the imports of the file that declares the struct, because the type * of a field is written in that package and not in the caller's. */ export declare function recordOf(literal: SyntaxNode, seed: RecordSeed): RouterRecord | null;