/** * Expression emission: every `Expression` kind's JavaScript, the comparison * chain that evaluates each operand once, and the runtime-helper names the * lowered forms call (collection, binary, primitive and index helpers). * * D114 R1c: `emitExpression` is still declared on `JavaScriptEmitter` — it is * one of the 32 `protected` members Web and Node override — and forwards here. */ import type { Expression } from "../ast.ts"; import { type BinaryStorageKind, type ValueType } from "../types.ts"; import { type LoweringHints } from "../contracts.ts"; export interface ExpressionEmitterHost { readonly moduleAccess: import("./module-access.ts").ModuleAccessEmitter; binaryHelper(expression: Extract): string | null; binaryIndexHelper(kind: BinaryStorageKind): string; collectionHelper(expression: Extract): string | null; collectionSizeHelper(kind: "list" | "map" | "set" | "record"): string; primitiveHelper(expression: Extract): string | null; builtinErrorRuntimeName(name: string): string | null; emitCondition(expression: Expression): string; emitIsCheck(type: ValueType, value: string): string; emitMappedExpression(expression: Expression, normalizeNull?: boolean): string; /** AS-U2: `file:line:column` for a compiler-injected guard's report. */ runtimeLocation(offset: number): string; emitObjectKey(name: string): string; emitParameter(name: string, defaultValue: Expression | null, rest?: boolean): string; expressionContainsDirectAwait(expression: Expression): boolean; readonly hints: LoweringHints; needsAssertionErrorClass: boolean; needsBinaryHelpers: boolean; needsBitwiseHelpers: boolean; needsCollectionHelpers: boolean; needsErrorCodeHelper: boolean; needsIndexHelpers: boolean; needsIntegrityFailureHelper: boolean; needsNumberHelper: boolean; needsPrimitiveHelpers: boolean; needsRecordHelpers: boolean; needsRequiredValueHelper: boolean; needsThrownValueHelper: boolean; } export declare class ExpressionEmitter { private readonly host; constructor(host: ExpressionEmitterHost); emitExpression(expression: Expression): string; /** * The value-shaped expressions: literals and f-strings, a name, `super`, a * dynamic import, the collection and record literals, a spread, the required * unwrap `!`, and `try` as an expression. */ private emitLiteralExpression; /** * The operators: unary and binary — including every lowering a binary can * take, from string concatenation to a collection operation — the comparison * chain, the conditional, `is`, and an arrow function. */ private emitOperatorExpression; /** * A call. What it lowers to is decided by what the callee is: a construction, * an intrinsic, a collection or primitive member, an extern JavaScript value, * or an ordinary function, plus the named-argument reordering all of them * share. */ private emitCallExpression; /** * Reading a member or an index off a value, with the guard each receiver kind * needs — an optional chain, a static or private field, a collection or * binary index. */ private emitAccessExpression; /** * A member access the analyzer proved is a lowered read rather than a * property: a binary or collection size, or a member that is really a * runtime operation and is therefore reached through its helper. `null` * when the access is an ordinary property read. */ private emitLoweredMemberRead; /** * `Target.from(source, {overrides})` and `Target.mapFrom(source, transform)`: * the two exact record projections the analyzer proved, lowered to the field * list it recorded. `null` when this call is neither. */ private emitRecordProjectionCall; /** * A call whose callee is a member access, when the analyzer proved the * member is a collection, binary or primitive operation: the call lowers to * that runtime helper with the receiver as its first argument. `null` when * the member is an ordinary method and the call is an ordinary call. */ private emitMemberCall; private emitBinaryOperand; emitPostfixReceiver(expression: Expression): string; private emitComparisonChain; private escapeTemplateText; private typeRuntimeName; } //# sourceMappingURL=expressions.d.ts.map