/** * `enum` declarations: the member roster a name stands for, the wire values it * carries, and the two ways an enum object is reached at runtime. * * D114 R1d: split out of `Analyzer` with the rest of the declaration cluster. */ import { type Expression, type Program } from "../../ast.ts"; import { type EnumInfo, type ValueType } from "../../types.ts"; import { type Binding } from "../scopes.ts"; /** * Everything this half of the declaration cluster asks of the analyzer that * hosts it. The five halves share one host object, so the interface is the * same shape for each and the union of them is what the analyzer builds. */ export interface EnumDeclarationsHost { readonly enums: Map; expandAliases(type: ValueType, seen?: ReadonlySet): ValueType; lookup(name: string): Binding | null; readonly typeAliases: Map; } export declare class EnumDeclarations { private readonly host; constructor(host: EnumDeclarationsHost); registerEnumShapes(program: Program): void; /** * D102 ruling 1: the declared wire value of each member, by identity first * and local name second — `this.host.enums` is keyed by the name the module sees, * and an imported enum's identity is its declaring module's. */ enumWireValuesOf(identity: string, name: string): ReadonlyMap | null; enumValuesOf(identity: string): readonly (string | number)[] | null; /** The enum behind a type alias name, or null when the alias does not resolve to an enum. */ aliasedEnumTarget(name: string): { readonly name: string; readonly identity: string; readonly members: ReadonlySet; } | null; /** The runtime surface of an enum object: its members plus is, parse, and values() (ENM-U1). */ enumRuntimeMember(name: string, identity: string, members: ReadonlySet, property: string): ValueType | null; enumTargetOfValidatorObject(object: Expression): Extract | null; } //# sourceMappingURL=enums.d.ts.map