/** * Every read the index records: a name read, a member read, and the type * references a written annotation names. Also the two lookups a read needs — * which symbol a name resolves to, and where inside a declaration's span the * name itself is written. * * D115 §三 / D114 R1f: the reference half of `semantic.ts`. Nothing here walks * a statement, so the walk depends on this module and not the other way round. */ import { type TypeReference, type TypeSyntax } from "../ast.ts"; import { type SourceText, type Span } from "../source.ts"; import { type ValueType } from "../types.ts"; import { type Scope, type SemanticMember, type SemanticMemberReference, type SemanticReference, type SemanticSymbol } from "./symbols.ts"; /** What the reference recorder asks of the index that hosts it, and nothing more. */ export interface SemanticReferencesHost { readonly bindingTypes: ReadonlyMap; readonly describedMemberCache: Map, readonly SemanticMember[]>; readonly memberReferences: SemanticMemberReference[]; readonly references: SemanticReference[]; readonly scopes: Scope[]; readonly source: SourceText; readonly symbols: SemanticSymbol[]; } export declare class SemanticReferences { private readonly host; constructor(host: SemanticReferencesHost); describeMembers(memberTypes: ReadonlyMap): readonly SemanticMember[]; callable(type: ValueType | undefined): boolean; semanticIdentity(type: ValueType | undefined): string | null; lookup(name: string): SemanticSymbol | null; reference(name: string, valueSpan: Span, write?: boolean, call?: boolean): void; typeSyntaxReferences(syntax: TypeSyntax): void; typeReferences(type: TypeReference | null): void; nameSpan(span: Span, name: string, from?: number): Span; recordMemberReference(name: string, referenceSpan: Span, owner: ValueType, syntax: SemanticMemberReference["syntax"], shorthand?: boolean): void; moduleSourceSpan(valueSpan: Span): Span; } export declare function wordSpans(text: string, valueSpan: Span): Span[]; //# sourceMappingURL=references.d.ts.map