/** * Code that is not Vel, declared to Vel: an `extern module` with its extern * classes and functions, and an inline JavaScript block with its captures. * * D114 R1f: both statement heads leave `analyzer.ts` together because both * answer the same question — what a foreign declaration is allowed to promise, * and which of those promises Core can still check. The resolution of an extern * annotation stays in `modules/imports.ts`, which owns the module the names * come from; this module owns only the statement that declares them. */ import { type Expression, type ExternFunctionDeclaration, type Statement, type TypeParameterDeclaration, type TypeReference } from "../../ast.ts"; import { type ClassField } from "../../contracts.ts"; import { type Diagnostic, type DiagnosticFix } from "../../diagnostic.ts"; import { type Span } from "../../source.ts"; import { type ValueType } from "../../types.ts"; import { type Binding, type MutableCellTarget } from "../scopes.ts"; /** * Everything the foreign-declaration statements ask of the analyzer that hosts * them, and nothing more. */ export interface ExternStatementsHost { asyncResultContainsPromise(type: ValueType): boolean; checkTypeParameterDeclarations(declarations: readonly TypeParameterDeclaration[] | undefined): void; readonly diagnostics: Diagnostic[]; externClassIdentity(source: string, name: string): string; externFunctionType(statement: ExternFunctionDeclaration, resolve?: (reference: TypeReference | null) => ValueType): ValueType; findField(className: string, name: string): ClassField | null; findGetter(className: string, name: string): { readonly owner: string; readonly type: ValueType; readonly abstract: boolean; } | null; findMethod(className: string, name: string): { readonly owner: string; readonly type: ValueType; readonly abstract: boolean; } | null; inferExpression(expression: Expression, contextualType?: ValueType): ValueType; inferParameterDefault(expression: Expression, contextualType?: ValueType): ValueType; readonly invalidExternTypeReferences: WeakSet; requireAssignable(actual: ValueType, expected: ValueType, valueSpan: Span, mutableCell?: MutableCellTarget | null): void; reportPromiseCarrierHazard(type: ValueType, errorSpan: Span): void; reportPromiseResolutionHazard(type: ValueType, errorSpan: Span): void; resolveValidatedAnnotation(reference: TypeReference | null): ValueType; resolveValidatedExternAnnotation(reference: TypeReference | null, source: string, classNames: ReadonlySet): ValueType; readonly scopes: Map[]; typeError(message: string, errorSpan: Span, fix?: DiagnosticFix): void; typeParameterFrame(declarations: readonly TypeParameterDeclaration[] | undefined): ReadonlyMap; validateClassMemberName(name: string, memberSpan: Span, external?: boolean): void; validateTypeReference(reference: TypeReference, resolve?: (reference: TypeReference) => ValueType): boolean; withTypeParameterFrame(frame: ReadonlyMap, action: () => T): T; } export declare class ExternStatements { private readonly host; constructor(host: ExternStatementsHost); analyzeExternModuleDeclaration(statement: Extract): void; /** Every `extern class` in one `extern module`: its base, its members, and its duplicates. */ private checkExternModuleClasses; analyzeEmbeddedJavaScriptDeclaration(statement: Extract): void; } //# sourceMappingURL=extern.d.ts.map