@velarscript/web 0.31.0 → 0.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/analysis/calls/intrinsics/config.d.ts +10 -0
- package/dist/analysis/calls/intrinsics/config.d.ts.map +1 -0
- package/dist/analysis/calls/intrinsics/config.js +19 -0
- package/dist/analysis/calls/intrinsics/config.js.map +1 -0
- package/dist/analysis/calls/intrinsics/forms.d.ts +10 -0
- package/dist/analysis/calls/intrinsics/forms.d.ts.map +1 -0
- package/dist/analysis/calls/intrinsics/forms.js +38 -0
- package/dist/analysis/calls/intrinsics/forms.js.map +1 -0
- package/dist/analysis/calls/intrinsics/http.d.ts +10 -0
- package/dist/analysis/calls/intrinsics/http.d.ts.map +1 -0
- package/dist/analysis/calls/intrinsics/http.js +37 -0
- package/dist/analysis/calls/intrinsics/http.js.map +1 -0
- package/dist/analysis/calls/intrinsics/reactive.d.ts +10 -0
- package/dist/analysis/calls/intrinsics/reactive.d.ts.map +1 -0
- package/dist/analysis/calls/intrinsics/reactive.js +30 -0
- package/dist/analysis/calls/intrinsics/reactive.js.map +1 -0
- package/dist/analysis/calls/intrinsics/storage.d.ts +16 -0
- package/dist/analysis/calls/intrinsics/storage.d.ts.map +1 -0
- package/dist/analysis/calls/intrinsics/storage.js +91 -0
- package/dist/analysis/calls/intrinsics/storage.js.map +1 -0
- package/dist/analysis/calls/intrinsics/web.d.ts +10 -0
- package/dist/analysis/calls/intrinsics/web.d.ts.map +1 -0
- package/dist/analysis/calls/intrinsics/web.js +100 -0
- package/dist/analysis/calls/intrinsics/web.js.map +1 -0
- package/dist/analysis/calls/intrinsics.d.ts +13 -0
- package/dist/analysis/calls/intrinsics.d.ts.map +1 -0
- package/dist/analysis/calls/intrinsics.js +31 -0
- package/dist/analysis/calls/intrinsics.js.map +1 -0
- package/dist/analysis/components/contracts.d.ts +19 -0
- package/dist/analysis/components/contracts.d.ts.map +1 -0
- package/dist/analysis/components/contracts.js +83 -0
- package/dist/analysis/components/contracts.js.map +1 -0
- package/dist/analysis/components/declaration.d.ts +4 -0
- package/dist/analysis/components/declaration.d.ts.map +1 -0
- package/dist/analysis/components/declaration.js +163 -0
- package/dist/analysis/components/declaration.js.map +1 -0
- package/dist/analysis/components/host.d.ts +61 -0
- package/dist/analysis/components/host.d.ts.map +1 -0
- package/dist/analysis/components/host.js +22 -0
- package/dist/analysis/components/host.js.map +1 -0
- package/dist/analysis/components/lifecycle.d.ts +22 -0
- package/dist/analysis/components/lifecycle.d.ts.map +1 -0
- package/dist/analysis/components/lifecycle.js +33 -0
- package/dist/analysis/components/lifecycle.js.map +1 -0
- package/dist/analysis/components/ownership.d.ts +74 -0
- package/dist/analysis/components/ownership.d.ts.map +1 -0
- package/dist/analysis/components/ownership.js +106 -0
- package/dist/analysis/components/ownership.js.map +1 -0
- package/dist/analysis/declarations.d.ts +99 -0
- package/dist/analysis/declarations.d.ts.map +1 -0
- package/dist/analysis/declarations.js +176 -0
- package/dist/analysis/declarations.js.map +1 -0
- package/dist/analysis/inference.d.ts +75 -0
- package/dist/analysis/inference.d.ts.map +1 -0
- package/dist/analysis/inference.js +257 -0
- package/dist/analysis/inference.js.map +1 -0
- package/dist/analysis/jsx/attributes.d.ts +103 -0
- package/dist/analysis/jsx/attributes.d.ts.map +1 -0
- package/dist/analysis/jsx/attributes.js +601 -0
- package/dist/analysis/jsx/attributes.js.map +1 -0
- package/dist/analysis/jsx/elements.d.ts +17 -0
- package/dist/analysis/jsx/elements.d.ts.map +1 -0
- package/dist/analysis/jsx/elements.js +213 -0
- package/dist/analysis/jsx/elements.js.map +1 -0
- package/dist/analysis/jsx/host.d.ts +61 -0
- package/dist/analysis/jsx/host.d.ts.map +1 -0
- package/dist/analysis/jsx/host.js +15 -0
- package/dist/analysis/jsx/host.js.map +1 -0
- package/dist/analysis/jsx/keys.d.ts +15 -0
- package/dist/analysis/jsx/keys.d.ts.map +1 -0
- package/dist/analysis/jsx/keys.js +67 -0
- package/dist/analysis/jsx/keys.js.map +1 -0
- package/dist/analysis/jsx/security.d.ts +29 -0
- package/dist/analysis/jsx/security.d.ts.map +1 -0
- package/dist/analysis/jsx/security.js +61 -0
- package/dist/analysis/jsx/security.js.map +1 -0
- package/dist/analysis/jsx-detection.d.ts +49 -0
- package/dist/analysis/jsx-detection.d.ts.map +1 -0
- package/dist/analysis/jsx-detection.js +196 -0
- package/dist/analysis/jsx-detection.js.map +1 -0
- package/dist/analysis/keyed-rebuild.d.ts +148 -0
- package/dist/analysis/keyed-rebuild.d.ts.map +1 -0
- package/dist/analysis/keyed-rebuild.js +299 -0
- package/dist/analysis/keyed-rebuild.js.map +1 -0
- package/dist/analysis/keyframes-analysis.d.ts +6 -0
- package/dist/analysis/keyframes-analysis.d.ts.map +1 -0
- package/dist/analysis/keyframes-analysis.js +79 -0
- package/dist/analysis/keyframes-analysis.js.map +1 -0
- package/dist/analysis/look/builders.d.ts +29 -0
- package/dist/analysis/look/builders.d.ts.map +1 -0
- package/dist/analysis/look/builders.js +174 -0
- package/dist/analysis/look/builders.js.map +1 -0
- package/dist/analysis/look/conditions.d.ts +13 -0
- package/dist/analysis/look/conditions.d.ts.map +1 -0
- package/dist/analysis/look/conditions.js +84 -0
- package/dist/analysis/look/conditions.js.map +1 -0
- package/dist/analysis/look/edits.d.ts +36 -0
- package/dist/analysis/look/edits.d.ts.map +1 -0
- package/dist/analysis/look/edits.js +80 -0
- package/dist/analysis/look/edits.js.map +1 -0
- package/dist/analysis/look/entries.d.ts +56 -0
- package/dist/analysis/look/entries.d.ts.map +1 -0
- package/dist/analysis/look/entries.js +223 -0
- package/dist/analysis/look/entries.js.map +1 -0
- package/dist/analysis/look/host.d.ts +47 -0
- package/dist/analysis/look/host.d.ts.map +1 -0
- package/dist/analysis/look/host.js +16 -0
- package/dist/analysis/look/host.js.map +1 -0
- package/dist/analysis/look/tokens.d.ts +75 -0
- package/dist/analysis/look/tokens.d.ts.map +1 -0
- package/dist/analysis/look/tokens.js +156 -0
- package/dist/analysis/look/tokens.js.map +1 -0
- package/dist/analysis/look/values.d.ts +45 -0
- package/dist/analysis/look/values.d.ts.map +1 -0
- package/dist/analysis/look/values.js +148 -0
- package/dist/analysis/look/values.js.map +1 -0
- package/dist/analysis/look-conditions.d.ts +47 -0
- package/dist/analysis/look-conditions.d.ts.map +1 -0
- package/dist/analysis/look-conditions.js +157 -0
- package/dist/analysis/look-conditions.js.map +1 -0
- package/dist/analysis/look-sites.d.ts +62 -0
- package/dist/analysis/look-sites.d.ts.map +1 -0
- package/dist/analysis/look-sites.js +121 -0
- package/dist/analysis/look-sites.js.map +1 -0
- package/dist/analysis/look-values.d.ts +19 -0
- package/dist/analysis/look-values.d.ts.map +1 -1
- package/dist/analysis/look-values.js +38 -0
- package/dist/analysis/look-values.js.map +1 -1
- package/dist/analysis/look-vocabulary-guidance.d.ts +76 -0
- package/dist/analysis/look-vocabulary-guidance.d.ts.map +1 -0
- package/dist/analysis/look-vocabulary-guidance.js +338 -0
- package/dist/analysis/look-vocabulary-guidance.js.map +1 -0
- package/dist/analysis/media-conditions.d.ts +33 -0
- package/dist/analysis/media-conditions.d.ts.map +1 -0
- package/dist/analysis/media-conditions.js +92 -0
- package/dist/analysis/media-conditions.js.map +1 -0
- package/dist/analysis/program-passes.d.ts +106 -0
- package/dist/analysis/program-passes.d.ts.map +1 -0
- package/dist/analysis/program-passes.js +149 -0
- package/dist/analysis/program-passes.js.map +1 -0
- package/dist/analysis/reactivity/bindings.d.ts +37 -0
- package/dist/analysis/reactivity/bindings.d.ts.map +1 -0
- package/dist/analysis/reactivity/bindings.js +88 -0
- package/dist/analysis/reactivity/bindings.js.map +1 -0
- package/dist/analysis/reactivity/derived.d.ts +39 -0
- package/dist/analysis/reactivity/derived.d.ts.map +1 -0
- package/dist/analysis/reactivity/derived.js +80 -0
- package/dist/analysis/reactivity/derived.js.map +1 -0
- package/dist/analysis/reactivity/host.d.ts +38 -0
- package/dist/analysis/reactivity/host.d.ts.map +1 -0
- package/dist/analysis/reactivity/host.js +14 -0
- package/dist/analysis/reactivity/host.js.map +1 -0
- package/dist/analysis/reactivity/retired-accessors.d.ts +82 -0
- package/dist/analysis/reactivity/retired-accessors.d.ts.map +1 -0
- package/dist/analysis/reactivity/retired-accessors.js +118 -0
- package/dist/analysis/reactivity/retired-accessors.js.map +1 -0
- package/dist/analysis/renderable.d.ts +47 -0
- package/dist/analysis/renderable.d.ts.map +1 -0
- package/dist/analysis/renderable.js +105 -0
- package/dist/analysis/renderable.js.map +1 -0
- package/dist/analysis/routes.d.ts +64 -0
- package/dist/analysis/routes.d.ts.map +1 -0
- package/dist/analysis/routes.js +182 -0
- package/dist/analysis/routes.js.map +1 -0
- package/dist/analysis/url-attributes.d.ts +12 -0
- package/dist/analysis/url-attributes.d.ts.map +1 -0
- package/dist/analysis/url-attributes.js +48 -0
- package/dist/analysis/url-attributes.js.map +1 -0
- package/dist/analysis/watch-cycles.d.ts +102 -0
- package/dist/analysis/watch-cycles.d.ts.map +1 -1
- package/dist/analysis/watch-cycles.js +240 -1
- package/dist/analysis/watch-cycles.js.map +1 -1
- package/dist/analysis/watch-subject.d.ts +45 -0
- package/dist/analysis/watch-subject.d.ts.map +1 -0
- package/dist/analysis/watch-subject.js +272 -0
- package/dist/analysis/watch-subject.js.map +1 -0
- package/dist/analysis/web-types.d.ts +27 -0
- package/dist/analysis/web-types.d.ts.map +1 -0
- package/dist/analysis/web-types.js +170 -0
- package/dist/analysis/web-types.js.map +1 -0
- package/dist/analyzer.d.ts +18 -617
- package/dist/analyzer.d.ts.map +1 -1
- package/dist/analyzer.js +211 -4853
- package/dist/analyzer.js.map +1 -1
- package/dist/compiler.d.ts +20 -0
- package/dist/compiler.d.ts.map +1 -1
- package/dist/compiler.js +31 -864
- package/dist/compiler.js.map +1 -1
- package/dist/documentation.d.ts +28 -0
- package/dist/documentation.d.ts.map +1 -0
- package/dist/documentation.js +67 -0
- package/dist/documentation.js.map +1 -0
- package/dist/editor/completions.d.ts +12 -0
- package/dist/editor/completions.d.ts.map +1 -0
- package/dist/editor/completions.js +6 -0
- package/dist/editor/completions.js.map +1 -0
- package/dist/editor/jsx-completion.d.ts +12 -0
- package/dist/editor/jsx-completion.d.ts.map +1 -0
- package/dist/editor/jsx-completion.js +137 -0
- package/dist/editor/jsx-completion.js.map +1 -0
- package/dist/editor/look-completion.d.ts +29 -0
- package/dist/editor/look-completion.d.ts.map +1 -0
- package/dist/editor/look-completion.js +159 -0
- package/dist/editor/look-completion.js.map +1 -0
- package/dist/editor.d.ts.map +1 -1
- package/dist/editor.js +12 -288
- package/dist/editor.js.map +1 -1
- package/dist/emit/components.d.ts +33 -0
- package/dist/emit/components.d.ts.map +1 -0
- package/dist/emit/components.js +135 -0
- package/dist/emit/components.js.map +1 -0
- package/dist/emit/jsx.d.ts +57 -0
- package/dist/emit/jsx.d.ts.map +1 -0
- package/dist/emit/jsx.js +384 -0
- package/dist/emit/jsx.js.map +1 -0
- package/dist/emit/look-css.d.ts +44 -0
- package/dist/emit/look-css.d.ts.map +1 -0
- package/dist/emit/look-css.js +177 -0
- package/dist/emit/look-css.js.map +1 -0
- package/dist/emit/look.d.ts +39 -0
- package/dist/emit/look.d.ts.map +1 -0
- package/dist/emit/look.js +218 -0
- package/dist/emit/look.js.map +1 -0
- package/dist/emit/runtime-imports.d.ts +40 -0
- package/dist/emit/runtime-imports.d.ts.map +1 -0
- package/dist/emit/runtime-imports.js +188 -0
- package/dist/emit/runtime-imports.js.map +1 -0
- package/dist/emitter.d.ts +15 -68
- package/dist/emitter.d.ts.map +1 -1
- package/dist/emitter.js +79 -1008
- package/dist/emitter.js.map +1 -1
- package/dist/look/animation.d.ts +7 -0
- package/dist/look/animation.d.ts.map +1 -0
- package/dist/look/animation.js +13 -0
- package/dist/look/animation.js.map +1 -0
- package/dist/look/builders.d.ts +35 -0
- package/dist/look/builders.d.ts.map +1 -0
- package/dist/look/builders.js +74 -0
- package/dist/look/builders.js.map +1 -0
- package/dist/look/css-functions.d.ts +28 -0
- package/dist/look/css-functions.d.ts.map +1 -0
- package/dist/look/css-functions.js +54 -0
- package/dist/look/css-functions.js.map +1 -0
- package/dist/look/keyword-sets.d.ts +41 -0
- package/dist/look/keyword-sets.d.ts.map +1 -0
- package/dist/look/keyword-sets.js +117 -0
- package/dist/look/keyword-sets.js.map +1 -0
- package/dist/look/keywords.d.ts +55 -0
- package/dist/look/keywords.d.ts.map +1 -0
- package/dist/look/keywords.js +387 -0
- package/dist/look/keywords.js.map +1 -0
- package/dist/look/media.d.ts +19 -0
- package/dist/look/media.d.ts.map +1 -0
- package/dist/look/media.js +27 -0
- package/dist/look/media.js.map +1 -0
- package/dist/look/naming.d.ts +9 -0
- package/dist/look/naming.d.ts.map +1 -0
- package/dist/look/naming.js +45 -0
- package/dist/look/naming.js.map +1 -0
- package/dist/look/properties.d.ts +16 -0
- package/dist/look/properties.d.ts.map +1 -0
- package/dist/look/properties.js +52 -0
- package/dist/look/properties.js.map +1 -0
- package/dist/look/shorthands.d.ts +25 -0
- package/dist/look/shorthands.d.ts.map +1 -0
- package/dist/look/shorthands.js +130 -0
- package/dist/look/shorthands.js.map +1 -0
- package/dist/look/tokens.d.ts +38 -0
- package/dist/look/tokens.d.ts.map +1 -0
- package/dist/look/tokens.js +59 -0
- package/dist/look/tokens.js.map +1 -0
- package/dist/look/units.d.ts +24 -0
- package/dist/look/units.d.ts.map +1 -0
- package/dist/look/units.js +33 -0
- package/dist/look/units.js.map +1 -0
- package/dist/look.d.ts +32 -227
- package/dist/look.d.ts.map +1 -1
- package/dist/look.js +28 -933
- package/dist/look.js.map +1 -1
- package/dist/module-roster.d.ts +16 -0
- package/dist/module-roster.d.ts.map +1 -0
- package/dist/module-roster.js +28 -0
- package/dist/module-roster.js.map +1 -0
- package/dist/modules/app.d.ts +9 -0
- package/dist/modules/app.d.ts.map +1 -0
- package/dist/modules/app.js +20 -0
- package/dist/modules/app.js.map +1 -0
- package/dist/modules/browser-test.d.ts +9 -0
- package/dist/modules/browser-test.d.ts.map +1 -0
- package/dist/modules/browser-test.js +67 -0
- package/dist/modules/browser-test.js.map +1 -0
- package/dist/modules/browser.d.ts +10 -0
- package/dist/modules/browser.d.ts.map +1 -0
- package/dist/modules/browser.js +89 -0
- package/dist/modules/browser.js.map +1 -0
- package/dist/modules/config.d.ts +9 -0
- package/dist/modules/config.d.ts.map +1 -0
- package/dist/modules/config.js +14 -0
- package/dist/modules/config.js.map +1 -0
- package/dist/modules/files.d.ts +9 -0
- package/dist/modules/files.d.ts.map +1 -0
- package/dist/modules/files.js +16 -0
- package/dist/modules/files.js.map +1 -0
- package/dist/modules/forms.d.ts +9 -0
- package/dist/modules/forms.d.ts.map +1 -0
- package/dist/modules/forms.js +26 -0
- package/dist/modules/forms.js.map +1 -0
- package/dist/modules/http.d.ts +9 -0
- package/dist/modules/http.d.ts.map +1 -0
- package/dist/modules/http.js +127 -0
- package/dist/modules/http.js.map +1 -0
- package/dist/modules/look.d.ts +9 -0
- package/dist/modules/look.d.ts.map +1 -0
- package/dist/modules/look.js +58 -0
- package/dist/modules/look.js.map +1 -0
- package/dist/modules/realtime.d.ts +9 -0
- package/dist/modules/realtime.d.ts.map +1 -0
- package/dist/modules/realtime.js +163 -0
- package/dist/modules/realtime.js.map +1 -0
- package/dist/modules/storage.d.ts +9 -0
- package/dist/modules/storage.d.ts.map +1 -0
- package/dist/modules/storage.js +59 -0
- package/dist/modules/storage.js.map +1 -0
- package/dist/modules/types.d.ts +78 -0
- package/dist/modules/types.d.ts.map +1 -0
- package/dist/modules/types.js +154 -0
- package/dist/modules/types.js.map +1 -0
- package/dist/modules/web.d.ts +9 -0
- package/dist/modules/web.d.ts.map +1 -0
- package/dist/modules/web.js +63 -0
- package/dist/modules/web.js.map +1 -0
- package/dist/modules/websocket.d.ts +11 -0
- package/dist/modules/websocket.d.ts.map +1 -0
- package/dist/modules/websocket.js +75 -0
- package/dist/modules/websocket.js.map +1 -0
- package/dist/parser/expressions/jsx.d.ts +17 -0
- package/dist/parser/expressions/jsx.d.ts.map +1 -0
- package/dist/parser/expressions/jsx.js +43 -0
- package/dist/parser/expressions/jsx.js.map +1 -0
- package/dist/parser/expressions/keyframes.d.ts +15 -0
- package/dist/parser/expressions/keyframes.d.ts.map +1 -0
- package/dist/parser/expressions/keyframes.js +33 -0
- package/dist/parser/expressions/keyframes.js.map +1 -0
- package/dist/parser/expressions/look.d.ts +16 -0
- package/dist/parser/expressions/look.d.ts.map +1 -0
- package/dist/parser/expressions/look.js +37 -0
- package/dist/parser/expressions/look.js.map +1 -0
- package/dist/parser/expressions/visual-block.d.ts +17 -0
- package/dist/parser/expressions/visual-block.d.ts.map +1 -0
- package/dist/parser/expressions/visual-block.js +21 -0
- package/dist/parser/expressions/visual-block.js.map +1 -0
- package/dist/parser/keyframes-source.d.ts +24 -0
- package/dist/parser/keyframes-source.d.ts.map +1 -0
- package/dist/parser/keyframes-source.js +133 -0
- package/dist/parser/keyframes-source.js.map +1 -0
- package/dist/parser/look-source.d.ts +25 -0
- package/dist/parser/look-source.d.ts.map +1 -0
- package/dist/parser/look-source.js +189 -0
- package/dist/parser/look-source.js.map +1 -0
- package/dist/parser/spans.d.ts +24 -0
- package/dist/parser/spans.d.ts.map +1 -0
- package/dist/parser/spans.js +113 -0
- package/dist/parser/spans.js.map +1 -0
- package/dist/parser/statements/components.d.ts +37 -0
- package/dist/parser/statements/components.d.ts.map +1 -0
- package/dist/parser/statements/components.js +185 -0
- package/dist/parser/statements/components.js.map +1 -0
- package/dist/parser/statements/heads.d.ts +38 -0
- package/dist/parser/statements/heads.d.ts.map +1 -0
- package/dist/parser/statements/heads.js +55 -0
- package/dist/parser/statements/heads.js.map +1 -0
- package/dist/parser/statements/imports.d.ts +9 -0
- package/dist/parser/statements/imports.d.ts.map +1 -0
- package/dist/parser/statements/imports.js +31 -0
- package/dist/parser/statements/imports.js.map +1 -0
- package/dist/parser/statements/reactive.d.ts +31 -0
- package/dist/parser/statements/reactive.d.ts.map +1 -0
- package/dist/parser/statements/reactive.js +68 -0
- package/dist/parser/statements/reactive.js.map +1 -0
- package/dist/parser/statements/unsafe-css.d.ts +21 -0
- package/dist/parser/statements/unsafe-css.d.ts.map +1 -0
- package/dist/parser/statements/unsafe-css.js +42 -0
- package/dist/parser/statements/unsafe-css.js.map +1 -0
- package/dist/parser.d.ts +37 -50
- package/dist/parser.d.ts.map +1 -1
- package/dist/parser.js +98 -882
- package/dist/parser.js.map +1 -1
- package/dist/runtime-sources.generated.d.ts +1 -1
- package/dist/runtime-sources.generated.d.ts.map +1 -1
- package/dist/runtime-sources.generated.js +4 -4
- package/dist/runtime-sources.generated.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the Web extension adds to expression inference, either side of the core
|
|
3
|
+
* walk: the shapes it refuses before the core sees them, the answers it has
|
|
4
|
+
* already computed and hands back instead of walking again, the Look length a
|
|
5
|
+
* builder call folds to, and the two reports a call earns once its type is
|
|
6
|
+
* known. The extension's own call and type-syntax rules — a component element
|
|
7
|
+
* called like a function, and `Component<Props, Handle>` — are here too.
|
|
8
|
+
*
|
|
9
|
+
* D115 P4 R3c. The dispatch itself stays on the analyzer: `inferExpression` and
|
|
10
|
+
* `inferExtensionExpression` are seams the core owns, and what they hand to the
|
|
11
|
+
* JSX, keyframes and Look walks is the one thing that is genuinely a dispatch.
|
|
12
|
+
* Everything on either side of it is a rule, and rules live here.
|
|
13
|
+
*/
|
|
14
|
+
import {} from "@velarscript/compiler";
|
|
15
|
+
import { boolType, describeType, expressionContainsDirectAwait, invalidType, spanIdentity, unknownType, } from "@velarscript/compiler/extension";
|
|
16
|
+
import { isWebExpression, isWebJsx, isWebUnit } from "../ast.js";
|
|
17
|
+
import { LOOK_ARITHMETIC_HINT, LOOK_UNIT_TYPES } from "../look.js";
|
|
18
|
+
import { isWebComponentType, isWebNodeType, webComponentName, webNodeType } from "../types.js";
|
|
19
|
+
import { componentCallRefusal } from "./component-guidance.js";
|
|
20
|
+
import { checkLookBuilderCall } from "./look/builders.js";
|
|
21
|
+
import {} from "./look/host.js";
|
|
22
|
+
import { foldedLengthPercentage, isLookNumericType } from "./look-values.js";
|
|
23
|
+
import { lookJoin, lookLiteralZero } from "./look-sites.js";
|
|
24
|
+
import { lookSourceOf } from "./media-conditions.js";
|
|
25
|
+
import { publicConfigDiagnostic } from "./public-config.js";
|
|
26
|
+
import { calledComputedBinding } from "./reactivity/derived.js";
|
|
27
|
+
import {} from "./reactivity/host.js";
|
|
28
|
+
import { recordRetiredAccessorRead, RETIRED_ACCESSOR_TYPE } from "./reactivity/retired-accessors.js";
|
|
29
|
+
import { diagnostic, webEventDeadFields, webEventTypeNames } from "./web-types.js";
|
|
30
|
+
/**
|
|
31
|
+
* The Web shapes refused before the core analyzer sees the expression, in the
|
|
32
|
+
* order they are asked. `undefined` means nothing here claimed the expression
|
|
33
|
+
* and the extension dispatch continues.
|
|
34
|
+
*/
|
|
35
|
+
export function webExpressionShapeRefusals(host, expression) {
|
|
36
|
+
if (expression.kind === "CallExpression" && expression.callee.kind === "IdentifierExpression"
|
|
37
|
+
&& expression.callee.name === "mount") {
|
|
38
|
+
const namedNode = expression.argumentNames?.findIndex((name) => name === "node") ?? -1;
|
|
39
|
+
const node = expression.arguments[namedNode >= 0 ? namedNode : 0];
|
|
40
|
+
if (node && expressionContainsDirectAwait(node, (value) => value.kind === "ExtensionExpression:web:jsx" ? false : undefined)) {
|
|
41
|
+
host.diagnostics.push(diagnostic("VEL4007", "mount constructs its root synchronously; await the root in a separate module binding before calling mount", node.span));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (expression.kind === "UnaryExpression" && (expression.operator === "+" || expression.operator === "-")) {
|
|
45
|
+
const operand = host.inferExpression(expression.operand);
|
|
46
|
+
if (isLookNumericType(operand)) {
|
|
47
|
+
host.extensionCalls.set(spanIdentity(expression.span), LOOK_ARITHMETIC_HINT);
|
|
48
|
+
return operand;
|
|
49
|
+
}
|
|
50
|
+
host.probedOperandTypes.set(spanIdentity(expression.operand.span), operand);
|
|
51
|
+
}
|
|
52
|
+
// WEB-U15 / GRM-A3: '&&' rendering is the React habit. The lexer now starts
|
|
53
|
+
// JSX after 'and'/'or' so the shape parses and this rejection names the
|
|
54
|
+
// conditional-rendering spelling instead of leaking a bool type error.
|
|
55
|
+
if (expression.kind === "BinaryExpression" && (expression.operator === "and" || expression.operator === "or")
|
|
56
|
+
&& (isWebJsx(expression.left) || isWebJsx(expression.right))) {
|
|
57
|
+
const rightIsElement = isWebJsx(expression.right);
|
|
58
|
+
const tag = rightIsElement ? expression.right.tag : isWebJsx(expression.left) ? expression.left.tag : "";
|
|
59
|
+
const condition = lookSourceOf(rightIsElement ? expression.left : expression.right);
|
|
60
|
+
host.inferExpression(expression.left);
|
|
61
|
+
host.inferExpression(expression.right);
|
|
62
|
+
host.diagnostics.push(diagnostic("VEL5029", `'${expression.operator}' combines bool values and cannot yield an element; render conditionally with '{${condition} ? <${tag || ">"} ... : null}'`, expression.span));
|
|
63
|
+
return invalidType;
|
|
64
|
+
}
|
|
65
|
+
if (expression.kind === "BinaryExpression" && ["+", "-", "*", "/"].includes(expression.operator)) {
|
|
66
|
+
const left = host.inferExpression(expression.left);
|
|
67
|
+
const right = host.inferExpression(expression.right);
|
|
68
|
+
if (!isLookNumericType(left) && !isLookNumericType(right)) {
|
|
69
|
+
host.probedOperandTypes.set(spanIdentity(expression.left.span), left);
|
|
70
|
+
host.probedOperandTypes.set(spanIdentity(expression.right.span), right);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
const additive = expression.operator === "+" || expression.operator === "-" ? lookJoin(left, right) : null;
|
|
74
|
+
const result = additive
|
|
75
|
+
?? ((expression.operator === "*" || expression.operator === "/") && isLookNumericType(left) && right.kind === "number" ? left : null)
|
|
76
|
+
?? (expression.operator === "*" && left.kind === "number" && isLookNumericType(right) ? right : null);
|
|
77
|
+
if (result) {
|
|
78
|
+
// LOK-U8: dividing a visual value by a literal zero produces a
|
|
79
|
+
// non-finite length that the runtime rejects on first construction.
|
|
80
|
+
if (expression.operator === "/" && lookLiteralZero(expression.right)) {
|
|
81
|
+
host.diagnostics.push(diagnostic("VEL5042", "Look unit arithmetic cannot divide by zero", expression.span));
|
|
82
|
+
return invalidType;
|
|
83
|
+
}
|
|
84
|
+
host.extensionCalls.set(spanIdentity(expression.span), LOOK_ARITHMETIC_HINT);
|
|
85
|
+
return result;
|
|
86
|
+
}
|
|
87
|
+
// The rejection is final: returning the invalid type keeps the Look
|
|
88
|
+
// property's own assignment error from co-reporting a union dump on the
|
|
89
|
+
// very expression that was already named (LOK-I1).
|
|
90
|
+
host.diagnostics.push(diagnostic("VEL5042", `Look unit arithmetic cannot apply '${expression.operator}' to ${describeType(left)} and ${describeType(right)}`, expression.span));
|
|
91
|
+
return invalidType;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
// WEB-N2 / D47 rule 84: the event object is typed down to event semantics
|
|
95
|
+
// and deliberately carries no target, so `event.target.value` is a dead end
|
|
96
|
+
// that used to cascade into three unknown-access errors. The read is where
|
|
97
|
+
// the author wanted two-way binding, so it names that spelling and stops.
|
|
98
|
+
if (expression.kind === "MemberExpression" && !expression.optional && webEventDeadFields.has(expression.property)
|
|
99
|
+
&& expression.object.kind === "IdentifierExpression") {
|
|
100
|
+
const binding = host.lookup(expression.object.name);
|
|
101
|
+
const expanded = binding ? host.expandAliases(binding.type) : null;
|
|
102
|
+
if (expanded?.kind === "named" && webEventTypeNames.has(expanded.name)) {
|
|
103
|
+
host.diagnostics.push(diagnostic("VEL5019", `A VelarScript event object carries typed event fields only and has no '${expression.property}': read the element's value through a two-way binding instead — 'bind:value={name}' binds a state name, and 'bind:value={form.field}' or 'bind:value={items[0]}' binds a writable path inside state`, expression.span));
|
|
104
|
+
return invalidType;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return undefined;
|
|
108
|
+
}
|
|
109
|
+
/** The two Web expressions that are a value rather than a walk: a misplaced Look hook, and a unit literal. */
|
|
110
|
+
export function webExtensionValueType(host, expression) {
|
|
111
|
+
if (isWebExpression(expression) && expression.kind === "ExtensionExpression:web:look-hook") {
|
|
112
|
+
host.diagnostics.push(diagnostic("VEL5038", `Look hook '@${expression.name}' is only valid inside a Look condition`, expression.span));
|
|
113
|
+
return boolType;
|
|
114
|
+
}
|
|
115
|
+
if (isWebUnit(expression)) {
|
|
116
|
+
const type = LOOK_UNIT_TYPES.get(expression.unit);
|
|
117
|
+
if (type)
|
|
118
|
+
return { kind: "named", name: type };
|
|
119
|
+
return unknownType;
|
|
120
|
+
}
|
|
121
|
+
return undefined;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* The answers the Web extension already holds for this expression, given back
|
|
125
|
+
* instead of walking it a second time. Null means the core walk should run.
|
|
126
|
+
*/
|
|
127
|
+
export function answeredBeforeInference(host, expression) {
|
|
128
|
+
// Operands probed for Look arithmetic are re-requested by the core analyzer immediately after the
|
|
129
|
+
// probe declines; reusing the probe result (consume-once) keeps operand analysis single-run so
|
|
130
|
+
// operand diagnostics are not reported twice.
|
|
131
|
+
const key = spanIdentity(expression.span);
|
|
132
|
+
const probed = host.probedOperandTypes.get(key);
|
|
133
|
+
if (probed !== undefined) {
|
|
134
|
+
host.probedOperandTypes.delete(key);
|
|
135
|
+
return probed;
|
|
136
|
+
}
|
|
137
|
+
if (expression.kind === "CallExpression" && expression.arguments.length === 0
|
|
138
|
+
&& expression.callee.kind === "IdentifierExpression") {
|
|
139
|
+
host.plainCallSpans.set(spanIdentity(expression.callee.span), expression.span);
|
|
140
|
+
const called = calledComputedBinding(host, expression);
|
|
141
|
+
if (called)
|
|
142
|
+
return called;
|
|
143
|
+
}
|
|
144
|
+
if (expression.kind === "IdentifierExpression") {
|
|
145
|
+
const retired = recordRetiredAccessorRead(host, expression);
|
|
146
|
+
// The retired name is answered here rather than left to fall through as an
|
|
147
|
+
// unknown one: the author gets its migration and nothing else, and the
|
|
148
|
+
// call around it still type-checks against the signature it always had.
|
|
149
|
+
if (retired)
|
|
150
|
+
return RETIRED_ACCESSOR_TYPE;
|
|
151
|
+
}
|
|
152
|
+
return null;
|
|
153
|
+
}
|
|
154
|
+
/** The compile-time Look length a builder call folds to, or null when the call is not one. */
|
|
155
|
+
export function foldedWebLength(host, expression) {
|
|
156
|
+
return expression.kind !== "CallExpression" ? null
|
|
157
|
+
: foldedLengthPercentage(expression, (name) => host.lookBuilderNames.get(name), (argument) => probedSlotType(host, argument), lookJoin);
|
|
158
|
+
}
|
|
159
|
+
/** Infers one builder slot and parks the answer in the probe cache, so the call's own analysis reads it back. */
|
|
160
|
+
export function probedSlotType(host, argument) {
|
|
161
|
+
const inferred = host.inferExpression(argument);
|
|
162
|
+
host.probedOperandTypes.set(spanIdentity(argument.span), inferred);
|
|
163
|
+
return host.expandAliases(inferred);
|
|
164
|
+
}
|
|
165
|
+
/** The two reports a call earns once the core walk has answered its type. */
|
|
166
|
+
export function reportInferredWebCall(host, expression, result) {
|
|
167
|
+
if (expression.kind !== "CallExpression")
|
|
168
|
+
return;
|
|
169
|
+
checkLookBuilderCall(host, expression);
|
|
170
|
+
checkDomIdPrefix(host, expression);
|
|
171
|
+
// D114 0.29.0 LC-D1: the manifest this build bakes in, proved against the declared type.
|
|
172
|
+
const report = publicConfigDiagnostic(expression, result, host.publicConfigNames, host.webPublicConfig, { expandAliases: (type) => host.expandAliases(type), fieldsOf: (identity) => host.fieldsOf(identity), describeType });
|
|
173
|
+
if (report)
|
|
174
|
+
host.diagnostics.push(report);
|
|
175
|
+
}
|
|
176
|
+
/** A target-owned contract consuming Core's lexical scalar facts. */
|
|
177
|
+
function checkDomIdPrefix(host, expression) {
|
|
178
|
+
if (expression.callee.kind !== "IdentifierExpression")
|
|
179
|
+
return;
|
|
180
|
+
const origin = host.importedMemberOf(expression.callee.name);
|
|
181
|
+
if (origin?.source !== "velar/web" || origin.imported !== "domId")
|
|
182
|
+
return;
|
|
183
|
+
const argument = host.resolvedCallArgument(expression, 0);
|
|
184
|
+
if (!argument)
|
|
185
|
+
return;
|
|
186
|
+
const prefix = host.constantValue(argument);
|
|
187
|
+
if (typeof prefix !== "string")
|
|
188
|
+
return;
|
|
189
|
+
const message = prefix.length > 64 ? "DOM ID prefixes cannot exceed 64 characters"
|
|
190
|
+
: !/^[A-Za-z][A-Za-z0-9_-]*$/u.test(prefix)
|
|
191
|
+
? "DOM ID prefixes must start with a letter and contain only letters, numbers, underscores, or hyphens"
|
|
192
|
+
: null;
|
|
193
|
+
if (message)
|
|
194
|
+
host.typeError(message, argument.span);
|
|
195
|
+
}
|
|
196
|
+
export function inferWebExtensionCall(host, callee, arguments_, argumentNames, callSpan) {
|
|
197
|
+
if (!isWebComponentType(callee))
|
|
198
|
+
return undefined;
|
|
199
|
+
host.typeError(componentCallRefusal(webComponentName(callee), arguments_, argumentNames, host.webSourceText), callSpan);
|
|
200
|
+
for (const argument of arguments_)
|
|
201
|
+
host.inferExpression(argument);
|
|
202
|
+
return webNodeType;
|
|
203
|
+
}
|
|
204
|
+
export function validateWebExtensionTypeSyntax(host, syntax, validate, resolve) {
|
|
205
|
+
if (syntax.kind !== "GenericTypeSyntax" || syntax.name !== "Component")
|
|
206
|
+
return undefined;
|
|
207
|
+
let valid = true;
|
|
208
|
+
if (syntax.arguments.length < 1 || syntax.arguments.length > 2) {
|
|
209
|
+
host.typeError("Component<Props, Handle> requires a named prop signature and at most one Handle type", syntax.span);
|
|
210
|
+
valid = false;
|
|
211
|
+
}
|
|
212
|
+
const argumentsValid = syntax.arguments.map(validate).every(Boolean);
|
|
213
|
+
const signature = syntax.arguments[0];
|
|
214
|
+
if (!signature)
|
|
215
|
+
return false;
|
|
216
|
+
if (signature.kind !== "FunctionTypeSyntax") {
|
|
217
|
+
host.typeError("Component<Props, Handle> requires a named function signature such as Component<(title: string) -> WebNode, DialogHandle>", signature.span);
|
|
218
|
+
valid = false;
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
const names = new Set();
|
|
222
|
+
for (const parameter of signature.parameters) {
|
|
223
|
+
if (!parameter.name) {
|
|
224
|
+
host.typeError("Every Component signature prop requires a name", parameter.span);
|
|
225
|
+
valid = false;
|
|
226
|
+
}
|
|
227
|
+
else if (names.has(parameter.name)) {
|
|
228
|
+
host.typeError(`Component signature prop '${parameter.name}' is declared more than once`, parameter.span);
|
|
229
|
+
valid = false;
|
|
230
|
+
}
|
|
231
|
+
else
|
|
232
|
+
names.add(parameter.name);
|
|
233
|
+
if (parameter.rest) {
|
|
234
|
+
host.typeError("Component signatures use named props and cannot declare a rest parameter", parameter.span);
|
|
235
|
+
valid = false;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
const result = resolve({ syntax: signature.result, span: signature.result.span });
|
|
239
|
+
if (!isWebNodeType(result)) {
|
|
240
|
+
host.typeError(`A Component signature must return WebNode, received ${describeType(result)}`, signature.result.span);
|
|
241
|
+
valid = false;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
const handleSyntax = syntax.arguments[1];
|
|
245
|
+
if (handleSyntax && argumentsValid) {
|
|
246
|
+
const handle = host.expandAliases(resolve({ syntax: handleSyntax, span: handleSyntax.span }));
|
|
247
|
+
const fields = handle.kind === "object"
|
|
248
|
+
? handle.fields
|
|
249
|
+
: handle.kind === "named" ? host.fieldsOf(handle.identity ?? handle.name) : null;
|
|
250
|
+
if (!fields) {
|
|
251
|
+
host.typeError(`A Component Handle must be a concrete record type, received ${describeType(handle)}`, handleSyntax.span);
|
|
252
|
+
valid = false;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
return valid && argumentsValid;
|
|
256
|
+
}
|
|
257
|
+
//# sourceMappingURL=inference.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inference.js","sourceRoot":"","sources":["../../src/analysis/inference.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAa,MAAM,uBAAuB,CAAC;AAClD,OAAO,EACL,QAAQ,E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AAC,MAAM,CAAC,EAAE,EAAE,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YACrH,KAAK,GAAG,KAAK,CAAC;QAChB,CAAC;IACH,CAAC;IACD,MAAM,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IACzC,IAAI,YAAY,IAAI,cAAc,EAAE,CAAC;QACnC,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QAC9F,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,KAAK,QAAQ;YACrC,CAAC,CAAC,MAAM,CAAC,MAAM;YACf,CAAC,CAAC,MAAM,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACnF,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,IAAI,CAAC,SAAS,CAAC,+DAA+D,YAAY,CAAC,MAAM,CAAC,EAAE,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;YACzH,KAAK,GAAG,KAAK,CAAC;QAChB,CAAC;IACH,CAAC;IACD,OAAO,KAAK,IAAI,cAAc,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every attribute a JSX element can carry: the visual directives (`look`,
|
|
3
|
+
* `look:`, `style:`, `class`), the `bind:` family, the `on:` events and the
|
|
4
|
+
* `on`-prefixed names a native element reserves, `ref`, `key`, and the native
|
|
5
|
+
* attribute names and values the DOM and ARIA rosters answer for.
|
|
6
|
+
*
|
|
7
|
+
* D115 P4 R3b. `analyzeNativeJsxAttribute` stays the one guarded chain the
|
|
8
|
+
* order of these rules lives in — the name check sits at its tail so every
|
|
9
|
+
* directive above owns its own spelling — and the arms whose bodies are long
|
|
10
|
+
* enough to read on their own are named functions below it.
|
|
11
|
+
*/
|
|
12
|
+
import { type Span } from "@velarscript/compiler";
|
|
13
|
+
import { type Expression, type ValueType } from "@velarscript/compiler/extension";
|
|
14
|
+
import { type WebJsxAttribute as JSXAttribute, type WebJsxElementExpression as JSXElementExpression } from "../../ast.ts";
|
|
15
|
+
import { type JsxAnalysisHost } from "./host.ts";
|
|
16
|
+
export declare function analyzeNativeJsxAttribute(host: JsxAnalysisHost, expression: JSXElementExpression, attribute: JSXAttribute): void;
|
|
17
|
+
/**
|
|
18
|
+
* The `look=` attribute on either host kind. A Look block written inline is
|
|
19
|
+
* reported without inferring its entries, so the one directive-level message
|
|
20
|
+
* stands alone; an empty list names the accepted family rather than rendering
|
|
21
|
+
* `List<unknown>` (LOK-I3, LOK-I6).
|
|
22
|
+
*/
|
|
23
|
+
export declare function analyzeJsxLookAttribute(host: JsxAnalysisHost, attribute: JSXAttribute): void;
|
|
24
|
+
/**
|
|
25
|
+
* Composition is how a Look overrides another one: `...baseLook` puts the two
|
|
26
|
+
* in an order the reader can see, and everything after it wins. Two looks
|
|
27
|
+
* placed side by side on one element state no order at all, so a property both
|
|
28
|
+
* of them set has no answer the source gives — the winner used to fall out of
|
|
29
|
+
* whichever rule the stylesheet happened to carry last. The shape is refused
|
|
30
|
+
* rather than ordered by fiat, and the refusal names the spelling that states
|
|
31
|
+
* the order the author meant.
|
|
32
|
+
*/
|
|
33
|
+
export declare function reportIndependentLookCollisions(host: JsxAnalysisHost, value: Extract<Expression, {
|
|
34
|
+
kind: "ListExpression";
|
|
35
|
+
}>, attribute: JSXAttribute): void;
|
|
36
|
+
export declare function analyzeInlineVisualAttribute(host: JsxAnalysisHost, attribute: JSXAttribute, actual: ValueType, directive: "look" | "style"): void;
|
|
37
|
+
/**
|
|
38
|
+
* A14: `condition ? "true" : "false"` is the expanded spelling of the Core
|
|
39
|
+
* text conversion `str(condition)`. Keep that conversion explicit at a DOM
|
|
40
|
+
* text boundary instead of teaching every attribute its own coercion rule.
|
|
41
|
+
*
|
|
42
|
+
* The rule does not reach component props or HTML bool-presence attributes.
|
|
43
|
+
* A string "false" keeps such an attribute present; accepting that spelling
|
|
44
|
+
* as canonical would hide a likely presence bug whose direct expression is
|
|
45
|
+
* the bool itself.
|
|
46
|
+
*/
|
|
47
|
+
export declare function adviseNativeBooleanTextConversion(host: JsxAnalysisHost, tag: string, attribute: JSXAttribute): void;
|
|
48
|
+
/**
|
|
49
|
+
* D90 coherence-3: DOM attribute names and ARIA are documented as checked
|
|
50
|
+
* surfaces, and nothing checked them — `className="panel"` compiled clean and
|
|
51
|
+
* emitted a dead attribute, while the sibling React reflex `onClick=` on the
|
|
52
|
+
* same element was already refused. So a model got a clean bill of health on
|
|
53
|
+
* exactly the half of its React habit that silently breaks the page.
|
|
54
|
+
*
|
|
55
|
+
* The rule diagnoses names that are KNOWN wrong, never names that are merely
|
|
56
|
+
* unknown. HTML lets a document carry attributes no roster can enumerate, so
|
|
57
|
+
* `foo="bar"`, `data-*`, and a framework's own prefixes stay legal; a false
|
|
58
|
+
* positive there would block a correct program, which is worse than the
|
|
59
|
+
* silence it replaces. Three closed rosters answer three closed questions:
|
|
60
|
+
* the React / JavaScript-property spellings, the ARIA attribute names (ARIA,
|
|
61
|
+
* unlike HTML, admits no custom names), and the ARIA and role vocabularies.
|
|
62
|
+
*
|
|
63
|
+
* D61 bounds the value half. Every native attribute uses the same presence
|
|
64
|
+
* rule: false/null remove it, true writes an empty value, and strings carry
|
|
65
|
+
* literal text. A token vocabulary is therefore read only against a string
|
|
66
|
+
* literal; expression values are runtime questions. A14 separately shortens
|
|
67
|
+
* an explicit bool-to-text conditional to `str(bool)` when that rewrite is
|
|
68
|
+
* provably equivalent.
|
|
69
|
+
*
|
|
70
|
+
* Returns true when it reported, so the caller does not stack a value-shape
|
|
71
|
+
* message on an attribute whose name is already answered.
|
|
72
|
+
*/
|
|
73
|
+
export declare function reportNativeAttributeSpelling(host: JsxAnalysisHost, expression: JSXElementExpression, attribute: JSXAttribute): boolean;
|
|
74
|
+
/**
|
|
75
|
+
* GRM-A4: an event handler runs for effect and returns null. The hole this
|
|
76
|
+
* closes is `on:click={() => {}}`: after a fat arrow, braces build a record,
|
|
77
|
+
* never a block, so the empty-record factory used to be accepted as a handler
|
|
78
|
+
* and silently did nothing on every click.
|
|
79
|
+
*/
|
|
80
|
+
export declare function checkEventHandlerResult(host: JsxAnalysisHost, event: string, value: JSXAttribute["value"], result: ValueType, attributeSpan: Span): void;
|
|
81
|
+
/**
|
|
82
|
+
* D47 rule 84(A): a bind target is a writable reactive location — a state
|
|
83
|
+
* name, or a record-field / List-index / Map-key path rooted in one. A
|
|
84
|
+
* computed accessor, a const, and a function result stay rejected: nothing
|
|
85
|
+
* would receive the write.
|
|
86
|
+
*/
|
|
87
|
+
export declare function isWritableBindTarget(host: JsxAnalysisHost, value: JSXAttribute["value"]): boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Walks a member/index path inward to its root state binding, checking every
|
|
90
|
+
* segment is a writable location: a declared record field, a List element, or
|
|
91
|
+
* a Map value. Returns the root state name, or null when the path is not a
|
|
92
|
+
* writable reactive location.
|
|
93
|
+
*/
|
|
94
|
+
export declare function bindPathRoot(host: JsxAnalysisHost, value: Expression): string | null;
|
|
95
|
+
/**
|
|
96
|
+
* D47 rule 84: `bind:group` binds a set of inputs that share one decision.
|
|
97
|
+
* A radio group holds the selected input's `value`; a checkbox group holds the
|
|
98
|
+
* checked values as a List<string>, so checking and unchecking are membership
|
|
99
|
+
* changes.
|
|
100
|
+
*/
|
|
101
|
+
export declare function analyzeBindGroup(host: JsxAnalysisHost, expression: JSXElementExpression, attribute: JSXAttribute, value: JSXAttribute["value"], inferred: ValueType): void;
|
|
102
|
+
export declare function eventAssignedStateBinding(host: JsxAnalysisHost, value: JSXAttribute["value"]): string | null;
|
|
103
|
+
//# sourceMappingURL=attributes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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