import type { TypeExpr } from "../ast/types.js"; import type { TypeDef, RecordDef, EnumDef, ToolDef } from "../ast/nodes.js"; export declare class TypeEnv { private bindings; private typeDefs; private toolDefs; private parent; constructor(parent?: TypeEnv | null); bind(name: string, type: TypeExpr): void; getType(name: string): TypeExpr | undefined; registerTypeDef(name: string, def: TypeDef | RecordDef | EnumDef): void; lookupTypeDef(name: string): TypeDef | RecordDef | EnumDef | undefined; registerToolDef(name: string, def: ToolDef): void; lookupToolDef(name: string): ToolDef | undefined; /** * Resolve a named type alias to its underlying definition. * If the type is `Named("Foo")` and Foo is a TypeDef, returns the definition type. * Built-in enums Option and Result resolve to their concrete type kinds * so that Named("Option") matches { kind: "option" } and Named("Result") matches { kind: "result" }. * Otherwise returns the type as-is. */ resolveAlias(type: TypeExpr): TypeExpr; /** * Collect all type definition names of a specific kind, walking the parent chain. */ allTypeDefNames(kind: "record" | "enum" | "type"): string[]; child(): TypeEnv; } //# sourceMappingURL=type-env.d.ts.map