/** * What a function body holds, read from its statements: the first reactive * declaration a 'def' answering WebNode may not carry, whether the body returns * JSX, and the markup roots it returns. * * D115 P4 R3a: these are readings of an AST subtree, not of the analyzer, so * they read as a module. */ import { type Span } from "@velarscript/compiler"; import { type Expression, type Statement, type ValueType } from "@velarscript/compiler/extension"; import { type WebJsxElementExpression as JSXElementExpression } from "../ast.ts"; /** * The first reactive declaration a body holds, in source order. A nested `def` * or `component` owns its own declarations, so the walk stops at one. */ export declare function firstReactiveDeclaration(body: readonly Statement[]): { readonly label: string; readonly span: Span; } | null; /** * Whether a type answers markup. `WebNode` is the value, and `WebNode?` and * `List` are the two shapes markup legitimately travels in — a helper * that answers "this row, or nothing" and one that answers a row per item. * Reading only the bare annotation closed the spelling instead of the sink: * the identical body under `-> WebNode?` reached the same defect unreported. */ export declare function carriesWebNode(type: ValueType): boolean; /** * Whether a body's own `return`s carry JSX. A return type is optional on a * `def`, and an omitted one left the same defective helper unreported, so the * markup the body returns answers for the annotation that was never written. * A nested `def` or `component` owns its own returns, exactly as it owns its * own declarations. */ export declare function bodyReturnsJsx(body: readonly Statement[]): boolean; /** * VEL5075: the JSX elements a body's own `return`s *start* with — the roots of * the returned markup, which is where the emitter decides between an instance * and a child. The walk descends through ordinary expression nodes, `.map(...)` * callbacks included, and stops at the first JSX element on every path: inside * one, every JSX position is a child position and needs no verdict. A nested * `def` or `component` owns its own returns, exactly as it does elsewhere here. */ export declare function returnedMarkupRoots(body: readonly Statement[]): readonly JSXElementExpression[]; /** The component spelling of a helper's name: components render as a PascalCase tag. */ export declare function componentSpelling(name: string): string; /** `{ id: item.id }` in a callback over `item`: the field carries its own value over unchanged. */ export declare function rowFieldPassthrough(value: Expression, row: string, name: string): boolean; //# sourceMappingURL=jsx-detection.d.ts.map