aberdeen 1.18.1 → 1.19.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.
Files changed (156) hide show
  1. package/README.md +9 -0
  2. package/dist/src/aberdeen.d.ts +29 -0
  3. package/{dist-docs/assets/aberdeen/aberdeen.js → dist/src/aberdeen.dev.js} +796 -21
  4. package/dist/src/aberdeen.dev.js.map +12 -0
  5. package/dist/src/aberdeen.js +79 -19
  6. package/dist/src/aberdeen.js.map +3 -3
  7. package/dist/src/devtools.d.ts +26 -0
  8. package/dist/tests/fakedom.js +20 -3
  9. package/dist/tests/fakedom.js.map +3 -3
  10. package/dist/tests/helpers.js +20 -3
  11. package/dist/tests/helpers.js.map +3 -3
  12. package/html-to-aberdeen +9 -5
  13. package/package.json +17 -10
  14. package/skill/A.md +127 -0
  15. package/skill/Dispatcher.md +51 -0
  16. package/skill/OPAQUE.md +15 -0
  17. package/skill/PromiseProxy.md +25 -0
  18. package/skill/Route.md +50 -0
  19. package/skill/SKILL.md +272 -156
  20. package/skill/applyCanon.md +20 -0
  21. package/skill/applyPrediction.md +15 -0
  22. package/skill/back.md +11 -0
  23. package/skill/clean.md +43 -0
  24. package/skill/clone.md +15 -0
  25. package/skill/copy.md +40 -0
  26. package/skill/count.md +32 -0
  27. package/skill/cssVars.md +15 -0
  28. package/skill/darkMode.md +26 -0
  29. package/skill/derive.md +56 -0
  30. package/skill/developer-tools.md +23 -0
  31. package/skill/disableCreateDestroy.md +11 -0
  32. package/skill/dump.md +37 -0
  33. package/skill/freeze.md +20 -0
  34. package/skill/full-example-multi-page-app.md +146 -0
  35. package/skill/go.md +25 -0
  36. package/skill/grow.md +13 -0
  37. package/skill/html-to-aberdeen.md +9 -0
  38. package/skill/insertCss.md +79 -0
  39. package/skill/insertGlobalCss.md +68 -0
  40. package/skill/interceptLinks.md +19 -0
  41. package/skill/invertString.md +32 -0
  42. package/skill/isEmpty.md +38 -0
  43. package/skill/map.md +16 -0
  44. package/skill/matchCurrent.md +27 -0
  45. package/skill/merge.md +27 -0
  46. package/skill/mount.md +48 -0
  47. package/skill/multiMap.md +15 -0
  48. package/skill/onEach.md +14 -0
  49. package/skill/partition.md +15 -0
  50. package/skill/peek.md +36 -0
  51. package/skill/persistScroll.md +13 -0
  52. package/skill/proxy.md +11 -0
  53. package/skill/push.md +13 -0
  54. package/skill/ref.md +39 -0
  55. package/skill/runQueue.md +34 -0
  56. package/skill/setErrorHandler.md +48 -0
  57. package/skill/setLog.md +9 -0
  58. package/skill/setSpacingCssVars.md +31 -0
  59. package/skill/shrink.md +13 -0
  60. package/skill/unmountAll.md +9 -0
  61. package/skill/unproxy.md +43 -0
  62. package/skill/up.md +13 -0
  63. package/src/aberdeen.ts +220 -82
  64. package/src/devtools.ts +685 -0
  65. package/dist-docs/.nojekyll +0 -1
  66. package/dist-docs/Tutorial/index.html +0 -305
  67. package/dist-docs/aberdeen/A/index.html +0 -115
  68. package/dist-docs/aberdeen/CUSTOM_DUMP/index.html +0 -7
  69. package/dist-docs/aberdeen/NO_COPY/index.html +0 -2
  70. package/dist-docs/aberdeen/OPAQUE/index.html +0 -12
  71. package/dist-docs/aberdeen/PromiseProxy/index.html +0 -8
  72. package/dist-docs/aberdeen/clean/index.html +0 -11
  73. package/dist-docs/aberdeen/clone/index.html +0 -5
  74. package/dist-docs/aberdeen/copy/index.html +0 -22
  75. package/dist-docs/aberdeen/count/index.html +0 -7
  76. package/dist-docs/aberdeen/cssVars/index.html +0 -11
  77. package/dist-docs/aberdeen/darkMode/index.html +0 -9
  78. package/dist-docs/aberdeen/default/index.html +0 -341
  79. package/dist-docs/aberdeen/derive/index.html +0 -18
  80. package/dist-docs/aberdeen/disableCreateDestroy/index.html +0 -6
  81. package/dist-docs/aberdeen/dump/index.html +0 -11
  82. package/dist-docs/aberdeen/index.html +0 -54
  83. package/dist-docs/aberdeen/insertCss/index.html +0 -30
  84. package/dist-docs/aberdeen/insertGlobalCss/index.html +0 -19
  85. package/dist-docs/aberdeen/invertString/index.html +0 -13
  86. package/dist-docs/aberdeen/isEmpty/index.html +0 -12
  87. package/dist-docs/aberdeen/map/index.html +0 -26
  88. package/dist-docs/aberdeen/merge/index.html +0 -11
  89. package/dist-docs/aberdeen/mount/index.html +0 -17
  90. package/dist-docs/aberdeen/multiMap/index.html +0 -28
  91. package/dist-docs/aberdeen/onEach/index.html +0 -19
  92. package/dist-docs/aberdeen/partition/index.html +0 -36
  93. package/dist-docs/aberdeen/peek/index.html +0 -40
  94. package/dist-docs/aberdeen/proxy/index.html +0 -35
  95. package/dist-docs/aberdeen/ref/index.html +0 -13
  96. package/dist-docs/aberdeen/runQueue/index.html +0 -13
  97. package/dist-docs/aberdeen/setErrorHandler/index.html +0 -16
  98. package/dist-docs/aberdeen/setSpacingCssVars/index.html +0 -8
  99. package/dist-docs/aberdeen/unmountAll/index.html +0 -5
  100. package/dist-docs/aberdeen/unproxy/index.html +0 -11
  101. package/dist-docs/assets/aberdeen/aberdeen.d.ts +0 -961
  102. package/dist-docs/assets/aberdeen/aberdeen.js.map +0 -11
  103. package/dist-docs/assets/aberdeen/dispatcher.d.ts +0 -57
  104. package/dist-docs/assets/aberdeen/dispatcher.js +0 -66
  105. package/dist-docs/assets/aberdeen/dispatcher.js.map +0 -10
  106. package/dist-docs/assets/aberdeen/helpers/reverseSortedSet.d.ts +0 -96
  107. package/dist-docs/assets/aberdeen/prediction.d.ts +0 -33
  108. package/dist-docs/assets/aberdeen/prediction.js +0 -112
  109. package/dist-docs/assets/aberdeen/prediction.js.map +0 -10
  110. package/dist-docs/assets/aberdeen/route.d.ts +0 -137
  111. package/dist-docs/assets/aberdeen/route.js +0 -287
  112. package/dist-docs/assets/aberdeen/route.js.map +0 -10
  113. package/dist-docs/assets/aberdeen/transitions.d.ts +0 -18
  114. package/dist-docs/assets/aberdeen/transitions.js +0 -47
  115. package/dist-docs/assets/aberdeen/transitions.js.map +0 -10
  116. package/dist-docs/assets/custom.js +0 -573
  117. package/dist-docs/assets/favicon.png +0 -0
  118. package/dist-docs/assets/hierarchy.js +0 -1
  119. package/dist-docs/assets/highlight.css +0 -134
  120. package/dist-docs/assets/icons.js +0 -18
  121. package/dist-docs/assets/icons.svg +0 -1
  122. package/dist-docs/assets/main.js +0 -60
  123. package/dist-docs/assets/navigation.js +0 -1
  124. package/dist-docs/assets/search.js +0 -1
  125. package/dist-docs/assets/style.css +0 -1640
  126. package/dist-docs/dispatcher/Dispatcher/index.html +0 -21
  127. package/dist-docs/dispatcher/MATCH_FAILED/index.html +0 -2
  128. package/dist-docs/dispatcher/MATCH_REST/index.html +0 -2
  129. package/dist-docs/dispatcher/index.html +0 -4
  130. package/dist-docs/hierarchy.html +0 -1
  131. package/dist-docs/index.html +0 -61
  132. package/dist-docs/media/CHANGELOG.md +0 -260
  133. package/dist-docs/modules.html +0 -1
  134. package/dist-docs/prediction/applyCanon/index.html +0 -13
  135. package/dist-docs/prediction/applyPrediction/index.html +0 -8
  136. package/dist-docs/prediction/index.html +0 -9
  137. package/dist-docs/route/Route/index.html +0 -23
  138. package/dist-docs/route/back/index.html +0 -4
  139. package/dist-docs/route/current/index.html +0 -2
  140. package/dist-docs/route/go/index.html +0 -14
  141. package/dist-docs/route/index.html +0 -15
  142. package/dist-docs/route/interceptLinks/index.html +0 -8
  143. package/dist-docs/route/matchCurrent/index.html +0 -10
  144. package/dist-docs/route/persistScroll/index.html +0 -6
  145. package/dist-docs/route/push/index.html +0 -6
  146. package/dist-docs/route/setLog/index.html +0 -3
  147. package/dist-docs/route/up/index.html +0 -5
  148. package/dist-docs/sitemap.xml +0 -239
  149. package/dist-docs/transitions/grow/index.html +0 -6
  150. package/dist-docs/transitions/index.html +0 -5
  151. package/dist-docs/transitions/shrink/index.html +0 -6
  152. package/skill/aberdeen.md +0 -4584
  153. package/skill/dispatcher.md +0 -129
  154. package/skill/prediction.md +0 -73
  155. package/skill/route.md +0 -322
  156. package/skill/transitions.md +0 -59
package/skill/A.md ADDED
@@ -0,0 +1,127 @@
1
+ ## A · function
2
+
3
+ The core function for building reactive user interfaces in Aberdeen. It creates and inserts new DOM elements
4
+ and sets attributes/properties/event listeners on DOM elements. It does so in a reactive way, meaning that
5
+ changes will be (mostly) undone when the current *scope* is destroyed or will be re-execute.
6
+
7
+ **Signature:** `(...args: any[]) => Element`
8
+
9
+ **Parameters:**
10
+
11
+ - `args: any[]` - - Any number of arguments can be given. How they're interpreted depends on their types:
12
+
13
+ ### String arguments
14
+ Strings can be used to create and insert new elements, set classnames for the *current* element, and add text to the current element.
15
+ The format of a string is: (**tag** | `.` **class** | **key**[=:]**val** | **key**[=:]"**val containing spaces**")* ('#' **text** | **key**[=:])?
16
+
17
+ So a string may consist of any number of...
18
+ - **tag** elements, like `h1` or `div`. These elements are created, added to the *current* element, and become the new *current* element for the rest of this `A` function execution.
19
+ - CSS classes prefixed by `.` characters. These classes will be added to the *current* element. Optionally, CSS classes can be appended to a **tag** without a space. So both `div.myclass` and `div .myclass` are valid and do the same thing.
20
+ - Property key/value pairs, like `type=password`, `placeholder="Your name"` or `data-id=123`. When the value contains spaces, it needs to be quoted with either "double quotes", 'single quotes' or \`backticks\`. Quotes within quoted values cannot be escaped (see the next rule for a solution). Key/value pairs will be handled according to *Property rules* below, but with the caveat that values can only be strings.
21
+ - CSS key/value pairs using two syntaxes:
22
+ - **Short form** `key:value` (no space after colon): The value ends at the next whitespace. Example: `m:$3 bg:red r:8px`
23
+ - **Long form** `key: value;` (space after colon): The value continues until a semicolon. Example: `box-shadow: 2px 0 6px black; transition: all 0.3s ease;`
24
+
25
+ Both forms support CSS shortcuts (see below). You can mix them: `m:$3 box-shadow: 0 2px 4px rgba(0,0,0,0.2); bg:$cardBg`
26
+ The elements must be separated by spaces, except before a `.cssClass` if it is preceded by either **tag** or another CSS class.
27
+
28
+ And a string may end in...
29
+ - A '#' followed by text, which will be added as a `TextNode` to the *current* element. The text ranges til the end of the string, and may contain any characters, including spaces and quotes.
30
+ - A key followed by an '=' character, in which case the value is expected as a separate argument. The key/value pair is set according to the *Property rules* below. This is useful when the value is not a string or contains spaces or user data. Example: `A('button text="Click me" click=', () => alert('Clicked!'))` or `A('input.value=', someUserData, "placeholder=", "Type your stuff")`. In case the value is a proxied object, its `.value` property will be applied reactively without needing to rerender the parent scope.
31
+ - A key followed by a ':' character (with no value), in which case the value is expected as a separate argument. The value is treated as a CSS value to be set inline on the *current* element. Example: `A('div margin-top:', someValueInPx)`. In case the value is a proxied object, its `.value` property will be applied reactively without needing to rerender the parent scope.
32
+
33
+ ### Function arguments
34
+ When a function (without arguments nor a return value) is passed in, it will be reactively executed in its own observer scope, preserving the *current* element. So any `A()` invocations within this function will add child elements to or set properties on that element. If the function reads observable data, and that data is changed later on, the function we re-execute (after side effects, such as DOM modifications through `A`, have been cleaned - see also `clean`).
35
+
36
+ ### Object arguments
37
+ When an object is passed in, its key-value pairs are used to modify the *current* element according to the *Property rules* below, *unless* the key starts with a `$` character, in which case that character is stripped of and the key/value pair is treated as a CSS property, subject to the *CSS shortcuts* below. In case a value is a proxied object, its `.value` property will be applied reactively without needing to rerender the parent scope. In most cases, the string notation (`key=` and `key:`) is preferred over this object notation, for readability.
38
+
39
+ ### DOM node arguments
40
+ When a DOM Node (Element or TextNode) is passed in, it is added as a child to the *current* element. If the Node is an Element, it becomes the new *current* element for the rest of this `A` function execution.
41
+
42
+ ### Property rules
43
+ - **Attribute:** The common case is setting the value as an HTML attribute named key. For example `A('input placeholder=Name')` results in `<input placeholder="Name">`.
44
+ - **Event listener:** If the value is a `function` it is set as an event listener for the event with the name given by the key. For example: A('button text=Press! click=', () => alert('Clicked!'))`. The event listener will be removed when the current scope is destroyed.
45
+ - **DOM property:** When the value is a boolean, or the key is `"value"` or `"selectedIndex"`, it is set on the `current` element as a DOM property instead of an HTML attribute. For example `A('checked=', true)` would do `el.checked = true` for the *current* element.
46
+ - **Conditional CSS class:** If the key starts with a `.` character, its either added to or removed from the *current* element as a CSS class, based on the truthiness of the value. So `A('.hidden=', isHidden)` would toggle the `hidden` CSS class. This only works if the `=` is the last character of the string, and the next argument is the value. Its common for the value to be a proxied object, in which case its `.value` is reactively applied without needing to rerender the parent scope.
47
+ - **Create transition:** When the key is `"create"`, the value will be added as a CSS class to the *current* element immediately, and then removed right after the browser has finished doing a layout pass. This behavior only triggers when the scope setting the `create` is the top-level scope being (re-)run. This allows for creation transitions, without triggering the transitions for deeply nested elements being drawn as part of a larger component. The string may also contain multiple dot-separated CSS classes, such as `.fade.grow`. The initial dot is optional. Alternatively, to allow for more complex transitions, the value may be a function that receives the `HTMLElement` being created as its only argument. It is *only* called if this is the top-level element being created in this scope run. See `transitions.ts` in the Aberdeen source code for some examples.
48
+ - **Destroy transition:** When the key is `"destroy"` the value will be used to apply a CSS transition if the *current* element is later on removed from the DOM and is the top-level element to be removed. This happens as follows: actual removal from the DOM is delayed by 2 seconds, and in the mean-time the value string is added as a CSS class to the element, allowing for a deletion transition. The string may also contain multiple dot-separated CSS classes, such as `.fade.shrink`. The initial dot is optional. Alternatively, to allow for more complex transitions, the value may be a function that receives the `HTMLElement` to be removed from the DOM as its only argument. This function may perform any transitions and is then itself responsible for eventually removing the element from the DOM. See `transitions.ts` in the Aberdeen source code for some examples.
49
+ - **Two-way data binding:** When the key is `"bind"` a two-way binding between the `.value` property of the given proxied object, and the *current* input element (`<input>`, `<select>` or `<textarea>`) is created. This is often used together with `ref`, in order to use properties other than `.value`.
50
+ - **Text:**: If the key is `"text"`, the value will be appended as a `TextNode` to the *current* element. The same can also be done with the `#` syntax in string arguments, though `text=` allows additional properties to come after in the same string: `A('button text=Hello click=', alert)`.
51
+ - **Unsafe HTML:** When the key is `"html"`, the value will be added as HTML to the *current* element. This should only be used in exceptional situations. Beware of XSS! Never use this with untrusted user data.
52
+ - **Rich text:** When the key is `"rich"`, the value is parsed as simple markdown-like syntax and rendered as inline elements. Supports `*italic*`, `**bold**`, `` `code` ``, and `[link text](/path)`. All text content is safely escaped, making it suitable for user data (though links should be validated if untrusted). Example: `A('p rich="Click *here* for **more** info")`.
53
+
54
+ ### CSS shortcuts
55
+ For conciseness, Aberdeen supports some CSS shortcuts when setting CSS properties.
56
+ | Shortcut | Expands to |
57
+ |----------|------------|
58
+ | `m`, `mt`, `mb`, `ml`, `mr` | `margin`, `margin-top`, `margin-bottom`, `margin-left`, `margin-right` |
59
+ | `mv`, `mh` | Vertical (top+bottom) or horizontal (left+right) margins |
60
+ | `p`, `pt`, `pb`, `pl`, `pr` | `padding`, `padding-top`, `padding-bottom`, `padding-left`, `padding-right` |
61
+ | `pv`, `ph` | Vertical or horizontal padding |
62
+ | `w`, `h` | `width`, `height` |
63
+ | `bg` | `background` |
64
+ | `fg` | `color` |
65
+ | `r` | `border-radius` |
66
+
67
+ Also, when the value is a string starting with `$`, it is treated as a reference to a CSS variable, expanding to `var(--variableName)`. For numeric variable names (which can't be used directly as CSS custom property names), Aberdeen prefixes them with `m`, so `$3` expands to `var(--m3)`. This is primarily intended for use with `setSpacingCssVars`, which initializes spacing variables named `0` through `12` with an exponential spacing scale.
68
+
69
+ To *set* a CSS custom property inline on an element, use a `--name` or (symmetrically with the `$`-reference syntax above) a `$name` key. For example `A('div --primary:red')` and `A('div $primary:red')` both set `--primary` to `red`.
70
+
71
+ **Returns:** The most inner DOM element that was created (not counting text nodes nor elements created by content functions), or the current element if no new element was created. You should normally not need to use the return value - use this function's DOM manipulation abilities instead. One valid use case is when integrating with non-Aberdeen code that requires a reference to a DOM element.
72
+
73
+ **Examples:**
74
+
75
+ Create Element
76
+ ```typescript
77
+ A('button.secondary.outline text=Submit color:red disabled=', false, 'click=', () => console.log('Clicked!'));
78
+ ```
79
+
80
+ We want to set `disabled` as a property instead of an attribute, so we must use the `key=` syntax in order to provide
81
+ `false` as a boolean instead of a string.
82
+
83
+ Create Nested Elements
84
+ ```typescript
85
+ let inputElement: Element = A('label text="Click me" input type=checkbox');
86
+ // You should usually not touch raw DOM elements, unless when integrating
87
+ // with non-Aberdeen code.
88
+ console.log('DOM element:', inputElement);
89
+ ```
90
+
91
+ Content Functions & Reactive Scope
92
+ ```typescript
93
+ const $state = A.proxy({ count: 0 });
94
+ A('div', () => { // Outer element
95
+ // This scope re-renders when $state.count changes
96
+ A(`p#Count is ${$state.count}`);
97
+ A('button text=Increment click=', () => $state.count++);
98
+ });
99
+ ```
100
+
101
+ Two-way Binding
102
+ ```typescript
103
+ const $user = A.proxy({ name: '' });
104
+ A('input placeholder=Name bind=', A.ref($user, 'name'));
105
+ A('h3', () => { // Reactive scope
106
+ A(`#Hello ${$user.name || 'stranger'}`);
107
+ });
108
+ ```
109
+
110
+ Conditional Rendering
111
+ ```typescript
112
+ const $show = A.proxy(false);
113
+ A('button click=', () => $show.value = !$show.value, () => A($show.value ? '#Hide' : '#Show'));
114
+ A(() => { // Reactive scope
115
+ if ($show.value) {
116
+ A('p#Details are visible!');
117
+ }
118
+ });
119
+ ```
120
+
121
+ Proxied objects as values
122
+ ```typescript
123
+ const $myColor = A.proxy('red');
124
+ A('p text="The color is " text=', $myColor, 'click=', () => $myColor.value = 'yellow')
125
+ // Clicking the text will cause it to change color without recreating the <p> itself
126
+ ```
127
+ This is often used together with `ref`, in order to use properties other than `.value`.
@@ -0,0 +1,51 @@
1
+ ## Dispatcher · class
2
+
3
+ Simple route matcher and dispatcher.
4
+
5
+ Example usage:
6
+
7
+ ```ts
8
+ import * as route from 'aberdeen/route';
9
+ import { Dispatcher, MATCH_REST } from 'aberdeen/dispatcher';
10
+
11
+ const dispatcher = new Dispatcher();
12
+
13
+ dispatcher.addRoute("user", Number, "stream", String, (id, stream) => {
14
+ console.log(`User ${id}, stream ${stream}`);
15
+ });
16
+
17
+ dispatcher.dispatch(["user", "42", "stream", "music"]);
18
+ // Logs: User 42, stream music
19
+
20
+ dispatcher.addRoute("search", MATCH_REST, (terms: string[]) => {
21
+ console.log("Search terms:", terms);
22
+ });
23
+
24
+ dispatcher.dispatch(["search", "classical", "piano"]);
25
+ // Logs: Search terms: [ 'classical', 'piano' ]
26
+ ```
27
+
28
+ ### dispatcher.addRoute · method
29
+
30
+ Add a route with matchers and a handler function.
31
+
32
+ **Signature:** `<T extends Matcher[], H extends (...args: ParamsFromMatchers<T>) => void>(...args: [...T, H]) => void`
33
+
34
+ **Parameters:**
35
+
36
+ - `args: [...T, H]` - An array of matchers followed by a handler function. Each matcher can be:
37
+ - A string: matches exactly that string.
38
+ - A function: takes a string segment and returns a value (of any type) if it matches, or `MATCH_FAILED` if it doesn't match. The return value (if not `MATCH_FAILED` and not `NaN`) is passed as a parameter to the handler function. The standard JavaScript functions `Number` and `String` can be used to match numeric and string segments respectively.
39
+ - The special `MATCH_REST` symbol: matches the rest of the segments as an array of strings. Only one `MATCH_REST` is allowed.
40
+
41
+ ### dispatcher.dispatch · method
42
+
43
+ Dispatches the given segments to the first route handler that matches.
44
+
45
+ **Signature:** `(segments: string[]) => boolean`
46
+
47
+ **Parameters:**
48
+
49
+ - `segments: string[]` - Array of string segments to match against the added routes. When using this class with the Aberdeen `route` module, one would typically pass `route.current.p`.
50
+
51
+ **Returns:** True if a matching route was found and handled, false otherwise.
@@ -0,0 +1,15 @@
1
+ ## OPAQUE · constant
2
+
3
+ A symbol that controls how Aberdeen handles an object in copy operations and proxy wrapping.
4
+
5
+ The **presence** of this symbol (regardless of its value) prevents deep-copying: the object is
6
+ stored and passed by reference in `clone` and `copy`.
7
+
8
+ The **value** of the symbol controls proxy wrapping when the object is read from reactive state:
9
+ - **Truthy** (e.g. `true`): the object is fully opaque — it is not wrapped in a proxy, so its
10
+ properties are not observable. Use this for objects that break when proxied (e.g. class instances
11
+ with internal slots, Promises) or that must be invisible to Aberdeen's reactive system.
12
+ - **Falsy** (e.g. `false`): the object is still wrapped in a proxy, so reads on its properties
13
+ create reactive dependencies as normal — only deep-copying is suppressed.
14
+
15
+ **Value:** `unique symbol`
@@ -0,0 +1,25 @@
1
+ ## PromiseProxy · interface
2
+
3
+ When `proxy` is called with a Promise, the returned object has this shape.
4
+
5
+ **Type Parameters:**
6
+
7
+ - `T`
8
+
9
+ ### promiseProxy.busy · member
10
+
11
+ True if the promise is still pending, false if it has resolved or rejected.
12
+
13
+ **Type:** `boolean`
14
+
15
+ ### promiseProxy.value · member
16
+
17
+ If the promise has resolved, this contains the resolved value.
18
+
19
+ **Type:** `T`
20
+
21
+ ### promiseProxy.error · member
22
+
23
+ If the promise has rejected, this contains the rejection error.
24
+
25
+ **Type:** `any`
package/skill/Route.md ADDED
@@ -0,0 +1,50 @@
1
+ ## Route · interface
2
+
3
+ The class for the global `route` object.
4
+
5
+ ### route.path · member
6
+
7
+ The current path of the URL as a string. For instance `"/"` or `"/users/123/feed"`. Paths are normalized to always start with a `/` and never end with a `/` (unless it's the root path).
8
+
9
+ **Type:** `string`
10
+
11
+ ### route.p · member
12
+
13
+ An convenience array containing path segments, mapping to `path`. For instance `[]` (for `"/"`) or `['users', '123', 'feed']` (for `"/users/123/feed"`).
14
+
15
+ **Type:** `string[]`
16
+
17
+ ### route.hash · member
18
+
19
+ The hash fragment including the leading `#`, or an empty string. For instance `"#my_section"` or `""`.
20
+
21
+ **Type:** `string`
22
+
23
+ ### route.search · member
24
+
25
+ The query string interpreted as search parameters. So `"a=x&b=y"` becomes `{a: "x", b: "y"}`.
26
+
27
+ **Type:** `Record<string, string>`
28
+
29
+ ### route.state · member
30
+
31
+ An object to be used for any additional data you want to associate with the current page. Data should be JSON-compatible.
32
+
33
+ **Type:** `Record<string, any>`
34
+
35
+ ### route.depth · member
36
+
37
+ The navigation depth of the current session. Starts at 1. Writing to this property has no effect.
38
+
39
+ **Type:** `number`
40
+
41
+ ### route.nav · member
42
+
43
+ The navigation action that got us to this page. Writing to this property has no effect.
44
+ - `"load"`: An initial page load.
45
+ - `"back"` or `"forward"`: When we navigated backwards or forwards in the stack.
46
+ - `"go"`: When we added a new page on top of the stack.
47
+ - `"push"`: When we added a new page on top of the stack, merging with the current page.
48
+ Mostly useful for page transition animations. Writing to this property has no effect.
49
+
50
+ **Type:** `NavType`