/** * `type X = …` aliases: registering what a transparent name stands for, and * expanding it wherever a type is read. * * D114 R1d: `expandAliases` stays a `protected` member of `Analyzer` — Web and * Node subclass that class — and forwards here, which is where the rule now * lives beside the registration that fills the table it reads. */ import { type Program, type TypeAliasDeclaration, type TypeReference } from "../../ast.ts"; import { type Diagnostic } from "../../diagnostic.ts"; import { type Span } from "../../source.ts"; import { type ValueType } from "../../types.ts"; import { type BuiltinTypeNamePosition } 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 TypeAliasesHost { declareTypeNameBinding(name: string, type: ValueType, declarationSpan: Span, position: BuiltinTypeNamePosition): void; readonly diagnostics: Diagnostic[]; readonly predeclared: WeakSet; readonlyDataViewOf(type: ValueType): ValueType; resolveGenericApplication(type: Extract, resolveArgument?: (argument: ValueType) => ValueType): ValueType | null; resolveRawTypeReference(reference: TypeReference): ValueType; readonly typeAliases: Map; } export declare class TypeAliases { private readonly host; constructor(host: TypeAliasesHost); registerAliasShapes(program: Program): void; analyzeTypeAliasDeclaration(statement: TypeAliasDeclaration): void; expandAliases(type: ValueType, seen?: ReadonlySet): ValueType; /** * The `TypeEnvironment` view of alias expansion. Assignability needs it to * decide the text-conversion parameter domain on the expanded shape, exactly * as the direct `str()` check does. */ expandTypeAliases(type: ValueType): ValueType; } //# sourceMappingURL=aliases.d.ts.map