@xmachines/docs 1.0.0-beta.10
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/LICENSE +21 -0
- package/README.md +15 -0
- package/api/@xmachines/play/README.md +130 -0
- package/api/@xmachines/play/type-aliases/PlayEvent.md +81 -0
- package/api/@xmachines/play-actor/README.md +247 -0
- package/api/@xmachines/play-actor/classes/AbstractActor.md +520 -0
- package/api/@xmachines/play-actor/interfaces/Routable.md +29 -0
- package/api/@xmachines/play-actor/interfaces/ViewMetadata.md +17 -0
- package/api/@xmachines/play-actor/interfaces/Viewable.md +12 -0
- package/api/@xmachines/play-catalog/README.md +331 -0
- package/api/@xmachines/play-catalog/functions/defineCatalog.md +98 -0
- package/api/@xmachines/play-catalog/functions/defineComponents.md +134 -0
- package/api/@xmachines/play-catalog/type-aliases/Catalog.md +48 -0
- package/api/@xmachines/play-catalog/type-aliases/ComponentsFor.md +20 -0
- package/api/@xmachines/play-catalog/type-aliases/InferComponentProps.md +65 -0
- package/api/@xmachines/play-catalog/type-aliases/NoExtraKeys.md +17 -0
- package/api/@xmachines/play-react/README.md +423 -0
- package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +613 -0
- package/api/@xmachines/play-react/functions/useSignalEffect.md +68 -0
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryProps.md +15 -0
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryState.md +14 -0
- package/api/@xmachines/play-react/interfaces/PlayRendererProps.md +15 -0
- package/api/@xmachines/play-react/variables/PlayRenderer.md +64 -0
- package/api/@xmachines/play-react-router/README.md +198 -0
- package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +321 -0
- package/api/@xmachines/play-react-router/classes/RouteMap.md +137 -0
- package/api/@xmachines/play-react-router/functions/PlayRouterProvider.md +19 -0
- package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +35 -0
- package/api/@xmachines/play-react-router/interfaces/PlayRouteEvent.md +119 -0
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +14 -0
- package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +17 -0
- package/api/@xmachines/play-react-router/interfaces/RouterBridge.md +104 -0
- package/api/@xmachines/play-react-router-demo/README.md +137 -0
- package/api/@xmachines/play-router/README.md +502 -0
- package/api/@xmachines/play-router/classes/BaseRouteMap.md +142 -0
- package/api/@xmachines/play-router/classes/RouterBridgeBase.md +300 -0
- package/api/@xmachines/play-router/functions/buildRouteTree.md +27 -0
- package/api/@xmachines/play-router/functions/connectRouter.md +67 -0
- package/api/@xmachines/play-router/functions/crawlMachine.md +92 -0
- package/api/@xmachines/play-router/functions/createBrowserHistory.md +47 -0
- package/api/@xmachines/play-router/functions/createRouteMap.md +53 -0
- package/api/@xmachines/play-router/functions/createRouter.md +76 -0
- package/api/@xmachines/play-router/functions/detectDuplicateRoutes.md +32 -0
- package/api/@xmachines/play-router/functions/extractMachineRoutes.md +64 -0
- package/api/@xmachines/play-router/functions/extractRoute.md +45 -0
- package/api/@xmachines/play-router/functions/findRouteById.md +37 -0
- package/api/@xmachines/play-router/functions/findRouteByPath.md +39 -0
- package/api/@xmachines/play-router/functions/getNavigableRoutes.md +35 -0
- package/api/@xmachines/play-router/functions/getRoutableRoutes.md +39 -0
- package/api/@xmachines/play-router/functions/routeExists.md +26 -0
- package/api/@xmachines/play-router/functions/validateRouteFormat.md +29 -0
- package/api/@xmachines/play-router/functions/validateStateExists.md +29 -0
- package/api/@xmachines/play-router/interfaces/BaseRouteMapping.md +27 -0
- package/api/@xmachines/play-router/interfaces/BrowserHistory.md +172 -0
- package/api/@xmachines/play-router/interfaces/BrowserWindow.md +69 -0
- package/api/@xmachines/play-router/interfaces/ConnectRouterOptions.md +13 -0
- package/api/@xmachines/play-router/interfaces/PlayRouteEvent.md +119 -0
- package/api/@xmachines/play-router/interfaces/RouteInfo.md +19 -0
- package/api/@xmachines/play-router/interfaces/RouteMap.md +56 -0
- package/api/@xmachines/play-router/interfaces/RouteNode.md +21 -0
- package/api/@xmachines/play-router/interfaces/RouteObject.md +21 -0
- package/api/@xmachines/play-router/interfaces/RouteTree.md +20 -0
- package/api/@xmachines/play-router/interfaces/RouterBridge.md +104 -0
- package/api/@xmachines/play-router/interfaces/StateVisit.md +15 -0
- package/api/@xmachines/play-router/interfaces/VanillaRouter.md +28 -0
- package/api/@xmachines/play-router/type-aliases/RouteMetadata.md +11 -0
- package/api/@xmachines/play-router-demo/README.md +137 -0
- package/api/@xmachines/play-signals/README.md +176 -0
- package/api/@xmachines/play-signals/interfaces/ComputedOptions.md +34 -0
- package/api/@xmachines/play-signals/interfaces/SignalComputed.md +49 -0
- package/api/@xmachines/play-signals/interfaces/SignalOptions.md +35 -0
- package/api/@xmachines/play-signals/interfaces/SignalState.md +68 -0
- package/api/@xmachines/play-signals/interfaces/SignalWatcher.md +97 -0
- package/api/@xmachines/play-signals/namespaces/Signal/README.md +22 -0
- package/api/@xmachines/play-signals/namespaces/Signal/classes/Computed.md +52 -0
- package/api/@xmachines/play-signals/namespaces/Signal/classes/State.md +72 -0
- package/api/@xmachines/play-signals/namespaces/Signal/interfaces/Options.md +19 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/README.md +21 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/classes/Watcher.md +85 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/currentComputed.md +13 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/hasSinks.md +19 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/hasSources.md +19 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/introspectSinks.md +19 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/introspectSources.md +19 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/untrack.md +25 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/variables/unwatched.md +9 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/variables/watched.md +9 -0
- package/api/@xmachines/play-signals/namespaces/Signal/variables/isComputed.md +19 -0
- package/api/@xmachines/play-signals/namespaces/Signal/variables/isState.md +19 -0
- package/api/@xmachines/play-signals/namespaces/Signal/variables/isWatcher.md +19 -0
- package/api/@xmachines/play-signals/type-aliases/WatcherNotify.md +32 -0
- package/api/@xmachines/play-solid/README.md +311 -0
- package/api/@xmachines/play-solid/interfaces/PlayRendererProps.md +15 -0
- package/api/@xmachines/play-solid/variables/PlayRenderer.md +70 -0
- package/api/@xmachines/play-solid-router/README.md +666 -0
- package/api/@xmachines/play-solid-router/classes/RouteMap.md +150 -0
- package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +347 -0
- package/api/@xmachines/play-solid-router/functions/PlayRouterProvider.md +19 -0
- package/api/@xmachines/play-solid-router/functions/createRouteMap.md +32 -0
- package/api/@xmachines/play-solid-router/interfaces/AbstractActor.md +486 -0
- package/api/@xmachines/play-solid-router/interfaces/PlayRouteEvent.md +119 -0
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +14 -0
- package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +14 -0
- package/api/@xmachines/play-solid-router/interfaces/RouterBridge.md +104 -0
- package/api/@xmachines/play-solid-router/type-aliases/RoutableActor.md +9 -0
- package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +51 -0
- package/api/@xmachines/play-solid-router-demo/README.md +127 -0
- package/api/@xmachines/play-tanstack-react-router/README.md +226 -0
- package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +137 -0
- package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +348 -0
- package/api/@xmachines/play-tanstack-react-router/functions/PlayRouterProvider.md +19 -0
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMap.md +53 -0
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMapFromTree.md +35 -0
- package/api/@xmachines/play-tanstack-react-router/functions/extractParams.md +38 -0
- package/api/@xmachines/play-tanstack-react-router/functions/extractQueryParams.md +33 -0
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouteEvent.md +119 -0
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +14 -0
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapping.md +17 -0
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteNavigateEvent.md +26 -0
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouterBridge.md +104 -0
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterInstance.md +9 -0
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterLike.md +78 -0
- package/api/@xmachines/play-tanstack-react-router/variables/extractMachineRoutes.md +64 -0
- package/api/@xmachines/play-tanstack-react-router-demo/README.md +126 -0
- package/api/@xmachines/play-tanstack-solid-router/README.md +285 -0
- package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +150 -0
- package/api/@xmachines/play-tanstack-solid-router/classes/SolidRouterBridge.md +343 -0
- package/api/@xmachines/play-tanstack-solid-router/functions/PlayRouterProvider.md +19 -0
- package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +32 -0
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouteEvent.md +119 -0
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +14 -0
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +23 -0
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouterBridge.md +104 -0
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/RoutableActor.md +9 -0
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterInstance.md +9 -0
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterLike.md +78 -0
- package/api/@xmachines/play-tanstack-solid-router-demo/README.md +126 -0
- package/api/@xmachines/play-vue/README.md +292 -0
- package/api/@xmachines/play-vue/interfaces/PlayRendererProps.md +14 -0
- package/api/@xmachines/play-vue/variables/PlayRenderer.md +9 -0
- package/api/@xmachines/play-vue-router/README.md +604 -0
- package/api/@xmachines/play-vue-router/classes/RouteMap.md +209 -0
- package/api/@xmachines/play-vue-router/classes/VueBaseRouteMap.md +201 -0
- package/api/@xmachines/play-vue-router/classes/VueRouterBridge.md +360 -0
- package/api/@xmachines/play-vue-router/functions/createRouteMap.md +19 -0
- package/api/@xmachines/play-vue-router/interfaces/PlayRouteEvent.md +119 -0
- package/api/@xmachines/play-vue-router/interfaces/RouteMapping.md +15 -0
- package/api/@xmachines/play-vue-router/interfaces/RouterBridge.md +104 -0
- package/api/@xmachines/play-vue-router/type-aliases/RoutableActor.md +9 -0
- package/api/@xmachines/play-vue-router/variables/PlayRouterProvider.md +67 -0
- package/api/@xmachines/play-vue-router-demo/README.md +133 -0
- package/api/@xmachines/play-xstate/README.md +512 -0
- package/api/@xmachines/play-xstate/classes/PlayerActor.md +527 -0
- package/api/@xmachines/play-xstate/functions/buildRouteUrl.md +43 -0
- package/api/@xmachines/play-xstate/functions/composeGuards.md +79 -0
- package/api/@xmachines/play-xstate/functions/composeGuardsOr.md +67 -0
- package/api/@xmachines/play-xstate/functions/definePlayer.md +127 -0
- package/api/@xmachines/play-xstate/functions/deriveRoute.md +109 -0
- package/api/@xmachines/play-xstate/functions/eventMatches.md +40 -0
- package/api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md +54 -0
- package/api/@xmachines/play-xstate/functions/hasContext.md +42 -0
- package/api/@xmachines/play-xstate/functions/isAbsoluteRoute.md +41 -0
- package/api/@xmachines/play-xstate/functions/mergeViewProps.md +26 -0
- package/api/@xmachines/play-xstate/functions/negateGuard.md +61 -0
- package/api/@xmachines/play-xstate/functions/stateMatches.md +25 -0
- package/api/@xmachines/play-xstate/functions/validateComponentBinding.md +39 -0
- package/api/@xmachines/play-xstate/functions/validateViewProps.md +80 -0
- package/api/@xmachines/play-xstate/interfaces/CatalogEntry.md +16 -0
- package/api/@xmachines/play-xstate/interfaces/PlayerConfig.md +24 -0
- package/api/@xmachines/play-xstate/interfaces/PlayerOptions.md +26 -0
- package/api/@xmachines/play-xstate/interfaces/RouteContext.md +22 -0
- package/api/@xmachines/play-xstate/type-aliases/Catalog.md +21 -0
- package/api/@xmachines/play-xstate/type-aliases/ComposedGuard.md +14 -0
- package/api/@xmachines/play-xstate/type-aliases/Guard.md +34 -0
- package/api/@xmachines/play-xstate/type-aliases/GuardArray.md +20 -0
- package/api/@xmachines/play-xstate/type-aliases/PlayerFactory.md +29 -0
- package/api/@xmachines/play-xstate/type-aliases/RouteMachineConfig.md +45 -0
- package/api/@xmachines/play-xstate/type-aliases/RouteStateNode.md +51 -0
- package/api/@xmachines/play-xstate/type-aliases/ValidationResult.md +17 -0
- package/api/@xmachines/play-xstate/type-aliases/ViewMergeContext.md +35 -0
- package/api/@xmachines/shared/README.md +379 -0
- package/api/@xmachines/shared/functions/defineXmVitestConfig.md +29 -0
- package/api/@xmachines/shared/functions/xmAliases.md +24 -0
- package/api/README.md +25 -0
- package/api/llms.txt +26 -0
- package/examples/README.md +63 -0
- package/examples/basic-state-machine.md +70 -0
- package/examples/form-validation.md +167 -0
- package/examples/multi-router-integration.md +277 -0
- package/examples/routing-patterns.md +260 -0
- package/examples/traffic-light.md +99 -0
- package/guides/README.md +29 -0
- package/guides/getting-started.md +223 -0
- package/guides/installation.md +323 -0
- package/index.d.ts +3 -0
- package/index.js +4 -0
- package/package.json +54 -0
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
[Documentation](../../../README.md) / [@xmachines/play-tanstack-solid-router](../README.md) / SolidRouterBridge
|
|
2
|
+
|
|
3
|
+
# Class: SolidRouterBridge
|
|
4
|
+
|
|
5
|
+
Defined in: [play-tanstack-solid-router/src/solid-router-bridge.ts:45](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-tanstack-solid-router/src/solid-router-bridge.ts#L45)
|
|
6
|
+
|
|
7
|
+
TanStack Solid Router integration bridge extending RouterBridgeBase
|
|
8
|
+
|
|
9
|
+
Uses router.subscribe("onBeforeLoad", fn) for router→actor sync.
|
|
10
|
+
This mirrors the TanStack React Router bridge pattern and uses the
|
|
11
|
+
public router events API instead of the internal \_\_store.
|
|
12
|
+
|
|
13
|
+
## Extends
|
|
14
|
+
|
|
15
|
+
- [`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md)
|
|
16
|
+
|
|
17
|
+
## Constructors
|
|
18
|
+
|
|
19
|
+
### Constructor
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
new SolidRouterBridge(
|
|
23
|
+
router,
|
|
24
|
+
actor,
|
|
25
|
+
routeMap): SolidRouterBridge;
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Defined in: [play-tanstack-solid-router/src/solid-router-bridge.ts:55](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-tanstack-solid-router/src/solid-router-bridge.ts#L55)
|
|
29
|
+
|
|
30
|
+
Create a TanStack Solid Router bridge
|
|
31
|
+
|
|
32
|
+
#### Parameters
|
|
33
|
+
|
|
34
|
+
| Parameter | Type | Description |
|
|
35
|
+
| ---------- | --------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- |
|
|
36
|
+
| `router` | [`TanStackRouterLike`](../type-aliases/TanStackRouterLike.md) | TanStack Router instance (from createRouter) |
|
|
37
|
+
| `actor` | [`AbstractActor`](../../play-actor/classes/AbstractActor.md)\<`AnyActorLogic`\> & [`Routable`](../../play-actor/interfaces/Routable.md) | XMachines actor instance |
|
|
38
|
+
| `routeMap` | [`RouteMap`](RouteMap.md) | Bidirectional state ID ↔ path mapping |
|
|
39
|
+
|
|
40
|
+
#### Returns
|
|
41
|
+
|
|
42
|
+
`SolidRouterBridge`
|
|
43
|
+
|
|
44
|
+
#### Overrides
|
|
45
|
+
|
|
46
|
+
[`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`constructor`](../../play-router/classes/RouterBridgeBase.md#constructor)
|
|
47
|
+
|
|
48
|
+
## Properties
|
|
49
|
+
|
|
50
|
+
| Property | Modifier | Type | Description | Inherited from | Defined in |
|
|
51
|
+
| --------------------------------------------------------------------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------- |
|
|
52
|
+
| <a id="property-actor"></a> `actor` | `readonly` | [`AbstractActor`](../../play-actor/classes/AbstractActor.md)\<`AnyActorLogic`\> & [`Routable`](../../play-actor/interfaces/Routable.md) | Actor with currentRoute signal and send method | [`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`actor`](../../play-router/classes/RouterBridgeBase.md#property-actor) | play-router/dist/router-bridge-base.d.ts:55 |
|
|
53
|
+
| <a id="property-hasconnectedonce"></a> `hasConnectedOnce` | `protected` | `boolean` | - | [`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`hasConnectedOnce`](../../play-router/classes/RouterBridgeBase.md#property-hasconnectedonce) | play-router/dist/router-bridge-base.d.ts:61 |
|
|
54
|
+
| <a id="property-isconnected"></a> `isConnected` | `protected` | `boolean` | - | [`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`isConnected`](../../play-router/classes/RouterBridgeBase.md#property-isconnected) | play-router/dist/router-bridge-base.d.ts:60 |
|
|
55
|
+
| <a id="property-isprocessingnavigation"></a> `isProcessingNavigation` | `protected` | `boolean` | - | [`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`isProcessingNavigation`](../../play-router/classes/RouterBridgeBase.md#property-isprocessingnavigation) | play-router/dist/router-bridge-base.d.ts:63 |
|
|
56
|
+
| <a id="property-lastsyncedpath"></a> `lastSyncedPath` | `protected` | `string` | - | [`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`lastSyncedPath`](../../play-router/classes/RouterBridgeBase.md#property-lastsyncedpath) | play-router/dist/router-bridge-base.d.ts:62 |
|
|
57
|
+
| <a id="property-routemap"></a> `routeMap` | `readonly` | `object` | Bidirectional route map for stateId ↔ path resolution | [`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`routeMap`](../../play-router/classes/RouterBridgeBase.md#property-routemap) | play-router/dist/router-bridge-base.d.ts:56 |
|
|
58
|
+
| `routeMap.getPathByStateId` | `public` | `string` \| `null` \| `undefined` | - | - | play-router/dist/router-bridge-base.d.ts:58 |
|
|
59
|
+
| `routeMap.getStateIdByPath` | `public` | `string` \| `null` \| `undefined` | - | - | play-router/dist/router-bridge-base.d.ts:57 |
|
|
60
|
+
| <a id="property-routewatcher"></a> `routeWatcher` | `protected` | \| [`Watcher`](../../play-signals/namespaces/Signal/namespaces/subtle/classes/Watcher.md) \| `null` | - | [`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`routeWatcher`](../../play-router/classes/RouterBridgeBase.md#property-routewatcher) | play-router/dist/router-bridge-base.d.ts:64 |
|
|
61
|
+
|
|
62
|
+
## Methods
|
|
63
|
+
|
|
64
|
+
### connect()
|
|
65
|
+
|
|
66
|
+
```ts
|
|
67
|
+
connect(): void;
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Defined in: play-router/dist/router-bridge-base.d.ts:81
|
|
71
|
+
|
|
72
|
+
Connect the router bridge to the Actor.
|
|
73
|
+
|
|
74
|
+
Sets up the TC39 Signal watcher for actor → router direction and
|
|
75
|
+
starts watching router changes (framework-specific).
|
|
76
|
+
|
|
77
|
+
#### Returns
|
|
78
|
+
|
|
79
|
+
`void`
|
|
80
|
+
|
|
81
|
+
#### Inherited from
|
|
82
|
+
|
|
83
|
+
[`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`connect`](../../play-router/classes/RouterBridgeBase.md#connect)
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
### disconnect()
|
|
88
|
+
|
|
89
|
+
```ts
|
|
90
|
+
disconnect(): void;
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Defined in: play-router/dist/router-bridge-base.d.ts:87
|
|
94
|
+
|
|
95
|
+
Disconnect the router bridge from the Actor.
|
|
96
|
+
|
|
97
|
+
Stops signal watching and unregisters framework-specific router listener.
|
|
98
|
+
|
|
99
|
+
#### Returns
|
|
100
|
+
|
|
101
|
+
`void`
|
|
102
|
+
|
|
103
|
+
#### Inherited from
|
|
104
|
+
|
|
105
|
+
[`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`disconnect`](../../play-router/classes/RouterBridgeBase.md#disconnect)
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
### dispose()
|
|
110
|
+
|
|
111
|
+
```ts
|
|
112
|
+
dispose(): void;
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Defined in: [play-tanstack-solid-router/src/solid-router-bridge.ts:120](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-tanstack-solid-router/src/solid-router-bridge.ts#L120)
|
|
116
|
+
|
|
117
|
+
Dispose the bridge (alias for disconnect).
|
|
118
|
+
|
|
119
|
+
#### Returns
|
|
120
|
+
|
|
121
|
+
`void`
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
### extractParams()
|
|
126
|
+
|
|
127
|
+
```ts
|
|
128
|
+
protected extractParams(pathname, stateId): Record<string, string>;
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Defined in: play-router/dist/router-bridge-base.d.ts:134
|
|
132
|
+
|
|
133
|
+
Extract path parameters from URL using the URLPattern API.
|
|
134
|
+
|
|
135
|
+
Accesses `globalThis.URLPattern` at runtime — no polyfill is imported by this
|
|
136
|
+
library. If `URLPattern` is unavailable (Node.js < 24, older browsers without a
|
|
137
|
+
polyfill), this method returns `{}` silently (graceful degradation — routing still
|
|
138
|
+
works, params will be empty).
|
|
139
|
+
|
|
140
|
+
#### Parameters
|
|
141
|
+
|
|
142
|
+
| Parameter | Type | Description |
|
|
143
|
+
| ---------- | -------- | ------------------------------------------------- |
|
|
144
|
+
| `pathname` | `string` | The actual URL path (e.g., '/profile/john') |
|
|
145
|
+
| `stateId` | `string` | The matched state ID for looking up route pattern |
|
|
146
|
+
|
|
147
|
+
#### Returns
|
|
148
|
+
|
|
149
|
+
`Record`\<`string`, `string`\>
|
|
150
|
+
|
|
151
|
+
Extracted path parameters, or empty object if URLPattern is unavailable or no match
|
|
152
|
+
|
|
153
|
+
#### Inherited from
|
|
154
|
+
|
|
155
|
+
[`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`extractParams`](../../play-router/classes/RouterBridgeBase.md#extractparams)
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
### extractQuery()
|
|
160
|
+
|
|
161
|
+
```ts
|
|
162
|
+
protected extractQuery(search): Record<string, string>;
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Defined in: play-router/dist/router-bridge-base.d.ts:141
|
|
166
|
+
|
|
167
|
+
Extract query parameters from URL search string.
|
|
168
|
+
|
|
169
|
+
#### Parameters
|
|
170
|
+
|
|
171
|
+
| Parameter | Type | Description |
|
|
172
|
+
| --------- | -------- | ------------------------------------------------ |
|
|
173
|
+
| `search` | `string` | URL search string (e.g., '?tab=security&page=1') |
|
|
174
|
+
|
|
175
|
+
#### Returns
|
|
176
|
+
|
|
177
|
+
`Record`\<`string`, `string`\>
|
|
178
|
+
|
|
179
|
+
Extracted query parameters or empty object
|
|
180
|
+
|
|
181
|
+
#### Inherited from
|
|
182
|
+
|
|
183
|
+
[`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`extractQuery`](../../play-router/classes/RouterBridgeBase.md#extractquery)
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
### getInitialRouterPath()
|
|
188
|
+
|
|
189
|
+
```ts
|
|
190
|
+
protected getInitialRouterPath(): string | null;
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Defined in: [play-tanstack-solid-router/src/solid-router-bridge.ts:80](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-tanstack-solid-router/src/solid-router-bridge.ts#L80)
|
|
194
|
+
|
|
195
|
+
Get the router's current path at connect() time for initial sync.
|
|
196
|
+
|
|
197
|
+
TanStack Router exposes router.state.location.pathname synchronously,
|
|
198
|
+
so we can read it here to drive the actor to the correct initial state
|
|
199
|
+
when the user cold-loads on a deep-link URL.
|
|
200
|
+
|
|
201
|
+
#### Returns
|
|
202
|
+
|
|
203
|
+
`string` \| `null`
|
|
204
|
+
|
|
205
|
+
#### Overrides
|
|
206
|
+
|
|
207
|
+
[`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`getInitialRouterPath`](../../play-router/classes/RouterBridgeBase.md#getinitialrouterpath)
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
### navigateRouter()
|
|
212
|
+
|
|
213
|
+
```ts
|
|
214
|
+
protected navigateRouter(path): void;
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Defined in: [play-tanstack-solid-router/src/solid-router-bridge.ts:69](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-tanstack-solid-router/src/solid-router-bridge.ts#L69)
|
|
218
|
+
|
|
219
|
+
Navigate TanStack Solid Router to the given path.
|
|
220
|
+
|
|
221
|
+
#### Parameters
|
|
222
|
+
|
|
223
|
+
| Parameter | Type |
|
|
224
|
+
| --------- | -------- |
|
|
225
|
+
| `path` | `string` |
|
|
226
|
+
|
|
227
|
+
#### Returns
|
|
228
|
+
|
|
229
|
+
`void`
|
|
230
|
+
|
|
231
|
+
#### Overrides
|
|
232
|
+
|
|
233
|
+
[`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`navigateRouter`](../../play-router/classes/RouterBridgeBase.md#navigaterouter)
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
### syncActorFromRouter()
|
|
238
|
+
|
|
239
|
+
```ts
|
|
240
|
+
protected syncActorFromRouter(pathname, search?): void;
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
Defined in: play-router/dist/router-bridge-base.d.ts:101
|
|
244
|
+
|
|
245
|
+
Sync actor state when router location changes.
|
|
246
|
+
|
|
247
|
+
Sends play.route event to actor with resolved stateId, params, and query.
|
|
248
|
+
Prevents circular updates via isProcessingNavigation flag.
|
|
249
|
+
|
|
250
|
+
#### Parameters
|
|
251
|
+
|
|
252
|
+
| Parameter | Type |
|
|
253
|
+
| ---------- | -------- |
|
|
254
|
+
| `pathname` | `string` |
|
|
255
|
+
| `search?` | `string` |
|
|
256
|
+
|
|
257
|
+
#### Returns
|
|
258
|
+
|
|
259
|
+
`void`
|
|
260
|
+
|
|
261
|
+
#### Inherited from
|
|
262
|
+
|
|
263
|
+
[`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`syncActorFromRouter`](../../play-router/classes/RouterBridgeBase.md#syncactorfromrouter)
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
### syncRouterFromActor()
|
|
268
|
+
|
|
269
|
+
```ts
|
|
270
|
+
protected syncRouterFromActor(route): void;
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
Defined in: play-router/dist/router-bridge-base.d.ts:94
|
|
274
|
+
|
|
275
|
+
Sync router location when actor route signal changes.
|
|
276
|
+
|
|
277
|
+
Calls navigateRouter() for framework-specific navigation.
|
|
278
|
+
Prevents circular updates via isProcessingNavigation flag.
|
|
279
|
+
|
|
280
|
+
#### Parameters
|
|
281
|
+
|
|
282
|
+
| Parameter | Type |
|
|
283
|
+
| --------- | --------- |
|
|
284
|
+
| `route` | `unknown` |
|
|
285
|
+
|
|
286
|
+
#### Returns
|
|
287
|
+
|
|
288
|
+
`void`
|
|
289
|
+
|
|
290
|
+
#### Inherited from
|
|
291
|
+
|
|
292
|
+
[`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`syncRouterFromActor`](../../play-router/classes/RouterBridgeBase.md#syncrouterfromactor)
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
296
|
+
### unwatchRouterChanges()
|
|
297
|
+
|
|
298
|
+
```ts
|
|
299
|
+
protected unwatchRouterChanges(): void;
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
Defined in: [play-tanstack-solid-router/src/solid-router-bridge.ts:112](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-tanstack-solid-router/src/solid-router-bridge.ts#L112)
|
|
303
|
+
|
|
304
|
+
Stop watching TanStack Router changes.
|
|
305
|
+
|
|
306
|
+
#### Returns
|
|
307
|
+
|
|
308
|
+
`void`
|
|
309
|
+
|
|
310
|
+
#### Overrides
|
|
311
|
+
|
|
312
|
+
[`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`unwatchRouterChanges`](../../play-router/classes/RouterBridgeBase.md#unwatchrouterchanges)
|
|
313
|
+
|
|
314
|
+
---
|
|
315
|
+
|
|
316
|
+
### watchRouterChanges()
|
|
317
|
+
|
|
318
|
+
```ts
|
|
319
|
+
protected watchRouterChanges(): void;
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
Defined in: [play-tanstack-solid-router/src/solid-router-bridge.ts:98](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-tanstack-solid-router/src/solid-router-bridge.ts#L98)
|
|
323
|
+
|
|
324
|
+
Subscribe to ALL navigation events via router.history.
|
|
325
|
+
|
|
326
|
+
router.history.subscribe fires for PUSH, POP, BACK, FORWARD, REPLACE, and GO —
|
|
327
|
+
covering both link clicks and browser back/forward button presses.
|
|
328
|
+
|
|
329
|
+
The subscriber callback receives { location, action } where location is the
|
|
330
|
+
new history location with pathname and search already updated.
|
|
331
|
+
|
|
332
|
+
Using router.history rather than router.subscribe("onBeforeLoad") ensures
|
|
333
|
+
back/forward works regardless of whether <RouterProvider> is mounted.
|
|
334
|
+
|
|
335
|
+
Also registers onCleanup() so Solid automatically disconnects on unmount.
|
|
336
|
+
|
|
337
|
+
#### Returns
|
|
338
|
+
|
|
339
|
+
`void`
|
|
340
|
+
|
|
341
|
+
#### Overrides
|
|
342
|
+
|
|
343
|
+
[`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`watchRouterChanges`](../../play-router/classes/RouterBridgeBase.md#watchrouterchanges)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
[Documentation](../../../README.md) / [@xmachines/play-tanstack-solid-router](../README.md) / PlayRouterProvider
|
|
2
|
+
|
|
3
|
+
# Function: PlayRouterProvider()
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
function PlayRouterProvider(props): any;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [play-tanstack-solid-router/src/play-router-provider.tsx:17](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-tanstack-solid-router/src/play-router-provider.tsx#L17)
|
|
10
|
+
|
|
11
|
+
## Parameters
|
|
12
|
+
|
|
13
|
+
| Parameter | Type |
|
|
14
|
+
| --------- | --------------------------------------------------------------------- |
|
|
15
|
+
| `props` | [`PlayRouterProviderProps`](../interfaces/PlayRouterProviderProps.md) |
|
|
16
|
+
|
|
17
|
+
## Returns
|
|
18
|
+
|
|
19
|
+
`any`
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
[Documentation](../../../README.md) / [@xmachines/play-tanstack-solid-router](../README.md) / createRouteMap
|
|
2
|
+
|
|
3
|
+
# Function: createRouteMap()
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
function createRouteMap(machine): RouteMap;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [play-tanstack-solid-router/src/create-route-map.ts:27](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-tanstack-solid-router/src/create-route-map.ts#L27)
|
|
10
|
+
|
|
11
|
+
Create a RouteMap from an XState machine
|
|
12
|
+
|
|
13
|
+
## Parameters
|
|
14
|
+
|
|
15
|
+
| Parameter | Type | Description |
|
|
16
|
+
| --------- | ----------------- | ---------------------------------------------- |
|
|
17
|
+
| `machine` | `AnyStateMachine` | XState machine with route: {} config on states |
|
|
18
|
+
|
|
19
|
+
## Returns
|
|
20
|
+
|
|
21
|
+
[`RouteMap`](../classes/RouteMap.md)
|
|
22
|
+
|
|
23
|
+
RouteMap for bidirectional state ID ↔ path resolution
|
|
24
|
+
|
|
25
|
+
## Example
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
import { createRouteMap } from "@xmachines/play-tanstack-solid-router";
|
|
29
|
+
import { authMachine } from "./machine.js";
|
|
30
|
+
|
|
31
|
+
const routeMap = createRouteMap(authMachine);
|
|
32
|
+
```
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
[Documentation](../../../README.md) / [@xmachines/play-tanstack-solid-router](../README.md) / PlayRouteEvent
|
|
2
|
+
|
|
3
|
+
# Interface: PlayRouteEvent
|
|
4
|
+
|
|
5
|
+
Defined in: play-router/dist/types.d.ts:182
|
|
6
|
+
|
|
7
|
+
Enhanced routing event with parameter and query support
|
|
8
|
+
|
|
9
|
+
Unified routing event used throughout the Play architecture. Supports parameter-aware
|
|
10
|
+
navigation patterns (e.g., `/profile/:userId`) for dynamic route segments.
|
|
11
|
+
|
|
12
|
+
**Architectural Context:** Implements **Passive Infrastructure (INV-04)** by representing
|
|
13
|
+
user navigation intent that the Actor evaluates through guards. Infrastructure proposes
|
|
14
|
+
via `play.route` events, Actor decides via state machine transitions.
|
|
15
|
+
|
|
16
|
+
**Browser Navigation Flow:**
|
|
17
|
+
|
|
18
|
+
1. Browser fires `popstate`
|
|
19
|
+
2. Router adapter resolves URL to route target
|
|
20
|
+
3. Adapter sends `PlayRouteEvent` to Actor
|
|
21
|
+
4. Actor validates transition via state machine guards
|
|
22
|
+
|
|
23
|
+
## Param
|
|
24
|
+
|
|
25
|
+
Event discriminator (always "play.route")
|
|
26
|
+
|
|
27
|
+
## Param
|
|
28
|
+
|
|
29
|
+
Target state ID with # prefix (e.g., '#home', '#profile')
|
|
30
|
+
|
|
31
|
+
## Param
|
|
32
|
+
|
|
33
|
+
Merged path + query parameters (path parameters win conflicts)
|
|
34
|
+
|
|
35
|
+
## Param
|
|
36
|
+
|
|
37
|
+
Query parameters only (isolated from path params)
|
|
38
|
+
|
|
39
|
+
## Param
|
|
40
|
+
|
|
41
|
+
Full URLPattern match result for debugging/observability (optional)
|
|
42
|
+
|
|
43
|
+
## Examples
|
|
44
|
+
|
|
45
|
+
Combining base and routing events
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
import type { PlayEvent } from "@xmachines/play";
|
|
49
|
+
import type { PlayRouteEvent } from "@xmachines/play-router";
|
|
50
|
+
|
|
51
|
+
type AppEvent = PlayEvent | PlayRouteEvent;
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Basic navigation to a route
|
|
55
|
+
|
|
56
|
+
```typescript
|
|
57
|
+
import type { PlayRouteEvent } from "@xmachines/play-router";
|
|
58
|
+
|
|
59
|
+
const event: PlayRouteEvent = {
|
|
60
|
+
type: "play.route",
|
|
61
|
+
to: "#home",
|
|
62
|
+
};
|
|
63
|
+
actor.send(event);
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Navigation with route parameters
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
import type { PlayRouteEvent } from "@xmachines/play-router";
|
|
70
|
+
|
|
71
|
+
const event: PlayRouteEvent = {
|
|
72
|
+
type: "play.route",
|
|
73
|
+
to: "#profile",
|
|
74
|
+
params: { userId: "123" },
|
|
75
|
+
};
|
|
76
|
+
actor.send(event);
|
|
77
|
+
// Resolves to route: /profile/123
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Navigation with query parameters
|
|
81
|
+
|
|
82
|
+
```typescript
|
|
83
|
+
import type { PlayRouteEvent } from "@xmachines/play-router";
|
|
84
|
+
|
|
85
|
+
const event: PlayRouteEvent = {
|
|
86
|
+
type: "play.route",
|
|
87
|
+
to: "#settings",
|
|
88
|
+
params: { section: "profile" }, // Merged: path + query
|
|
89
|
+
query: { tab: "security" }, // Query-only
|
|
90
|
+
};
|
|
91
|
+
actor.send(event);
|
|
92
|
+
// Resolves to route: /settings/profile?tab=security
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## See
|
|
96
|
+
|
|
97
|
+
[RFC Play v1](https://gitlab.com/xmachin-es/rfc/-/blob/main/src/play-v1.md)
|
|
98
|
+
|
|
99
|
+
## Remarks
|
|
100
|
+
|
|
101
|
+
Use `play.route` when you need parameter-aware navigation with the `route: {}`
|
|
102
|
+
config pattern on your state machine nodes. The `match` field exposes the full
|
|
103
|
+
URLPatternResult for advanced use cases (debugging, pattern analysis).
|
|
104
|
+
|
|
105
|
+
## Indexable
|
|
106
|
+
|
|
107
|
+
```ts
|
|
108
|
+
[key: string]: unknown
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Properties
|
|
112
|
+
|
|
113
|
+
| Property | Modifier | Type | Defined in |
|
|
114
|
+
| -------------------------------------- | ---------- | ------------------------------ | ------------------------------- |
|
|
115
|
+
| <a id="property-match"></a> `match?` | `readonly` | `unknown` | play-router/dist/types.d.ts:187 |
|
|
116
|
+
| <a id="property-params"></a> `params?` | `readonly` | `Record`\<`string`, `string`\> | play-router/dist/types.d.ts:185 |
|
|
117
|
+
| <a id="property-query"></a> `query?` | `readonly` | `Record`\<`string`, `string`\> | play-router/dist/types.d.ts:186 |
|
|
118
|
+
| <a id="property-to"></a> `to` | `readonly` | `string` | play-router/dist/types.d.ts:184 |
|
|
119
|
+
| <a id="property-type"></a> `type` | `readonly` | `"play.route"` | play-router/dist/types.d.ts:183 |
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
[Documentation](../../../README.md) / [@xmachines/play-tanstack-solid-router](../README.md) / PlayRouterProviderProps
|
|
2
|
+
|
|
3
|
+
# Interface: PlayRouterProviderProps
|
|
4
|
+
|
|
5
|
+
Defined in: [play-tanstack-solid-router/src/play-router-provider.tsx:10](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-tanstack-solid-router/src/play-router-provider.tsx#L10)
|
|
6
|
+
|
|
7
|
+
## Properties
|
|
8
|
+
|
|
9
|
+
| Property | Type | Defined in |
|
|
10
|
+
| ----------------------------------------- | ------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
11
|
+
| <a id="property-actor"></a> `actor` | [`RoutableActor`](../type-aliases/RoutableActor.md) | [play-tanstack-solid-router/src/play-router-provider.tsx:11](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-tanstack-solid-router/src/play-router-provider.tsx#L11) |
|
|
12
|
+
| <a id="property-renderer"></a> `renderer` | (`actor`, `router`) => `any` | [play-tanstack-solid-router/src/play-router-provider.tsx:14](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-tanstack-solid-router/src/play-router-provider.tsx#L14) |
|
|
13
|
+
| <a id="property-routemap"></a> `routeMap` | [`RouteMap`](../classes/RouteMap.md) | [play-tanstack-solid-router/src/play-router-provider.tsx:13](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-tanstack-solid-router/src/play-router-provider.tsx#L13) |
|
|
14
|
+
| <a id="property-router"></a> `router` | [`TanStackRouterLike`](../type-aliases/TanStackRouterLike.md) | [play-tanstack-solid-router/src/play-router-provider.tsx:12](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-tanstack-solid-router/src/play-router-provider.tsx#L12) |
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
[Documentation](../../../README.md) / [@xmachines/play-tanstack-solid-router](../README.md) / RouteMapping
|
|
2
|
+
|
|
3
|
+
# Interface: RouteMapping
|
|
4
|
+
|
|
5
|
+
Defined in: [play-tanstack-solid-router/src/types.ts:19](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-tanstack-solid-router/src/types.ts#L19)
|
|
6
|
+
|
|
7
|
+
A single state ID ↔ path mapping entry for the TanStack Solid Router adapter.
|
|
8
|
+
|
|
9
|
+
Structurally compatible with `BaseRouteMapping` from `@xmachines/play-router`.
|
|
10
|
+
Fields are `readonly` — entries are immutable once passed to `RouteMap`.
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
const mapping: RouteMapping = { stateId: "#profile", path: "/profile/:userId" };
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Properties
|
|
19
|
+
|
|
20
|
+
| Property | Modifier | Type | Description | Defined in |
|
|
21
|
+
| --------------------------------------- | ---------- | -------- | ----------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
22
|
+
| <a id="property-path"></a> `path` | `readonly` | `string` | TanStack Router path pattern (e.g., `"/"`, `"/profile/:userId"`, `"/settings/:section?"`) | [play-tanstack-solid-router/src/types.ts:23](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-tanstack-solid-router/src/types.ts#L23) |
|
|
23
|
+
| <a id="property-stateid"></a> `stateId` | `readonly` | `string` | XMachines state ID (e.g., `"#home"`, `"#profile"`) | [play-tanstack-solid-router/src/types.ts:21](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-tanstack-solid-router/src/types.ts#L21) |
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
[Documentation](../../../README.md) / [@xmachines/play-tanstack-solid-router](../README.md) / RouterBridge
|
|
2
|
+
|
|
3
|
+
# Interface: RouterBridge
|
|
4
|
+
|
|
5
|
+
Defined in: play-router/dist/types.d.ts:229
|
|
6
|
+
|
|
7
|
+
RouterBridge interface for runtime infrastructure adapters
|
|
8
|
+
|
|
9
|
+
Defines the lifecycle connection between Infrastructure (e.g., TanStack Router) and
|
|
10
|
+
the Actor. Infrastructure "bridges" to the Actor by observing its signals and
|
|
11
|
+
managing its own lifecycle accordingly.
|
|
12
|
+
|
|
13
|
+
**Architectural Context:** Implements **Passive Infrastructure (INV-04)** by establishing
|
|
14
|
+
a unidirectional observation pattern. Infrastructure connects to observe Actor signals
|
|
15
|
+
(currentRoute, currentView, state) and reflects changes without making state decisions.
|
|
16
|
+
|
|
17
|
+
## Example
|
|
18
|
+
|
|
19
|
+
TanStack Router bridge implementation
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
import type { RouterBridge } from "@xmachines/play-router";
|
|
23
|
+
import { Signal } from "@xmachines/play-signals";
|
|
24
|
+
|
|
25
|
+
class TanStackRouterBridge implements RouterBridge {
|
|
26
|
+
private watcher: Signal.Watcher | null = null;
|
|
27
|
+
|
|
28
|
+
async connect(): Promise<void> {
|
|
29
|
+
// Start observing actor.currentRoute signal
|
|
30
|
+
this.watcher = new Signal.subtle.Watcher(() => {
|
|
31
|
+
const route = actor.currentRoute.get();
|
|
32
|
+
if (route) router.navigate(route);
|
|
33
|
+
});
|
|
34
|
+
this.watcher.watch(actor.currentRoute);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async disconnect(): Promise<void> {
|
|
38
|
+
// Stop observing, cleanup watchers
|
|
39
|
+
this.watcher?.unwatch(actor.currentRoute);
|
|
40
|
+
this.watcher = null;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## See
|
|
46
|
+
|
|
47
|
+
[RFC Play v1 - Invariant INV-04](https://gitlab.com/xmachin-es/rfc/-/blob/main/src/play-v1.md)
|
|
48
|
+
|
|
49
|
+
## Methods
|
|
50
|
+
|
|
51
|
+
### connect()
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
connect(): void | Promise<void>;
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Defined in: play-router/dist/types.d.ts:245
|
|
58
|
+
|
|
59
|
+
Connect the router bridge to the Actor
|
|
60
|
+
|
|
61
|
+
Called when Infrastructure should begin observing Actor signals and
|
|
62
|
+
synchronizing its state (e.g., browser URL) with Actor state.
|
|
63
|
+
|
|
64
|
+
#### Returns
|
|
65
|
+
|
|
66
|
+
`void` \| `Promise`\<`void`\>
|
|
67
|
+
|
|
68
|
+
Promise that resolves when connection is established, or void for synchronous connection
|
|
69
|
+
|
|
70
|
+
#### Example
|
|
71
|
+
|
|
72
|
+
```typescript
|
|
73
|
+
const bridge: RouterBridge = createBridge(actor, router);
|
|
74
|
+
await bridge.connect();
|
|
75
|
+
// Bridge now observing actor.currentRoute signal
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
### disconnect()
|
|
81
|
+
|
|
82
|
+
```ts
|
|
83
|
+
disconnect(): void | Promise<void>;
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Defined in: play-router/dist/types.d.ts:260
|
|
87
|
+
|
|
88
|
+
Disconnect the router bridge from the Actor
|
|
89
|
+
|
|
90
|
+
Called when Infrastructure should stop observing and clean up resources
|
|
91
|
+
(e.g., signal watchers, event listeners).
|
|
92
|
+
|
|
93
|
+
#### Returns
|
|
94
|
+
|
|
95
|
+
`void` \| `Promise`\<`void`\>
|
|
96
|
+
|
|
97
|
+
Promise that resolves when disconnection is complete, or void for synchronous disconnection
|
|
98
|
+
|
|
99
|
+
#### Example
|
|
100
|
+
|
|
101
|
+
```typescript
|
|
102
|
+
await bridge.disconnect();
|
|
103
|
+
// Bridge stopped observing, resources cleaned up
|
|
104
|
+
```
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
[Documentation](../../../README.md) / [@xmachines/play-tanstack-solid-router](../README.md) / RoutableActor
|
|
2
|
+
|
|
3
|
+
# Type Alias: RoutableActor
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
type RoutableActor = AbstractActor<AnyActorLogic> & Routable & Viewable;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [play-tanstack-solid-router/src/play-router-provider.tsx:7](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-tanstack-solid-router/src/play-router-provider.tsx#L7)
|