/** * The records the module-interface assembly threads through its sections, and * the three mappings every section applies to a type on its way out of the * module. * * D115 §三: `resolveNominals`, `functionSignature` and `inferPublicExpression` * were three helpers at the tail of `index.ts`, read by both halves of the * assembly. They are the leaf of this directory: nothing here reads a draft or * writes one, so `./assembly.ts` and `./declarations.ts` both depend on it and * it depends on neither. */ import type { Expression, FunctionDeclaration, Statement, TypeReference } from "../../../ast.ts"; import { type ClassInfo } from "../../../contracts.ts"; import type { CompilerExtension, ModuleTest } from "../../../extension.ts"; import { type EnumInfo, type GenericTypeInfo, type ValueType } from "../../../types.ts"; /** The nominal identities a module publishes its own declarations under. */ export interface ModuleIdentities { readonly classIdentities: Map; readonly enumNames: Map; readonly namedTypeIdentities: Map; readonly aliasDeclarations: Map>; } /** * The resolvers every section reads a type through: `resolve` for a written * type reference, `resolveAnalyzed` for a type the analyzer already produced, * and the two await probes a class's `@dispose:` is classified with. They close * over one alias cache, so they are built once and shared rather than rebuilt * per declaration. */ export interface InterfaceResolution { readonly resolve: (reference: TypeReference | null) => ValueType; readonly resolveAnalyzed: (type: ValueType) => ValueType; readonly resolvedAnalyzedBindings: Map; readonly directAwaitExpression: (expression: Expression, contains: (expression: Expression) => boolean) => boolean | undefined; readonly directAwaitStatement: (statement: Statement, containsExpression: (expression: Expression) => boolean, containsBlock: (statements: readonly Statement[]) => boolean) => boolean | undefined; } /** The tables the assembly fills in, in the order the one function filled them. */ export interface InterfaceDraft { readonly namedTypes: Map>; readonly namedTypeReadonlyFields: Map>; readonly namedTypeBases: Map; readonly genericTypes: Map; readonly typeAliases: Map; readonly enums: Map; readonly classes: Map; readonly exports: Map; readonly hoistedExports: Set; readonly mutableExports: Set; readonly reactiveExports: Map; readonly inspectionExtensions: readonly NonNullable[]; readonly tests: ModuleTest[]; readonly extensionExports: Map>; readonly extensionData: Map; } /** * What the analyzer already worked out for this module, when it ran. An * interface built without an analysis (`inspectModule`) passes empty tables and * every section falls back to what the declaration itself says. */ export interface AnalyzedModule { readonly classes: ReadonlyMap; readonly namedTypes: ReadonlyMap>; readonly namedTypeReadonlyFields: ReadonlyMap>; readonly namedTypeBases: ReadonlyMap; readonly genericTypes: ReadonlyMap; } export declare function functionSignature(statement: Pick, resolve: (reference: TypeReference | null) => ValueType): ValueType; export declare function resolveNominals(type: ValueType, classIdentities: ReadonlyMap, enumNames: ReadonlyMap, namedTypeIdentities: ReadonlyMap): ValueType; export declare function inferPublicExpression(expression: Expression, extensions: readonly NonNullable[]): ValueType; //# sourceMappingURL=tables.d.ts.map