marko 6.3.20 → 6.3.21

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.
Files changed (64) hide show
  1. package/cheatsheet.md +29 -3
  2. package/dist/common/accessor.d.ts +21 -75
  3. package/dist/common/accessor.debug.d.ts +21 -75
  4. package/dist/common/constants/accessor-prefix.d.ts +16 -0
  5. package/dist/common/constants/accessor-prefix.debug.d.ts +16 -0
  6. package/dist/common/constants/accessor-prop.d.ts +30 -0
  7. package/dist/common/constants/accessor-prop.debug.d.ts +30 -0
  8. package/dist/common/constants/closure-signal-prop.d.ts +6 -0
  9. package/dist/common/constants/closure-signal-prop.debug.d.ts +6 -0
  10. package/dist/common/constants/controlled-type.d.ts +9 -0
  11. package/dist/common/constants/keyed-scopes-prop.d.ts +4 -0
  12. package/dist/common/constants/keyed-scopes-prop.debug.d.ts +4 -0
  13. package/dist/common/constants/load-signal-value.d.ts +5 -0
  14. package/dist/common/constants/load-signal-value.debug.d.ts +5 -0
  15. package/dist/common/constants/node-type.d.ts +7 -0
  16. package/dist/common/constants/pending-render-prop.d.ts +9 -0
  17. package/dist/common/constants/pending-render-prop.debug.d.ts +9 -0
  18. package/dist/common/constants/renderer-prop.d.ts +12 -0
  19. package/dist/common/constants/renderer-prop.debug.d.ts +12 -0
  20. package/dist/common/constants/resume-symbol.d.ts +10 -0
  21. package/dist/common/constants/walk-code.d.ts +17 -0
  22. package/dist/common/constants/walk-range-size.d.ts +7 -0
  23. package/dist/common/types.d.ts +15 -45
  24. package/dist/debug/dom.js +291 -225
  25. package/dist/debug/dom.mjs +291 -225
  26. package/dist/debug/html.js +184 -41
  27. package/dist/debug/html.mjs +184 -41
  28. package/dist/dom/compat.d.ts +1 -1
  29. package/dist/dom/control-flow.d.ts +1 -1
  30. package/dist/dom/renderer.d.ts +2 -2
  31. package/dist/dom/scope.d.ts +1 -1
  32. package/dist/dom.js +8 -6
  33. package/dist/dom.mjs +8 -6
  34. package/dist/html/constants/char.d.ts +11 -0
  35. package/dist/html/constants/flush-status.d.ts +6 -0
  36. package/dist/html/constants/mark.d.ts +6 -0
  37. package/dist/html/constants/runtime-key.d.ts +7 -0
  38. package/dist/html/writer.d.ts +19 -23
  39. package/dist/html.js +127 -28
  40. package/dist/html.mjs +127 -28
  41. package/dist/translator/core/if.d.ts +7 -7
  42. package/dist/translator/core/index.d.ts +7 -7
  43. package/dist/translator/index.d.ts +9 -9
  44. package/dist/translator/index.js +185 -132
  45. package/dist/translator/interop/constants/feature-type.d.ts +5 -0
  46. package/dist/translator/interop/index.d.ts +2 -2
  47. package/dist/translator/util/body-to-text-literal.d.ts +2 -2
  48. package/dist/translator/util/constants/binding-type.d.ts +10 -0
  49. package/dist/translator/util/constants/compile-stage.d.ts +8 -0
  50. package/dist/translator/util/constants/content-type.d.ts +8 -0
  51. package/dist/translator/util/constants/step.d.ts +5 -0
  52. package/dist/translator/util/constants/tag-name-type.d.ts +7 -0
  53. package/dist/translator/util/is-static.d.ts +1 -1
  54. package/dist/translator/util/references.d.ts +5 -12
  55. package/dist/translator/util/sections.d.ts +4 -8
  56. package/dist/translator/util/signals.d.ts +1 -0
  57. package/dist/translator/util/tag-name-type.d.ts +4 -7
  58. package/dist/translator/util/walks.d.ts +4 -6
  59. package/dist/translator/visitors/constants/sibling-text.d.ts +7 -0
  60. package/dist/translator/visitors/placeholder.d.ts +2 -6
  61. package/dist/translator/visitors/tag/constants/class-hydration.d.ts +5 -0
  62. package/dist/translator/visitors/tag/dynamic-tag.d.ts +2 -4
  63. package/package.json +15 -15
  64. package/tags-html.d.ts +98 -22
package/cheatsheet.md CHANGED
@@ -6,7 +6,7 @@ Marko 6 = HTML superset. NOT JSX, NOT old Marko 4/5. `.marko` files are componen
6
6
 
7
7
  1. Text interpolation: `${expr}` inside tag bodies. A bare line like `Welcome aboard` at the root of the template parses as a TAG named `Welcome` (concise mode) and fails to compile. Wrap it in an element (`<p>Welcome aboard</p>`) or prefix the line with `-- ` to mark it as text (`-- Welcome ${name}` works at the top level). Attributes take raw JS after `=` with NO braces/quotes needed: `<div title=user.name data-n=1 + 1>` (parenthesize if the value contains `>`).
8
8
  2. State: `<let/name=initial>` (slash then var name!). Update by plain assignment in an event handler: `count++`, `text = "hi"`. No setState, no hooks.
9
- 3. Derived values: `<const/total=items.length * price>` — auto-recomputes. Never use an effect to derive state.
9
+ 3. Derived values: `<const/total=items.length * price>` — auto-recomputes. Never use an effect to derive state. Updates batch: mid-handler a reassigned `<let>` reads current but its derived `<const>` reads stale — recompute from the `<let>`.
10
10
  4. NEVER mutate state in place. `items.push(x)` will NOT update the UI. Always reassign:
11
11
  - add: `items = items.concat(x)`
12
12
  - remove: `items = items.toSpliced(i, 1)`
@@ -84,7 +84,7 @@ import { getUser } from "../data.js";
84
84
  </try>
85
85
  ```
86
86
 
87
- `@placeholder`/`@catch` go on `<try>`, never on `<await>`. On the server this streams (placeholder flushes first, content follows). It works in the browser too: hand `<await>` a new promise (e.g. a `<const>` derived from state) and it shows the placeholder again, then the new result.
87
+ `@placeholder`/`@catch` go on `<try>`, never on `<await>`. On the server this streams (placeholder flushes first, content follows). It works in the browser too: hand `<await>` a new promise (e.g. a `<const>` derived from state) and it shows the placeholder again, then the new result. `@catch` can't recover in place — usually it redirects (a `<script>` setting `location`) for a full reload, otherwise re-render the `<try>` (bump a key on a wrapping `<for>`).
88
88
 
89
89
  Don't fetch while rendering: start data loads early, pass the PROMISE through the template, and `<await>` it where the data is rendered. Fetching inside each component that renders the data serializes the requests (waterfalls). Under @marko/run, load in the route handler — `return next({ user: getUser() })`, no await — and render with `<await|user|=$global.data.user>`.
90
90
 
@@ -113,6 +113,12 @@ Don't fetch while rendering: start data loads early, pass the PROMISE through th
113
113
  - `class=` / `style=` accept strings, objects, arrays: `class=["btn", { active }]`, `style={ color }` (single braces). `style=` keys are kebab-case CSS names (`{ "background-color": c }`), not camelCase.
114
114
  - `<id/x>` mints a collision-free id for label/input wiring (`<label for=x>`/`<input id=x>`) — don't hardcode ids in reusable tags; `<id/x=input.id>` reuses a caller's.
115
115
 
116
+ ## Sharing data (`$global`)
117
+
118
+ - No provider/consumer context API. Prop-drill through `input`, or read request-scoped `$global` from any template with no threading: `${$global.messages.title}`.
119
+ - Populate at the render call: `template.render({ $global: { messages } })`. Under @marko/run a middleware's `return next({ messages })` merges into `$global.data`.
120
+ - `$global` is NOT serialized by default, so client-reactive reads (`<const>`, `<let>` init, handlers) throw after resume even though SSR looked fine. Allow-list first: `$global.serializedGlobals = { messages: true }` (@marko/run ships only `params`/`url`; add `context.serializedGlobals.data = true`). SSR-only markup needs no opt-in.
121
+
116
122
  ## Client-side effects (rare — prefer state/const)
117
123
 
118
124
  ```marko
@@ -125,7 +131,7 @@ Don't fetch while rendering: start data loads early, pass the PROMISE through th
125
131
  </script>
126
132
  ```
127
133
 
128
- `<style>` = real CSS, extracted & global. `<script>` = reactive effect, NOT an HTML script tag.
134
+ `<style>` = real CSS, extracted & global; `<style/styles>` scopes it (CSS modules) — `.card {...}` then `class=styles.card`, or `<style/{card}>` then `class=card`. Don't hand-namespace globals. `<script>` = reactive effect, NOT an HTML script tag.
129
135
 
130
136
  Imperative libs (charts, maps) needing mount/update/destroy: use `<lifecycle>`, not a hand-wired `<script>`. `this` persists across all three; return an object from `onMount` to stash the instance:
131
137
 
@@ -147,6 +153,22 @@ import PriceChart from "<price-chart>" with { load: "visible#chart" }
147
153
  <div#chart><PriceChart symbol=input.symbol/></div>
148
154
  ```
149
155
 
156
+ ## TypeScript
157
+
158
+ `export interface Input` types `input` — generic as `Input<T>`, body content as `Marko.Body<[params]>`, repeated attr tags as `Marko.AttrTag<T>`.
159
+
160
+ ```marko
161
+ export interface Input<T> {
162
+ value: T;
163
+ onSelect?: (index: number) => void; // event attrs: exact camelCase
164
+ then?: Marko.AttrTag<{ content: Marko.Body<[T]> }>;
165
+ }
166
+
167
+ <${input.then}(input.value)/>
168
+ ```
169
+
170
+ `tsc` silently SKIPS `.marko` — a type-broken template still exits 0. Check with `mtc` (`@marko/type-check`).
171
+
150
172
  ## DON'T (these are errors or silently wrong)
151
173
 
152
174
  | Wrong (React/Vue/Marko5 habit) | Right |
@@ -172,3 +194,7 @@ import PriceChart from "<price-chart>" with { load: "visible#chart" }
172
194
  | hand-rolled radios `checked=x checkedChange(v){…}` | `checkedValue:=picked` on each radio (shared var, distinct `value=`) |
173
195
  | hand-rolled `IntersectionObserver` to defer a widget's JS | `import W from "<w>" with { load: "visible#sel" }` |
174
196
  | imperative lib wired through `<script>` mount + cleanup | `<lifecycle onMount/onUpdate/onDestroy>` (keeps `this` across all three) |
197
+ | `createContext`/provider to share data | `input` (prop drilling) or request-scoped `$global` |
198
+ | `$global.x` in client-reactive code, not allow-listed | `$global.serializedGlobals = { x: true }` first, or it throws after resume |
199
+ | hand-namespaced global classes (`.my-card-title`) | `<style/styles>` + `class=styles.card` (scoped CSS modules) |
200
+ | `tsc --noEmit` to type check templates | `mtc` — `tsc` skips `.marko` files and exits 0 |
@@ -1,75 +1,21 @@
1
- export declare enum AccessorPrefix {
2
- BranchScopes = "A",
3
- ClosureScopes = "B",
4
- ClosureSignalIndex = "C",
5
- ConditionalRenderer = "D",
6
- ControlledHandler = "E",
7
- ControlledType = "F",
8
- ControlledValue = "G",
9
- DynamicHTMLLastChild = "H",
10
- EventAttributes = "I",
11
- KeyedScopes = "O",
12
- Lifecycle = "K",
13
- Promise = "L",
14
- TagVariableChange = "M"
15
- }
16
- export declare enum AccessorProp {
17
- Global = "$",
18
- Owner = "_",
19
- AbortControllers = "A",
20
- AbortScopes = "B",
21
- AwaitCounter = "O",
22
- BranchAccessor = "C",
23
- BranchScopes = "D",
24
- CatchContent = "E",
25
- ClosestBranch = "F",
26
- ClosestBranchId = "G",
27
- Gen = "H",
28
- DetachedAwait = "V",
29
- EndNode = "K",
30
- Id = "L",
31
- Load = "X",
32
- LoopKey = "M",
33
- LoopIndex = "I",
34
- ParentBranch = "N",
35
- PendingEffects = "J",
36
- PendingRenders = "W",
37
- PendingScopes = "Y",
38
- PlaceholderBranch = "P",
39
- PlaceholderContent = "Q",
40
- Renderer = "R",
41
- StartNode = "S",
42
- TagVariable = "T",
43
- TagVariableChange = "U"
44
- }
45
- export declare enum RendererProp {
46
- Id = "a",
47
- Clone = "b",
48
- Setup = "c",
49
- Params = "d",
50
- Owner = "e",
51
- Accessor = "f",
52
- LocalClosures = "g",
53
- LocalClosureValues = "h",
54
- Embed = "i"
55
- }
56
- export declare enum PendingRenderProp {
57
- Key = "a",
58
- Scope = "b",
59
- Signal = "c",
60
- Value = "d",
61
- Gen = "e",
62
- Pending = "f"
63
- }
64
- export declare enum ClosureSignalProp {
65
- ScopeInstancesAccessor = "a",
66
- SignalIndexAccessor = "b",
67
- Index = "c"
68
- }
69
- export declare enum KeyedScopesProp {
70
- PreviousKey = "_"
71
- }
72
- export declare enum LoadSignalValue {
73
- Value = "a",
74
- Signal = "b"
75
- }
1
+ import * as AccessorPrefix from "./constants/accessor-prefix";
2
+ import * as AccessorProp from "./constants/accessor-prop";
3
+ import * as ClosureSignalProp from "./constants/closure-signal-prop";
4
+ import * as KeyedScopesProp from "./constants/keyed-scopes-prop";
5
+ import * as LoadSignalValue from "./constants/load-signal-value";
6
+ import * as PendingRenderProp from "./constants/pending-render-prop";
7
+ import * as RendererProp from "./constants/renderer-prop";
8
+ type AccessorPrefix = AccessorPrefix.Value;
9
+ export { AccessorPrefix };
10
+ type AccessorProp = AccessorProp.Value;
11
+ export { AccessorProp };
12
+ type RendererProp = RendererProp.Value;
13
+ export { RendererProp };
14
+ type PendingRenderProp = PendingRenderProp.Value;
15
+ export { PendingRenderProp };
16
+ type ClosureSignalProp = ClosureSignalProp.Value;
17
+ export { ClosureSignalProp };
18
+ type KeyedScopesProp = KeyedScopesProp.Value;
19
+ export { KeyedScopesProp };
20
+ type LoadSignalValue = LoadSignalValue.Value;
21
+ export { LoadSignalValue };
@@ -1,75 +1,21 @@
1
- export declare enum AccessorPrefix {
2
- BranchScopes = "BranchScopes:",
3
- ClosureScopes = "ClosureScopes:",
4
- ClosureSignalIndex = "ClosureSignalIndex:",
5
- ConditionalRenderer = "ConditionalRenderer:",
6
- ControlledHandler = "ControlledHandler:",
7
- ControlledType = "ControlledType:",
8
- ControlledValue = "ControlledValue:",
9
- DynamicHTMLLastChild = "DynamicHTMLLastChild:",
10
- EventAttributes = "EventAttributes:",
11
- KeyedScopes = "KeyedScopes:",
12
- Lifecycle = "Lifecycle:",
13
- Promise = "Promise:",
14
- TagVariableChange = "TagVariableChange:"
15
- }
16
- export declare enum AccessorProp {
17
- Global = "$global",
18
- Owner = "_",
19
- AbortControllers = "#AbortControllers",
20
- AbortScopes = "#AbortScopes",
21
- AwaitCounter = "#AwaitCounter",
22
- BranchAccessor = "#BranchAccessor",
23
- BranchScopes = "#BranchScopes",
24
- CatchContent = "#CatchContent",
25
- ClosestBranch = "#ClosestBranch",
26
- ClosestBranchId = "#ClosestBranchId",
27
- Gen = "#Gen",
28
- DetachedAwait = "#DetachedAwait",
29
- EndNode = "#EndNode",
30
- Id = "#Id",
31
- Load = "#Load",
32
- LoopKey = "#LoopKey",
33
- LoopIndex = "#LoopIndex",
34
- ParentBranch = "#ParentBranch",
35
- PendingEffects = "#PendingEffects",
36
- PendingRenders = "#PendingRenders",
37
- PendingScopes = "#PendingScopes",
38
- PlaceholderBranch = "#PlaceholderBranch",
39
- PlaceholderContent = "#PlaceholderContent",
40
- Renderer = "#Renderer",
41
- StartNode = "#StartNode",
42
- TagVariable = "#TagVariable",
43
- TagVariableChange = "#TagVariableChange"
44
- }
45
- export declare enum RendererProp {
46
- Id = "id",
47
- Clone = "clone",
48
- Setup = "setup",
49
- Params = "params",
50
- Owner = "owner",
51
- Accessor = "accessor",
52
- LocalClosures = "localClosures",
53
- LocalClosureValues = "localClosureValues",
54
- Embed = "embed"
55
- }
56
- export declare enum PendingRenderProp {
57
- Key = "key",
58
- Scope = "scope",
59
- Signal = "signal",
60
- Value = "value",
61
- Gen = "gen",
62
- Pending = "pending"
63
- }
64
- export declare enum ClosureSignalProp {
65
- ScopeInstancesAccessor = "scopeInstancesAccessor",
66
- SignalIndexAccessor = "signalIndexAccessor",
67
- Index = "index"
68
- }
69
- export declare enum KeyedScopesProp {
70
- PreviousKey = "PreviousKey:"
71
- }
72
- export declare enum LoadSignalValue {
73
- Value = "value",
74
- Signal = "signal"
75
- }
1
+ import * as AccessorPrefix from "./constants/accessor-prefix.debug";
2
+ import * as AccessorProp from "./constants/accessor-prop.debug";
3
+ import * as ClosureSignalProp from "./constants/closure-signal-prop.debug";
4
+ import * as KeyedScopesProp from "./constants/keyed-scopes-prop.debug";
5
+ import * as LoadSignalValue from "./constants/load-signal-value.debug";
6
+ import * as PendingRenderProp from "./constants/pending-render-prop.debug";
7
+ import * as RendererProp from "./constants/renderer-prop.debug";
8
+ type AccessorPrefix = AccessorPrefix.Value;
9
+ export { AccessorPrefix };
10
+ type AccessorProp = AccessorProp.Value;
11
+ export { AccessorProp };
12
+ type RendererProp = RendererProp.Value;
13
+ export { RendererProp };
14
+ type PendingRenderProp = PendingRenderProp.Value;
15
+ export { PendingRenderProp };
16
+ type ClosureSignalProp = ClosureSignalProp.Value;
17
+ export { ClosureSignalProp };
18
+ type KeyedScopesProp = KeyedScopesProp.Value;
19
+ export { KeyedScopesProp };
20
+ type LoadSignalValue = LoadSignalValue.Value;
21
+ export { LoadSignalValue };
@@ -0,0 +1,16 @@
1
+ export declare const BranchScopes = "A";
2
+ export declare const ClosureScopes = "B";
3
+ export declare const ClosureSignalIndex = "C";
4
+ export declare const ConditionalRenderer = "D";
5
+ export declare const ControlledHandler = "E";
6
+ export declare const ControlledType = "F";
7
+ export declare const ControlledValue = "G";
8
+ export declare const DynamicHTMLLastChild = "H";
9
+ export declare const EventAttributes = "I";
10
+ export declare const KeyedScopes = "O";
11
+ export declare const Lifecycle = "K";
12
+ export declare const Promise = "L";
13
+ export declare const TagVariableChange = "M";
14
+ type Self = typeof import("./accessor-prefix");
15
+ export type Value = Self[keyof Self];
16
+ export {};
@@ -0,0 +1,16 @@
1
+ export declare const BranchScopes = "BranchScopes:";
2
+ export declare const ClosureScopes = "ClosureScopes:";
3
+ export declare const ClosureSignalIndex = "ClosureSignalIndex:";
4
+ export declare const ConditionalRenderer = "ConditionalRenderer:";
5
+ export declare const ControlledHandler = "ControlledHandler:";
6
+ export declare const ControlledType = "ControlledType:";
7
+ export declare const ControlledValue = "ControlledValue:";
8
+ export declare const DynamicHTMLLastChild = "DynamicHTMLLastChild:";
9
+ export declare const EventAttributes = "EventAttributes:";
10
+ export declare const KeyedScopes = "KeyedScopes:";
11
+ export declare const Lifecycle = "Lifecycle:";
12
+ export declare const Promise = "Promise:";
13
+ export declare const TagVariableChange = "TagVariableChange:";
14
+ type Self = typeof import("./accessor-prefix.debug");
15
+ export type Value = Self[keyof Self];
16
+ export {};
@@ -0,0 +1,30 @@
1
+ export declare const Global = "$";
2
+ export declare const Owner = "_";
3
+ export declare const AbortControllers = "A";
4
+ export declare const AbortScopes = "B";
5
+ export declare const AwaitCounter = "O";
6
+ export declare const BranchAccessor = "C";
7
+ export declare const BranchScopes = "D";
8
+ export declare const CatchContent = "E";
9
+ export declare const ClosestBranch = "F";
10
+ export declare const ClosestBranchId = "G";
11
+ export declare const Gen = "H";
12
+ export declare const DetachedAwait = "V";
13
+ export declare const EndNode = "K";
14
+ export declare const Id = "L";
15
+ export declare const Load = "X";
16
+ export declare const LoopKey = "M";
17
+ export declare const LoopIndex = "I";
18
+ export declare const ParentBranch = "N";
19
+ export declare const PendingEffects = "J";
20
+ export declare const PendingRenders = "W";
21
+ export declare const PendingScopes = "Y";
22
+ export declare const PlaceholderBranch = "P";
23
+ export declare const PlaceholderContent = "Q";
24
+ export declare const Renderer = "R";
25
+ export declare const StartNode = "S";
26
+ export declare const TagVariable = "T";
27
+ export declare const TagVariableChange = "U";
28
+ type Self = typeof import("./accessor-prop");
29
+ export type Value = Self[keyof Self];
30
+ export {};
@@ -0,0 +1,30 @@
1
+ export declare const Global = "$global";
2
+ export declare const Owner = "_";
3
+ export declare const AbortControllers = "#AbortControllers";
4
+ export declare const AbortScopes = "#AbortScopes";
5
+ export declare const AwaitCounter = "#AwaitCounter";
6
+ export declare const BranchAccessor = "#BranchAccessor";
7
+ export declare const BranchScopes = "#BranchScopes";
8
+ export declare const CatchContent = "#CatchContent";
9
+ export declare const ClosestBranch = "#ClosestBranch";
10
+ export declare const ClosestBranchId = "#ClosestBranchId";
11
+ export declare const Gen = "#Gen";
12
+ export declare const DetachedAwait = "#DetachedAwait";
13
+ export declare const EndNode = "#EndNode";
14
+ export declare const Id = "#Id";
15
+ export declare const Load = "#Load";
16
+ export declare const LoopKey = "#LoopKey";
17
+ export declare const LoopIndex = "#LoopIndex";
18
+ export declare const ParentBranch = "#ParentBranch";
19
+ export declare const PendingEffects = "#PendingEffects";
20
+ export declare const PendingRenders = "#PendingRenders";
21
+ export declare const PendingScopes = "#PendingScopes";
22
+ export declare const PlaceholderBranch = "#PlaceholderBranch";
23
+ export declare const PlaceholderContent = "#PlaceholderContent";
24
+ export declare const Renderer = "#Renderer";
25
+ export declare const StartNode = "#StartNode";
26
+ export declare const TagVariable = "#TagVariable";
27
+ export declare const TagVariableChange = "#TagVariableChange";
28
+ type Self = typeof import("./accessor-prop.debug");
29
+ export type Value = Self[keyof Self];
30
+ export {};
@@ -0,0 +1,6 @@
1
+ export declare const ScopeInstancesAccessor = "a";
2
+ export declare const SignalIndexAccessor = "b";
3
+ export declare const Index = "c";
4
+ type Self = typeof import("./closure-signal-prop");
5
+ export type Value = Self[keyof Self];
6
+ export {};
@@ -0,0 +1,6 @@
1
+ export declare const ScopeInstancesAccessor = "scopeInstancesAccessor";
2
+ export declare const SignalIndexAccessor = "signalIndexAccessor";
3
+ export declare const Index = "index";
4
+ type Self = typeof import("./closure-signal-prop.debug");
5
+ export type Value = Self[keyof Self];
6
+ export {};
@@ -0,0 +1,9 @@
1
+ export declare const InputChecked = 0;
2
+ export declare const InputCheckedValue = 1;
3
+ export declare const InputValue = 2;
4
+ export declare const SelectValue = 3;
5
+ export declare const DetailsOrDialogOpen = 4;
6
+ export declare const None = 5;
7
+ type Self = typeof import("./controlled-type");
8
+ export type Value = Self[keyof Self];
9
+ export {};
@@ -0,0 +1,4 @@
1
+ export declare const PreviousKey = "_";
2
+ type Self = typeof import("./keyed-scopes-prop");
3
+ export type Value = Self[keyof Self];
4
+ export {};
@@ -0,0 +1,4 @@
1
+ export declare const PreviousKey = "PreviousKey:";
2
+ type Self = typeof import("./keyed-scopes-prop.debug");
3
+ export type Value = Self[keyof Self];
4
+ export {};
@@ -0,0 +1,5 @@
1
+ export declare const Value = "a";
2
+ export declare const Signal = "b";
3
+ type Self = typeof import("./load-signal-value");
4
+ export type Value = Self[keyof Self];
5
+ export {};
@@ -0,0 +1,5 @@
1
+ export declare const Value = "value";
2
+ export declare const Signal = "signal";
3
+ type Self = typeof import("./load-signal-value.debug");
4
+ export type Value = Self[keyof Self];
5
+ export {};
@@ -0,0 +1,7 @@
1
+ export declare const Element = 1;
2
+ export declare const Text = 3;
3
+ export declare const Comment = 8;
4
+ export declare const DocumentFragment = 11;
5
+ type Self = typeof import("./node-type");
6
+ export type Value = Self[keyof Self];
7
+ export {};
@@ -0,0 +1,9 @@
1
+ export declare const Key = "a";
2
+ export declare const Scope = "b";
3
+ export declare const Signal = "c";
4
+ export declare const Value = "d";
5
+ export declare const Gen = "e";
6
+ export declare const Pending = "f";
7
+ type Self = typeof import("./pending-render-prop");
8
+ export type Value = Self[keyof Self];
9
+ export {};
@@ -0,0 +1,9 @@
1
+ export declare const Key = "key";
2
+ export declare const Scope = "scope";
3
+ export declare const Signal = "signal";
4
+ export declare const Value = "value";
5
+ export declare const Gen = "gen";
6
+ export declare const Pending = "pending";
7
+ type Self = typeof import("./pending-render-prop.debug");
8
+ export type Value = Self[keyof Self];
9
+ export {};
@@ -0,0 +1,12 @@
1
+ export declare const Id = "a";
2
+ export declare const Clone = "b";
3
+ export declare const Setup = "c";
4
+ export declare const Params = "d";
5
+ export declare const Owner = "e";
6
+ export declare const Accessor = "f";
7
+ export declare const LocalClosures = "g";
8
+ export declare const LocalClosureValues = "h";
9
+ export declare const Embed = "i";
10
+ type Self = typeof import("./renderer-prop");
11
+ export type Value = Self[keyof Self];
12
+ export {};
@@ -0,0 +1,12 @@
1
+ export declare const Id = "id";
2
+ export declare const Clone = "clone";
3
+ export declare const Setup = "setup";
4
+ export declare const Params = "params";
5
+ export declare const Owner = "owner";
6
+ export declare const Accessor = "accessor";
7
+ export declare const LocalClosures = "localClosures";
8
+ export declare const LocalClosureValues = "localClosureValues";
9
+ export declare const Embed = "embed";
10
+ type Self = typeof import("./renderer-prop.debug");
11
+ export type Value = Self[keyof Self];
12
+ export {};
@@ -0,0 +1,10 @@
1
+ export declare const Node = "*";
2
+ export declare const BranchStart = "[";
3
+ export declare const BranchEnd = "]";
4
+ export declare const BranchEndNativeTag = "'";
5
+ export declare const BranchEndSingleNode = "|";
6
+ export declare const BranchEndOnlyChildInParent = ")";
7
+ export declare const BranchEndSingleNodeOnlyChildInParent = "}";
8
+ type Self = typeof import("./resume-symbol");
9
+ export type Value = Self[keyof Self];
10
+ export {};
@@ -0,0 +1,17 @@
1
+ export declare const Get = 32;
2
+ export declare const Replace = 37;
3
+ export declare const EndChild = 38;
4
+ export declare const BeginChild = 47;
5
+ export declare const BeginChildWithVar = 48;
6
+ export declare const DynamicTagWithVar = 49;
7
+ export declare const Next = 67;
8
+ export declare const NextEnd = 91;
9
+ export declare const Over = 97;
10
+ export declare const OverEnd = 106;
11
+ export declare const Out = 107;
12
+ export declare const OutEnd = 116;
13
+ export declare const Multiplier = 117;
14
+ export declare const MultiplierEnd = 126;
15
+ type Self = typeof import("./walk-code");
16
+ export type Value = Self[keyof Self];
17
+ export {};
@@ -0,0 +1,7 @@
1
+ export declare const Next = 20;
2
+ export declare const Over = 10;
3
+ export declare const Out = 10;
4
+ export declare const Multiplier = 10;
5
+ type Self = typeof import("./walk-range-size");
6
+ export type Value = Self[keyof Self];
7
+ export {};
@@ -1,6 +1,11 @@
1
1
  import type { PendingRender } from "../dom/queue";
2
2
  import type { Renderer as ClientRenderer, Renderer } from "../dom/renderer";
3
3
  import type { AccessorProp } from "./accessor.debug";
4
+ import * as ControlledType from "./constants/controlled-type";
5
+ import * as NodeType from "./constants/node-type";
6
+ import * as ResumeSymbol from "./constants/resume-symbol";
7
+ import * as WalkCode from "./constants/walk-code";
8
+ import * as WalkRangeSize from "./constants/walk-range-size";
4
9
  export type Falsy = undefined | null | false | 0 | "";
5
10
  export interface BranchScope extends Scope {
6
11
  [AccessorProp.StartNode]: ChildNode;
@@ -27,49 +32,20 @@ export interface Scope {
27
32
  [x: `___${string}`]: never;
28
33
  [x: string | number]: any;
29
34
  }
30
- export declare enum ResumeSymbol {
31
- Node = "*",
32
- BranchStart = "[",
33
- BranchEnd = "]",
34
- BranchEndNativeTag = "'",
35
- BranchEndSingleNode = "|",
36
- BranchEndOnlyChildInParent = ")",
37
- BranchEndSingleNodeOnlyChildInParent = "}"
38
- }
35
+ type ResumeSymbol = ResumeSymbol.Value;
36
+ export { ResumeSymbol };
39
37
  export interface AwaitCounter {
40
38
  m?: (effects: unknown[]) => unknown[];
41
39
  i: number;
42
40
  c: () => void | 1;
43
41
  }
44
42
  export { AccessorPrefix, AccessorProp, ClosureSignalProp, KeyedScopesProp, PendingRenderProp, RendererProp, } from "./accessor.debug";
45
- export declare enum NodeType {
46
- Element = 1,
47
- Text = 3,
48
- Comment = 8,
49
- DocumentFragment = 11
50
- }
51
- export declare enum WalkCode {
52
- Get = 32,
53
- Replace = 37,
54
- EndChild = 38,
55
- BeginChild = 47,
56
- BeginChildWithVar = 48,
57
- DynamicTagWithVar = 49,
58
- Next = 67,
59
- NextEnd = 91,
60
- Over = 97,
61
- OverEnd = 106,
62
- Out = 107,
63
- OutEnd = 116,
64
- Multiplier = 117,
65
- MultiplierEnd = 126
66
- }
67
- export declare enum WalkRangeSize {
68
- Next = 20,// 67 through 91
69
- Over = 10,// 97 through 106
70
- Out = 10,// 107 through 116
71
- Multiplier = 10
72
- }
43
+ type NodeType = NodeType.Value;
44
+ export { NodeType };
45
+ type WalkCode = WalkCode.Value;
46
+ export { WalkCode };
47
+ type WalkRangeSize = WalkRangeSize.Value;
48
+ export { WalkRangeSize };
73
49
  export type Accessor = string;
74
50
  export type EncodedAccessor = number | string;
75
51
  export interface $Global {
@@ -97,11 +73,5 @@ export interface MountedTemplate {
97
73
  export type RenderedTemplate = PromiseLike<string> & AsyncIterable<string> & {
98
74
  toReadable(): ReadableStream<Uint8Array<ArrayBufferLike>>;
99
75
  };
100
- export declare enum ControlledType {
101
- InputChecked = 0,
102
- InputCheckedValue = 1,
103
- InputValue = 2,
104
- SelectValue = 3,
105
- DetailsOrDialogOpen = 4,
106
- None = 5
107
- }
76
+ type ControlledType = ControlledType.Value;
77
+ export { ControlledType };