/** * What JSX becomes: a component instance, a native element and its attributes, * and the children each of them owns. * * D115 P4 R3d: the family owns every lowering that builds DOM, plus the two * recognizers the analyzer shares with it — `jsxKeyedList` and * `dynamicChildLeaves` — so the fast path emission takes and the fast path * analysis diagnoses are one definition. */ import type { Expression, LoweringHints, Span, Statement } from "@velarscript/compiler/extension"; import { type WebJsxAttribute as JSXAttribute, type WebJsxElementExpression as JSXElementExpression } from "../ast.ts"; /** * What JSX emission reads and writes on the emitter. The three scope fields are * live: a nested element is emitted while they name the scope it builds into, * and every path restores what it found. */ export interface JsxEmitHost { currentJsxNamespace: string; currentScope: string | null; readonly hints: LoweringHints; jsxId: number; readonly moduleEvaluation: boolean; emitMappedExpression(expression: Expression): string; emitMappedJavaScript(sourceSpan: Span, render: () => string): string; emitObjectKey(name: string): string; emitStatement(statement: Statement, depth: number): string; } export declare function emitJsx(host: JsxEmitHost, expression: JSXElementExpression, scope: string, asChild: boolean, namespace: string, mapped?: boolean): string; export interface JsxKeyedList { readonly source: Expression; readonly arrow: Extract & { readonly body: JSXElementExpression; }; readonly key: JSXAttribute | null; } export interface DynamicChildGuard { readonly condition: Expression; readonly thenBranch: boolean; } export interface DynamicChildLeaf { readonly expression: Expression; readonly list: JsxKeyedList | null; readonly guards: readonly DynamicChildGuard[]; } export declare function jsxKeyedList(expression: Expression): JsxKeyedList | null; /** * F1: the analyzer's verdict that an interpolation's checked type renders as * exactly one text node. The emitter cannot re-derive it — the checked type is * gone by lowering time — so the analyzer stamps the child expression's span * and the emitter reads it back through the extension-hint channel that * `LOOK_ARITHMETIC_HINT` already uses. */ export declare const JSX_SCALAR_TEXT_HINT = "@velarscript/web:jsx-scalar-text"; export declare function dynamicChildLeaves(expression: Expression, guards?: readonly DynamicChildGuard[]): readonly DynamicChildLeaf[]; //# sourceMappingURL=jsx.d.ts.map