aberdeen 2.0.0 → 2.0.1
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/dist/src/route.d.ts +8 -8
- package/dist/src/route.js +57 -64
- package/dist/src/route.js.map +3 -3
- package/dist/src/server.d.ts +2 -2
- package/dist/src/server.js.map +1 -1
- package/dist-docs/Tutorial/index.html +2 -2
- package/dist-docs/aberdeen/Aberdeen/index.html +31 -31
- package/dist-docs/aberdeen/InitOptions/index.html +3 -3
- package/dist-docs/aberdeen/KeyToString/index.html +2 -2
- package/dist-docs/aberdeen/PromiseProxy/index.html +5 -5
- package/dist-docs/aberdeen/SortKeyType/index.html +2 -2
- package/dist-docs/aberdeen/TargetType/index.html +2 -2
- package/dist-docs/aberdeen/ValueRef/index.html +2 -2
- package/dist-docs/aberdeen/WindowLike/index.html +3 -3
- package/dist-docs/aberdeen/createA/index.html +2 -2
- package/dist-docs/aberdeen/index.html +2 -2
- package/dist-docs/assets/aberdeen/route.d.ts +8 -8
- package/dist-docs/assets/aberdeen/route.js +57 -64
- package/dist-docs/assets/aberdeen/route.js.map +3 -3
- package/dist-docs/assets/aberdeen/server.d.ts +2 -2
- package/dist-docs/assets/aberdeen/server.js.map +1 -1
- package/dist-docs/assets/navigation.js +1 -1
- package/dist-docs/assets/search.js +1 -1
- package/dist-docs/dispatcher/Dispatcher/index.html +4 -4
- package/dist-docs/dispatcher/MATCH_FAILED/index.html +2 -2
- package/dist-docs/dispatcher/MATCH_REST/index.html +2 -2
- package/dist-docs/dispatcher/index.html +2 -2
- package/dist-docs/hierarchy.html +1 -1
- package/dist-docs/index-1/index.html +2 -2
- package/dist-docs/index.html +2 -2
- package/dist-docs/media/CHANGELOG.md +1 -1
- package/dist-docs/modules.html +1 -1
- package/dist-docs/prediction/applyCanon/index.html +2 -2
- package/dist-docs/prediction/applyPrediction/index.html +2 -2
- package/dist-docs/prediction/index.html +2 -2
- package/dist-docs/route/RouteApi/index.html +14 -14
- package/dist-docs/route/{Route → RouteState}/index.html +9 -9
- package/dist-docs/route/{init → createRoute}/index.html +2 -2
- package/dist-docs/route/index.html +4 -4
- package/dist-docs/server/RenderToStringOptions/index.html +4 -4
- package/dist-docs/server/RenderToStringResult/index.html +4 -4
- package/dist-docs/server/index.html +2 -2
- package/dist-docs/server/renderToString/index.html +2 -2
- package/dist-docs/sitemap.xml +36 -36
- package/dist-docs/transitions/grow/index.html +2 -2
- package/dist-docs/transitions/index.html +2 -2
- package/dist-docs/transitions/shrink/index.html +2 -2
- package/package.json +1 -1
- package/skill/aberdeen.md +45 -45
- package/skill/dispatcher.md +6 -6
- package/skill/prediction.md +3 -3
- package/skill/route.md +90 -90
- package/skill/transitions.md +3 -3
- package/src/route.ts +295 -319
- package/src/server.ts +2 -2
package/skill/dispatcher.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[**Aberdeen v2.0.
|
|
1
|
+
[**Aberdeen v2.0.1**](README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
### Dispatcher
|
|
12
12
|
|
|
13
|
-
Defined in: [dispatcher.ts:61](https://github.com/vanviegen/aberdeen/blob/
|
|
13
|
+
Defined in: [dispatcher.ts:61](https://github.com/vanviegen/aberdeen/blob/b53eddf1a1a2f6ec80ec8518a4cec30e65aa9b96/src/dispatcher.ts#L61)
|
|
14
14
|
|
|
15
15
|
Simple route matcher and dispatcher.
|
|
16
16
|
|
|
@@ -43,7 +43,7 @@ dispatcher.dispatch(["search", "classical", "piano"]);
|
|
|
43
43
|
|
|
44
44
|
> **addRoute**\<`T`, `H`\>(...`args`): `void`
|
|
45
45
|
|
|
46
|
-
Defined in: [dispatcher.ts:73](https://github.com/vanviegen/aberdeen/blob/
|
|
46
|
+
Defined in: [dispatcher.ts:73](https://github.com/vanviegen/aberdeen/blob/b53eddf1a1a2f6ec80ec8518a4cec30e65aa9b96/src/dispatcher.ts#L73)
|
|
47
47
|
|
|
48
48
|
Add a route with matchers and a handler function.
|
|
49
49
|
|
|
@@ -80,7 +80,7 @@ An array of matchers followed by a handler function. Each matcher can be:
|
|
|
80
80
|
|
|
81
81
|
> **dispatch**(`segments`): `boolean`
|
|
82
82
|
|
|
83
|
-
Defined in: [dispatcher.ts:94](https://github.com/vanviegen/aberdeen/blob/
|
|
83
|
+
Defined in: [dispatcher.ts:94](https://github.com/vanviegen/aberdeen/blob/b53eddf1a1a2f6ec80ec8518a4cec30e65aa9b96/src/dispatcher.ts#L94)
|
|
84
84
|
|
|
85
85
|
Dispatches the given segments to the first route handler that matches.
|
|
86
86
|
|
|
@@ -104,7 +104,7 @@ True if a matching route was found and handled, false otherwise.
|
|
|
104
104
|
|
|
105
105
|
> `const` **MATCH\_FAILED**: unique `symbol`
|
|
106
106
|
|
|
107
|
-
Defined in: [dispatcher.ts:4](https://github.com/vanviegen/aberdeen/blob/
|
|
107
|
+
Defined in: [dispatcher.ts:4](https://github.com/vanviegen/aberdeen/blob/b53eddf1a1a2f6ec80ec8518a4cec30e65aa9b96/src/dispatcher.ts#L4)
|
|
108
108
|
|
|
109
109
|
Symbol to return when a custom [Dispatcher.addRoute](#addroute) matcher cannot match a segment.
|
|
110
110
|
|
|
@@ -114,6 +114,6 @@ Symbol to return when a custom [Dispatcher.addRoute](#addroute) matcher cannot m
|
|
|
114
114
|
|
|
115
115
|
> `const` **MATCH\_REST**: unique `symbol`
|
|
116
116
|
|
|
117
|
-
Defined in: [dispatcher.ts:9](https://github.com/vanviegen/aberdeen/blob/
|
|
117
|
+
Defined in: [dispatcher.ts:9](https://github.com/vanviegen/aberdeen/blob/b53eddf1a1a2f6ec80ec8518a4cec30e65aa9b96/src/dispatcher.ts#L9)
|
|
118
118
|
|
|
119
119
|
Special [Dispatcher.addRoute](#addroute) matcher that matches the rest of the segments as an array of strings.
|
package/skill/prediction.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[**Aberdeen v2.0.
|
|
1
|
+
[**Aberdeen v2.0.1**](README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
> **applyCanon**(`A`, `canonFunc?`, `dropPredictions?`): `void`
|
|
14
14
|
|
|
15
|
-
Defined in: [prediction.ts:136](https://github.com/vanviegen/aberdeen/blob/
|
|
15
|
+
Defined in: [prediction.ts:136](https://github.com/vanviegen/aberdeen/blob/b53eddf1a1a2f6ec80ec8518a4cec30e65aa9b96/src/prediction.ts#L136)
|
|
16
16
|
|
|
17
17
|
Temporarily revert all outstanding predictions, optionally run the provided function
|
|
18
18
|
(which will generally make authoritative changes to the data based on a server response),
|
|
@@ -56,7 +56,7 @@ An optional list of predictions (as returned by `applyPrediction`)
|
|
|
56
56
|
|
|
57
57
|
> **applyPrediction**(`A`, `predictFunc`): `Patch`
|
|
58
58
|
|
|
59
|
-
Defined in: [prediction.ts:113](https://github.com/vanviegen/aberdeen/blob/
|
|
59
|
+
Defined in: [prediction.ts:113](https://github.com/vanviegen/aberdeen/blob/b53eddf1a1a2f6ec80ec8518a4cec30e65aa9b96/src/prediction.ts#L113)
|
|
60
60
|
|
|
61
61
|
Run the provided function, while treating all changes to Observables as predictions,
|
|
62
62
|
meaning they will be reverted when changes come back from the server (or some other
|
package/skill/route.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[**Aberdeen v2.0.
|
|
1
|
+
[**Aberdeen v2.0.1**](README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -8,92 +8,21 @@
|
|
|
8
8
|
|
|
9
9
|
## Interfaces
|
|
10
10
|
|
|
11
|
-
### Route
|
|
12
|
-
|
|
13
|
-
Defined in: [route.ts:6](https://github.com/vanviegen/aberdeen/blob/bb39ef2418f1368ed94a83b45dc3201369d991ca/src/route.ts#L6)
|
|
14
|
-
|
|
15
|
-
The class for the global `route` object.
|
|
16
|
-
|
|
17
|
-
#### Properties
|
|
18
|
-
|
|
19
|
-
##### depth
|
|
20
|
-
|
|
21
|
-
> **depth**: `number`
|
|
22
|
-
|
|
23
|
-
Defined in: [route.ts:18](https://github.com/vanviegen/aberdeen/blob/bb39ef2418f1368ed94a83b45dc3201369d991ca/src/route.ts#L18)
|
|
24
|
-
|
|
25
|
-
The navigation depth of the current session. Starts at 1. Writing to this property has no effect.
|
|
26
|
-
|
|
27
|
-
##### hash
|
|
28
|
-
|
|
29
|
-
> **hash**: `string`
|
|
30
|
-
|
|
31
|
-
Defined in: [route.ts:12](https://github.com/vanviegen/aberdeen/blob/bb39ef2418f1368ed94a83b45dc3201369d991ca/src/route.ts#L12)
|
|
32
|
-
|
|
33
|
-
The hash fragment including the leading `#`, or an empty string. For instance `"#my_section"` or `""`.
|
|
34
|
-
|
|
35
|
-
##### nav
|
|
36
|
-
|
|
37
|
-
> **nav**: `NavType`
|
|
38
|
-
|
|
39
|
-
Defined in: [route.ts:26](https://github.com/vanviegen/aberdeen/blob/bb39ef2418f1368ed94a83b45dc3201369d991ca/src/route.ts#L26)
|
|
40
|
-
|
|
41
|
-
The navigation action that got us to this page. Writing to this property has no effect.
|
|
42
|
-
- `"load"`: An initial page load.
|
|
43
|
-
- `"back"` or `"forward"`: When we navigated backwards or forwards in the stack.
|
|
44
|
-
- `"go"`: When we added a new page on top of the stack.
|
|
45
|
-
- `"push"`: When we added a new page on top of the stack, merging with the current page.
|
|
46
|
-
Mostly useful for page transition animations. Writing to this property has no effect.
|
|
47
|
-
|
|
48
|
-
##### p
|
|
49
|
-
|
|
50
|
-
> **p**: `string`[]
|
|
51
|
-
|
|
52
|
-
Defined in: [route.ts:10](https://github.com/vanviegen/aberdeen/blob/bb39ef2418f1368ed94a83b45dc3201369d991ca/src/route.ts#L10)
|
|
53
|
-
|
|
54
|
-
An convenience array containing path segments, mapping to `path`. For instance `[]` (for `"/"`) or `['users', '123', 'feed']` (for `"/users/123/feed"`).
|
|
55
|
-
|
|
56
|
-
##### path
|
|
57
|
-
|
|
58
|
-
> **path**: `string`
|
|
59
|
-
|
|
60
|
-
Defined in: [route.ts:8](https://github.com/vanviegen/aberdeen/blob/bb39ef2418f1368ed94a83b45dc3201369d991ca/src/route.ts#L8)
|
|
61
|
-
|
|
62
|
-
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).
|
|
63
|
-
|
|
64
|
-
##### search
|
|
65
|
-
|
|
66
|
-
> **search**: `Record`\<`string`, `string`\>
|
|
67
|
-
|
|
68
|
-
Defined in: [route.ts:14](https://github.com/vanviegen/aberdeen/blob/bb39ef2418f1368ed94a83b45dc3201369d991ca/src/route.ts#L14)
|
|
69
|
-
|
|
70
|
-
The query string interpreted as search parameters. So `"a=x&b=y"` becomes `{a: "x", b: "y"}`.
|
|
71
|
-
|
|
72
|
-
##### state
|
|
73
|
-
|
|
74
|
-
> **state**: `Record`\<`string`, `any`\>
|
|
75
|
-
|
|
76
|
-
Defined in: [route.ts:16](https://github.com/vanviegen/aberdeen/blob/bb39ef2418f1368ed94a83b45dc3201369d991ca/src/route.ts#L16)
|
|
77
|
-
|
|
78
|
-
An object to be used for any additional data you want to associate with the current page. Data should be JSON-compatible.
|
|
79
|
-
|
|
80
|
-
***
|
|
81
|
-
|
|
82
11
|
### RouteApi
|
|
83
12
|
|
|
84
|
-
Defined in: [route.ts:39](https://github.com/vanviegen/aberdeen/blob/
|
|
13
|
+
Defined in: [route.ts:39](https://github.com/vanviegen/aberdeen/blob/b53eddf1a1a2f6ec80ec8518a4cec30e65aa9b96/src/route.ts#L39)
|
|
85
14
|
|
|
86
|
-
The router API returned by [
|
|
15
|
+
The router API returned by [createRoute](#createroute), bound to a specific Aberdeen instance's window.
|
|
87
16
|
|
|
88
17
|
#### Properties
|
|
89
18
|
|
|
90
19
|
##### current
|
|
91
20
|
|
|
92
|
-
> **current**: [`
|
|
21
|
+
> **current**: [`RouteState`](#routestate)
|
|
93
22
|
|
|
94
|
-
Defined in: [route.ts:43](https://github.com/vanviegen/aberdeen/blob/
|
|
23
|
+
Defined in: [route.ts:43](https://github.com/vanviegen/aberdeen/blob/b53eddf1a1a2f6ec80ec8518a4cec30e65aa9b96/src/route.ts#L43)
|
|
95
24
|
|
|
96
|
-
The global [
|
|
25
|
+
The global [RouteState](#routestate) object reflecting the current URL and browser history state. Changes you make to this affect the current browser history item (modifying the URL if needed).
|
|
97
26
|
|
|
98
27
|
#### Methods
|
|
99
28
|
|
|
@@ -101,7 +30,7 @@ The global [Route](#route) object reflecting the current URL and browser history
|
|
|
101
30
|
|
|
102
31
|
> **back**(`target?`): `void`
|
|
103
32
|
|
|
104
|
-
Defined in: [route.ts:108](https://github.com/vanviegen/aberdeen/blob/
|
|
33
|
+
Defined in: [route.ts:108](https://github.com/vanviegen/aberdeen/blob/b53eddf1a1a2f6ec80ec8518a4cec30e65aa9b96/src/route.ts#L108)
|
|
105
34
|
|
|
106
35
|
Try to go back in history to the first entry that matches the given target. If none is found, the given state will replace the current page. This is useful for "cancel" or "close" actions that should return to the previous page if possible, but create a new page if not (for instance when arriving at the current page through a direct link).
|
|
107
36
|
|
|
@@ -113,7 +42,7 @@ Consider using [up](#up) to go up in the path hierarchy.
|
|
|
113
42
|
|
|
114
43
|
`RouteTarget`
|
|
115
44
|
|
|
116
|
-
The target route to go back to. May be a subset of [
|
|
45
|
+
The target route to go back to. May be a subset of [RouteState](#routestate), or a string (for `path`), or an array of strings (for `p`).
|
|
117
46
|
|
|
118
47
|
###### Returns
|
|
119
48
|
|
|
@@ -123,7 +52,7 @@ The target route to go back to. May be a subset of [Route](#route), or a string
|
|
|
123
52
|
|
|
124
53
|
> **go**(`target`, `nav?`): `void`
|
|
125
54
|
|
|
126
|
-
Defined in: [route.ts:69](https://github.com/vanviegen/aberdeen/blob/
|
|
55
|
+
Defined in: [route.ts:69](https://github.com/vanviegen/aberdeen/blob/b53eddf1a1a2f6ec80ec8518a4cec30e65aa9b96/src/route.ts#L69)
|
|
127
56
|
|
|
128
57
|
Navigate to a new URL by pushing a new history entry.
|
|
129
58
|
|
|
@@ -135,7 +64,7 @@ Note that this happens synchronously, immediately updating `route` and processin
|
|
|
135
64
|
|
|
136
65
|
`RouteTarget`
|
|
137
66
|
|
|
138
|
-
A subset of the [
|
|
67
|
+
A subset of the [RouteState](#routestate) properties to navigate to. If neither `p` nor `path` is given, the current path is used. For other properties, an empty/default value is assumed if not given. For convenience:
|
|
139
68
|
- You may pass a string instead of an object, which is interpreted as the `path`.
|
|
140
69
|
- You may pass an array instead of an object, which is interpreted as the `p` array.
|
|
141
70
|
- If you pass `p`, it may contain numbers, which will be converted to strings.
|
|
@@ -162,7 +91,7 @@ route.go({p: ["users", 123], search: {tab: "feed"}, hash: "top"});
|
|
|
162
91
|
|
|
163
92
|
> **interceptLinks**(): `void`
|
|
164
93
|
|
|
165
|
-
Defined in: [route.ts:
|
|
94
|
+
Defined in: [route.ts:145](https://github.com/vanviegen/aberdeen/blob/b53eddf1a1a2f6ec80ec8518a4cec30e65aa9b96/src/route.ts#L145)
|
|
166
95
|
|
|
167
96
|
Intercept clicks and Enter key presses on links (`<a>` tags) and use Aberdeen routing
|
|
168
97
|
instead of browser navigation for local paths (paths without a protocol or host).
|
|
@@ -188,7 +117,7 @@ A('a text=About href=/corporate/about');
|
|
|
188
117
|
|
|
189
118
|
> **matchCurrent**(`target`): `boolean`
|
|
190
119
|
|
|
191
|
-
Defined in: [route.ts:90](https://github.com/vanviegen/aberdeen/blob/
|
|
120
|
+
Defined in: [route.ts:90](https://github.com/vanviegen/aberdeen/blob/b53eddf1a1a2f6ec80ec8518a4cec30e65aa9b96/src/route.ts#L90)
|
|
192
121
|
|
|
193
122
|
Returns `true` if the current route matches `target`.
|
|
194
123
|
|
|
@@ -224,7 +153,7 @@ route.matchCurrent({path: '/users', search: {tab: 'profile'}});
|
|
|
224
153
|
|
|
225
154
|
> **persistScroll**(`name?`): `void`
|
|
226
155
|
|
|
227
|
-
Defined in: [route.ts:
|
|
156
|
+
Defined in: [route.ts:128](https://github.com/vanviegen/aberdeen/blob/b53eddf1a1a2f6ec80ec8518a4cec30e65aa9b96/src/route.ts#L128)
|
|
228
157
|
|
|
229
158
|
Restore and store the vertical and horizontal scroll position for
|
|
230
159
|
the parent element to the page state.
|
|
@@ -248,7 +177,7 @@ The scroll position will be persisted in `route.aux.scroll.<name>`.
|
|
|
248
177
|
|
|
249
178
|
> **push**(`target`, `nav?`): `void`
|
|
250
179
|
|
|
251
|
-
Defined in: [route.ts:100](https://github.com/vanviegen/aberdeen/blob/
|
|
180
|
+
Defined in: [route.ts:100](https://github.com/vanviegen/aberdeen/blob/b53eddf1a1a2f6ec80ec8518a4cec30e65aa9b96/src/route.ts#L100)
|
|
252
181
|
|
|
253
182
|
Modify the current route by merging `target` into it (using [A.merge](aberdeen.md#merge)), pushing a new history entry.
|
|
254
183
|
|
|
@@ -277,7 +206,7 @@ The navigation type to use. Defaults to `undefined`, meaning the navigation type
|
|
|
277
206
|
|
|
278
207
|
> **setLog**(`value`): `void`
|
|
279
208
|
|
|
280
|
-
Defined in: [route.ts:48](https://github.com/vanviegen/aberdeen/blob/
|
|
209
|
+
Defined in: [route.ts:48](https://github.com/vanviegen/aberdeen/blob/b53eddf1a1a2f6ec80ec8518a4cec30e65aa9b96/src/route.ts#L48)
|
|
281
210
|
|
|
282
211
|
Configure logging on route changes.
|
|
283
212
|
|
|
@@ -297,7 +226,7 @@ Configure logging on route changes.
|
|
|
297
226
|
|
|
298
227
|
> **up**(`stripCount?`): `void`
|
|
299
228
|
|
|
300
|
-
Defined in: [route.ts:116](https://github.com/vanviegen/aberdeen/blob/
|
|
229
|
+
Defined in: [route.ts:116](https://github.com/vanviegen/aberdeen/blob/b53eddf1a1a2f6ec80ec8518a4cec30e65aa9b96/src/route.ts#L116)
|
|
301
230
|
|
|
302
231
|
Navigate up in the path hierarchy, by going back to the first history entry
|
|
303
232
|
that has a shorter path than the current one. If there's none, we just shorten
|
|
@@ -315,13 +244,84 @@ Note that going back in browser history happens asynchronously, so `route` will
|
|
|
315
244
|
|
|
316
245
|
`void`
|
|
317
246
|
|
|
247
|
+
***
|
|
248
|
+
|
|
249
|
+
### RouteState
|
|
250
|
+
|
|
251
|
+
Defined in: [route.ts:6](https://github.com/vanviegen/aberdeen/blob/b53eddf1a1a2f6ec80ec8518a4cec30e65aa9b96/src/route.ts#L6)
|
|
252
|
+
|
|
253
|
+
The class for the global `route` object.
|
|
254
|
+
|
|
255
|
+
#### Properties
|
|
256
|
+
|
|
257
|
+
##### depth
|
|
258
|
+
|
|
259
|
+
> **depth**: `number`
|
|
260
|
+
|
|
261
|
+
Defined in: [route.ts:18](https://github.com/vanviegen/aberdeen/blob/b53eddf1a1a2f6ec80ec8518a4cec30e65aa9b96/src/route.ts#L18)
|
|
262
|
+
|
|
263
|
+
The navigation depth of the current session. Starts at 1. Writing to this property has no effect.
|
|
264
|
+
|
|
265
|
+
##### hash
|
|
266
|
+
|
|
267
|
+
> **hash**: `string`
|
|
268
|
+
|
|
269
|
+
Defined in: [route.ts:12](https://github.com/vanviegen/aberdeen/blob/b53eddf1a1a2f6ec80ec8518a4cec30e65aa9b96/src/route.ts#L12)
|
|
270
|
+
|
|
271
|
+
The hash fragment including the leading `#`, or an empty string. For instance `"#my_section"` or `""`.
|
|
272
|
+
|
|
273
|
+
##### nav
|
|
274
|
+
|
|
275
|
+
> **nav**: `NavType`
|
|
276
|
+
|
|
277
|
+
Defined in: [route.ts:26](https://github.com/vanviegen/aberdeen/blob/b53eddf1a1a2f6ec80ec8518a4cec30e65aa9b96/src/route.ts#L26)
|
|
278
|
+
|
|
279
|
+
The navigation action that got us to this page. Writing to this property has no effect.
|
|
280
|
+
- `"load"`: An initial page load.
|
|
281
|
+
- `"back"` or `"forward"`: When we navigated backwards or forwards in the stack.
|
|
282
|
+
- `"go"`: When we added a new page on top of the stack.
|
|
283
|
+
- `"push"`: When we added a new page on top of the stack, merging with the current page.
|
|
284
|
+
Mostly useful for page transition animations. Writing to this property has no effect.
|
|
285
|
+
|
|
286
|
+
##### p
|
|
287
|
+
|
|
288
|
+
> **p**: `string`[]
|
|
289
|
+
|
|
290
|
+
Defined in: [route.ts:10](https://github.com/vanviegen/aberdeen/blob/b53eddf1a1a2f6ec80ec8518a4cec30e65aa9b96/src/route.ts#L10)
|
|
291
|
+
|
|
292
|
+
An convenience array containing path segments, mapping to `path`. For instance `[]` (for `"/"`) or `['users', '123', 'feed']` (for `"/users/123/feed"`).
|
|
293
|
+
|
|
294
|
+
##### path
|
|
295
|
+
|
|
296
|
+
> **path**: `string`
|
|
297
|
+
|
|
298
|
+
Defined in: [route.ts:8](https://github.com/vanviegen/aberdeen/blob/b53eddf1a1a2f6ec80ec8518a4cec30e65aa9b96/src/route.ts#L8)
|
|
299
|
+
|
|
300
|
+
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).
|
|
301
|
+
|
|
302
|
+
##### search
|
|
303
|
+
|
|
304
|
+
> **search**: `Record`\<`string`, `string`\>
|
|
305
|
+
|
|
306
|
+
Defined in: [route.ts:14](https://github.com/vanviegen/aberdeen/blob/b53eddf1a1a2f6ec80ec8518a4cec30e65aa9b96/src/route.ts#L14)
|
|
307
|
+
|
|
308
|
+
The query string interpreted as search parameters. So `"a=x&b=y"` becomes `{a: "x", b: "y"}`.
|
|
309
|
+
|
|
310
|
+
##### state
|
|
311
|
+
|
|
312
|
+
> **state**: `Record`\<`string`, `any`\>
|
|
313
|
+
|
|
314
|
+
Defined in: [route.ts:16](https://github.com/vanviegen/aberdeen/blob/b53eddf1a1a2f6ec80ec8518a4cec30e65aa9b96/src/route.ts#L16)
|
|
315
|
+
|
|
316
|
+
An object to be used for any additional data you want to associate with the current page. Data should be JSON-compatible.
|
|
317
|
+
|
|
318
318
|
## Functions
|
|
319
319
|
|
|
320
|
-
###
|
|
320
|
+
### createRoute()
|
|
321
321
|
|
|
322
|
-
> **
|
|
322
|
+
> **createRoute**(`A`): [`RouteApi`](#routeapi)
|
|
323
323
|
|
|
324
|
-
Defined in: [route.ts:
|
|
324
|
+
Defined in: [route.ts:155](https://github.com/vanviegen/aberdeen/blob/b53eddf1a1a2f6ec80ec8518a4cec30e65aa9b96/src/route.ts#L155)
|
|
325
325
|
|
|
326
326
|
Initialise routing for an Aberdeen instance and return the router API, bound to that
|
|
327
327
|
instance's window. In the browser, use the default instance: `init(A)`. For server-side
|
package/skill/transitions.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[**Aberdeen v2.0.
|
|
1
|
+
[**Aberdeen v2.0.1**](README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
> **grow**(`el`): `Promise`\<`void`\>
|
|
14
14
|
|
|
15
|
-
Defined in: [transitions.ts:39](https://github.com/vanviegen/aberdeen/blob/
|
|
15
|
+
Defined in: [transitions.ts:39](https://github.com/vanviegen/aberdeen/blob/b53eddf1a1a2f6ec80ec8518a4cec30e65aa9b96/src/transitions.ts#L39)
|
|
16
16
|
|
|
17
17
|
Do a grow transition for the given element. This is meant to be used as a
|
|
18
18
|
handler for the `create` property.
|
|
@@ -38,7 +38,7 @@ for other specific cases as well.
|
|
|
38
38
|
|
|
39
39
|
> **shrink**(`el`): `Promise`\<`void`\>
|
|
40
40
|
|
|
41
|
-
Defined in: [transitions.ts:62](https://github.com/vanviegen/aberdeen/blob/
|
|
41
|
+
Defined in: [transitions.ts:62](https://github.com/vanviegen/aberdeen/blob/b53eddf1a1a2f6ec80ec8518a4cec30e65aa9b96/src/transitions.ts#L62)
|
|
42
42
|
|
|
43
43
|
Do a shrink transition for the given element, and remove it from the DOM
|
|
44
44
|
afterwards. This is meant to be used as a handler for the `destroy` property.
|