/** * Every attribute a JSX element can carry: the visual directives (`look`, * `look:`, `style:`, `class`), the `bind:` family, the `on:` events and the * `on`-prefixed names a native element reserves, `ref`, `key`, and the native * attribute names and values the DOM and ARIA rosters answer for. * * D115 P4 R3b. `analyzeNativeJsxAttribute` stays the one guarded chain the * order of these rules lives in — the name check sits at its tail so every * directive above owns its own spelling — and the arms whose bodies are long * enough to read on their own are named functions below it. */ import { type Span } from "@velarscript/compiler"; import { type Expression, type ValueType } from "@velarscript/compiler/extension"; import { type WebJsxAttribute as JSXAttribute, type WebJsxElementExpression as JSXElementExpression } from "../../ast.ts"; import { type JsxAnalysisHost } from "./host.ts"; export declare function analyzeNativeJsxAttribute(host: JsxAnalysisHost, expression: JSXElementExpression, attribute: JSXAttribute): void; /** * The `look=` attribute on either host kind. A Look block written inline is * reported without inferring its entries, so the one directive-level message * stands alone; an empty list names the accepted family rather than rendering * `List` (LOK-I3, LOK-I6). */ export declare function analyzeJsxLookAttribute(host: JsxAnalysisHost, attribute: JSXAttribute): void; /** * Composition is how a Look overrides another one: `...baseLook` puts the two * in an order the reader can see, and everything after it wins. Two looks * placed side by side on one element state no order at all, so a property both * of them set has no answer the source gives — the winner used to fall out of * whichever rule the stylesheet happened to carry last. The shape is refused * rather than ordered by fiat, and the refusal names the spelling that states * the order the author meant. */ export declare function reportIndependentLookCollisions(host: JsxAnalysisHost, value: Extract, attribute: JSXAttribute): void; export declare function analyzeInlineVisualAttribute(host: JsxAnalysisHost, attribute: JSXAttribute, actual: ValueType, directive: "look" | "style"): void; /** * A14: `condition ? "true" : "false"` is the expanded spelling of the Core * text conversion `str(condition)`. Keep that conversion explicit at a DOM * text boundary instead of teaching every attribute its own coercion rule. * * The rule does not reach component props or HTML bool-presence attributes. * A string "false" keeps such an attribute present; accepting that spelling * as canonical would hide a likely presence bug whose direct expression is * the bool itself. */ export declare function adviseNativeBooleanTextConversion(host: JsxAnalysisHost, tag: string, attribute: JSXAttribute): void; /** * D90 coherence-3: DOM attribute names and ARIA are documented as checked * surfaces, and nothing checked them — `className="panel"` compiled clean and * emitted a dead attribute, while the sibling React reflex `onClick=` on the * same element was already refused. So a model got a clean bill of health on * exactly the half of its React habit that silently breaks the page. * * The rule diagnoses names that are KNOWN wrong, never names that are merely * unknown. HTML lets a document carry attributes no roster can enumerate, so * `foo="bar"`, `data-*`, and a framework's own prefixes stay legal; a false * positive there would block a correct program, which is worse than the * silence it replaces. Three closed rosters answer three closed questions: * the React / JavaScript-property spellings, the ARIA attribute names (ARIA, * unlike HTML, admits no custom names), and the ARIA and role vocabularies. * * D61 bounds the value half. Every native attribute uses the same presence * rule: false/null remove it, true writes an empty value, and strings carry * literal text. A token vocabulary is therefore read only against a string * literal; expression values are runtime questions. A14 separately shortens * an explicit bool-to-text conditional to `str(bool)` when that rewrite is * provably equivalent. * * Returns true when it reported, so the caller does not stack a value-shape * message on an attribute whose name is already answered. */ export declare function reportNativeAttributeSpelling(host: JsxAnalysisHost, expression: JSXElementExpression, attribute: JSXAttribute): boolean; /** * GRM-A4: an event handler runs for effect and returns null. The hole this * closes is `on:click={() => {}}`: after a fat arrow, braces build a record, * never a block, so the empty-record factory used to be accepted as a handler * and silently did nothing on every click. */ export declare function checkEventHandlerResult(host: JsxAnalysisHost, event: string, value: JSXAttribute["value"], result: ValueType, attributeSpan: Span): void; /** * D47 rule 84(A): a bind target is a writable reactive location — a state * name, or a record-field / List-index / Map-key path rooted in one. A * computed accessor, a const, and a function result stay rejected: nothing * would receive the write. */ export declare function isWritableBindTarget(host: JsxAnalysisHost, value: JSXAttribute["value"]): boolean; /** * Walks a member/index path inward to its root state binding, checking every * segment is a writable location: a declared record field, a List element, or * a Map value. Returns the root state name, or null when the path is not a * writable reactive location. */ export declare function bindPathRoot(host: JsxAnalysisHost, value: Expression): string | null; /** * D47 rule 84: `bind:group` binds a set of inputs that share one decision. * A radio group holds the selected input's `value`; a checkbox group holds the * checked values as a List, so checking and unchecking are membership * changes. */ export declare function analyzeBindGroup(host: JsxAnalysisHost, expression: JSXElementExpression, attribute: JSXAttribute, value: JSXAttribute["value"], inferred: ValueType): void; export declare function eventAssignedStateBinding(host: JsxAnalysisHost, value: JSXAttribute["value"]): string | null; //# sourceMappingURL=attributes.d.ts.map