/** * What may be converted to text, and the one check that enforces it. `str(x)` * and an f-string hole share this contract: a value has a hook-free text form, * or it is refused where it is written. * * D115 §三: this was two private methods of `Analyzer`, called from the * f-string arm of the expression dispatcher and from `str` in the call cluster. * The whitelist itself is `isTextConvertibleType` in `../../types.ts`, asked * through the host the way assignability is: the answer crosses, not the type * environment it was judged against. */ import { type Diagnostic } from "../../diagnostic.ts"; import { type Span } from "../../source.ts"; import { type ValueType } from "../../types.ts"; /** What the text conversion asks of the analyzer that hosts it, and nothing more. */ export interface TextConversionHost { advise(code: string, message: string, span: Span): void; readonly diagnostics: Diagnostic[]; expandAliases(type: ValueType, seen?: ReadonlySet): ValueType; extensionTextForm(type: ValueType): boolean | undefined; isTextConvertibleHere(type: ValueType): boolean; } export declare class TextConversion { private readonly host; constructor(host: TextConversionHost); requireTextConvertible(type: ValueType, span: Span, site: "f-string" | "str"): void; isTextConvertible(type: ValueType): boolean; } //# sourceMappingURL=text.d.ts.map