@xmachines/docs 1.0.0-beta.16 → 1.0.0-beta.18
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/api/@xmachines/play/README.md +56 -17
- package/api/@xmachines/play/classes/PlayError.md +240 -0
- package/api/@xmachines/play/type-aliases/PlayEvent.md +4 -4
- package/api/@xmachines/play-actor/README.md +32 -31
- package/api/@xmachines/play-actor/classes/AbstractActor.md +20 -19
- package/api/@xmachines/play-actor/interfaces/PlaySpec.md +37 -0
- package/api/@xmachines/play-actor/interfaces/Routable.md +5 -4
- package/api/@xmachines/play-actor/interfaces/ViewMetadata.md +6 -6
- package/api/@xmachines/play-actor/interfaces/Viewable.md +8 -8
- package/api/@xmachines/play-dom/README.md +36 -0
- package/api/@xmachines/play-dom/classes/PlayRenderer.md +83 -0
- package/api/@xmachines/play-dom/functions/connectRenderer.md +51 -0
- package/api/@xmachines/play-dom/functions/renderSpec.md +28 -0
- package/api/@xmachines/play-dom/interfaces/ConnectRendererOptions.md +18 -0
- package/api/@xmachines/play-dom/interfaces/DomRenderContext.md +18 -0
- package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +14 -0
- package/api/@xmachines/play-dom/type-aliases/DomComponentRenderer.md +23 -0
- package/api/@xmachines/play-dom/type-aliases/DomRegistry.md +11 -0
- package/api/@xmachines/play-react/README.md +227 -305
- package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +5 -5
- package/api/@xmachines/play-react/functions/defineRegistry.md +47 -0
- package/api/@xmachines/play-react/functions/useActor.md +13 -0
- package/api/@xmachines/play-react/functions/useBoundProp.md +43 -0
- package/api/@xmachines/play-react/functions/useSignalEffect.md +1 -1
- package/api/@xmachines/play-react/functions/useStateBinding.md +32 -0
- package/api/@xmachines/play-react/interfaces/ComponentContext.md +35 -0
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryProps.md +4 -4
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryState.md +3 -3
- package/api/@xmachines/play-react/interfaces/PlayRendererProps.md +15 -7
- package/api/@xmachines/play-react/type-aliases/ComponentFn.md +34 -0
- package/api/@xmachines/play-react/type-aliases/PlayActor.md +9 -0
- package/api/@xmachines/play-react/variables/PlayRenderer.md +18 -30
- package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +32 -32
- package/api/@xmachines/play-react-router/classes/RouteMap.md +5 -5
- package/api/@xmachines/play-react-router/functions/PlayRouterProvider.md +11 -5
- package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +1 -1
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +14 -8
- package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-router/README.md +51 -0
- package/api/@xmachines/play-router/classes/BaseRouteMap.md +6 -6
- package/api/@xmachines/play-router/classes/RouterBridgeBase.md +33 -35
- package/api/@xmachines/play-router/functions/buildRouteTree.md +1 -1
- package/api/@xmachines/play-router/functions/connectRouter.md +1 -1
- package/api/@xmachines/play-router/functions/crawlMachine.md +1 -1
- package/api/@xmachines/play-router/functions/createBrowserHistory.md +4 -1
- package/api/@xmachines/play-router/functions/createRouteMap.md +3 -3
- package/api/@xmachines/play-router/functions/createRouter.md +1 -1
- package/api/@xmachines/play-router/functions/detectDuplicateRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/extractMachineRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/extractRoute.md +1 -1
- package/api/@xmachines/play-router/functions/findRouteById.md +1 -1
- package/api/@xmachines/play-router/functions/findRouteByPath.md +1 -1
- package/api/@xmachines/play-router/functions/getNavigableRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/getRoutableRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/routeExists.md +1 -1
- package/api/@xmachines/play-router/functions/validateRouteFormat.md +1 -1
- package/api/@xmachines/play-router/functions/validateStateExists.md +1 -1
- package/api/@xmachines/play-router/interfaces/BaseRouteMapping.md +3 -3
- package/api/@xmachines/play-router/interfaces/BrowserHistory.md +19 -15
- package/api/@xmachines/play-router/interfaces/BrowserWindow.md +14 -14
- package/api/@xmachines/play-router/interfaces/ConnectRouterOptions.md +6 -6
- package/api/@xmachines/play-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-router/interfaces/RouteInfo.md +8 -8
- package/api/@xmachines/play-router/interfaces/RouteMap.md +4 -4
- package/api/@xmachines/play-router/interfaces/RouteNode.md +10 -10
- package/api/@xmachines/play-router/interfaces/RouteObject.md +2 -2
- package/api/@xmachines/play-router/interfaces/RouteTree.md +4 -4
- package/api/@xmachines/play-router/interfaces/RouteWatcherHandle.md +55 -0
- package/api/@xmachines/play-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-router/interfaces/StateVisit.md +4 -4
- package/api/@xmachines/play-router/interfaces/VanillaRouter.md +4 -4
- package/api/@xmachines/play-router/type-aliases/RouteMetadata.md +1 -1
- package/api/@xmachines/play-signals/README.md +22 -10
- package/api/@xmachines/play-signals/functions/watchSignal.md +35 -0
- package/api/@xmachines/play-signals/interfaces/ComputedOptions.md +2 -2
- package/api/@xmachines/play-signals/interfaces/SignalComputed.md +2 -2
- package/api/@xmachines/play-signals/interfaces/SignalOptions.md +2 -2
- package/api/@xmachines/play-signals/interfaces/SignalState.md +3 -3
- package/api/@xmachines/play-signals/interfaces/SignalWatcher.md +4 -4
- package/api/@xmachines/play-signals/type-aliases/WatcherNotify.md +1 -1
- package/api/@xmachines/play-solid/README.md +193 -219
- package/api/@xmachines/play-solid/functions/defineRegistry.md +47 -0
- package/api/@xmachines/play-solid/functions/useActor.md +13 -0
- package/api/@xmachines/play-solid/functions/useStateBinding.md +23 -0
- package/api/@xmachines/play-solid/interfaces/ComponentContext.md +35 -0
- package/api/@xmachines/play-solid/interfaces/PlayRendererProps.md +15 -7
- package/api/@xmachines/play-solid/type-aliases/ComponentFn.md +34 -0
- package/api/@xmachines/play-solid/type-aliases/PlayActor.md +9 -0
- package/api/@xmachines/play-solid/variables/PlayRenderer.md +15 -43
- package/api/@xmachines/play-solid-router/README.md +56 -30
- package/api/@xmachines/play-solid-router/classes/RouteMap.md +6 -6
- package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +37 -37
- package/api/@xmachines/play-solid-router/functions/PlayRouterProvider.md +11 -5
- package/api/@xmachines/play-solid-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-solid-router/interfaces/AbstractActor.md +18 -17
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +14 -8
- package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-solid-router/type-aliases/RoutableActor.md +3 -1
- package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +4 -4
- package/api/@xmachines/play-tanstack-react-router/README.md +1 -5
- package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +5 -5
- package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +45 -33
- package/api/@xmachines/play-tanstack-react-router/functions/PlayRouterProvider.md +11 -5
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMap.md +2 -2
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMapFromTree.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/functions/extractParams.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/functions/extractQueryParams.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +14 -8
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteNavigateEvent.md +3 -3
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterInstance.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterLike.md +24 -4
- package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +6 -6
- package/api/@xmachines/play-tanstack-solid-router/classes/SolidRouterBridge.md +33 -33
- package/api/@xmachines/play-tanstack-solid-router/functions/PlayRouterProvider.md +11 -5
- package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +14 -8
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/RoutableActor.md +3 -1
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterInstance.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterLike.md +4 -4
- package/api/@xmachines/play-vue/README.md +219 -209
- package/api/@xmachines/play-vue/functions/defineRegistry.md +32 -0
- package/api/@xmachines/play-vue/functions/useActor.md +13 -0
- package/api/@xmachines/play-vue/functions/useStateBinding.md +30 -0
- package/api/@xmachines/play-vue/interfaces/ComponentContext.md +35 -0
- package/api/@xmachines/play-vue/interfaces/PlayRendererProps.md +14 -6
- package/api/@xmachines/play-vue/type-aliases/ComponentEntry.md +16 -0
- package/api/@xmachines/play-vue/type-aliases/ComponentFn.md +33 -0
- package/api/@xmachines/play-vue/type-aliases/ComponentsMap.md +15 -0
- package/api/@xmachines/play-vue/type-aliases/DefineRegistryOptions.md +21 -0
- package/api/@xmachines/play-vue/type-aliases/PlayActor.md +9 -0
- package/api/@xmachines/play-vue/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-vue-router/README.md +74 -29
- package/api/@xmachines/play-vue-router/classes/RouteMap.md +7 -7
- package/api/@xmachines/play-vue-router/classes/VueBaseRouteMap.md +7 -7
- package/api/@xmachines/play-vue-router/classes/VueRouterBridge.md +48 -51
- package/api/@xmachines/play-vue-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-vue-router/interfaces/RouteMapping.md +4 -4
- package/api/@xmachines/play-vue-router/type-aliases/RoutableActor.md +3 -1
- package/api/@xmachines/play-vue-router/variables/PlayRouterProvider.md +7 -1
- package/api/@xmachines/play-xstate/README.md +236 -111
- package/api/@xmachines/play-xstate/classes/PlayerActor.md +36 -33
- package/api/@xmachines/play-xstate/functions/buildRouteUrl.md +24 -18
- package/api/@xmachines/play-xstate/functions/composeGuards.md +1 -1
- package/api/@xmachines/play-xstate/functions/composeGuardsOr.md +1 -1
- package/api/@xmachines/play-xstate/functions/definePlayer.md +12 -61
- package/api/@xmachines/play-xstate/functions/deriveRoute.md +1 -1
- package/api/@xmachines/play-xstate/functions/eventMatches.md +1 -1
- package/api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md +1 -1
- package/api/@xmachines/play-xstate/functions/hasContext.md +1 -1
- package/api/@xmachines/play-xstate/functions/isAbsoluteRoute.md +1 -1
- package/api/@xmachines/play-xstate/functions/negateGuard.md +1 -1
- package/api/@xmachines/play-xstate/functions/stateMatches.md +1 -1
- package/api/@xmachines/play-xstate/interfaces/PlayerConfig.md +9 -13
- package/api/@xmachines/play-xstate/interfaces/PlayerFactoryResumeOptions.md +2 -2
- package/api/@xmachines/play-xstate/interfaces/PlayerOptions.md +8 -9
- package/api/@xmachines/play-xstate/interfaces/RouteContext.md +5 -5
- package/api/@xmachines/play-xstate/type-aliases/ComposedGuard.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/Guard.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/GuardArray.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/PlayerFactory.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/RouteMachineConfig.md +14 -4
- package/api/@xmachines/play-xstate/type-aliases/RouteStateNode.md +19 -4
- package/api/@xmachines/shared/functions/defineXmVitestConfig.md +2 -2
- package/api/@xmachines/shared/functions/xmAliases.md +1 -1
- package/api/README.md +2 -2
- package/api/llms.txt +12 -6
- package/examples/multi-router-integration.md +31 -19
- package/guides/README.md +2 -1
- package/guides/installation.md +1 -6
- package/package.json +2 -2
- package/api/@xmachines/play-catalog/README.md +0 -331
- package/api/@xmachines/play-catalog/functions/defineCatalog.md +0 -98
- package/api/@xmachines/play-catalog/functions/defineComponents.md +0 -134
- package/api/@xmachines/play-catalog/type-aliases/Catalog.md +0 -48
- package/api/@xmachines/play-catalog/type-aliases/ComponentsFor.md +0 -20
- package/api/@xmachines/play-catalog/type-aliases/InferComponentProps.md +0 -65
- package/api/@xmachines/play-catalog/type-aliases/NoExtraKeys.md +0 -17
- package/api/@xmachines/play-xstate/functions/mergeViewProps.md +0 -26
- package/api/@xmachines/play-xstate/functions/validateComponentBinding.md +0 -39
- package/api/@xmachines/play-xstate/functions/validateViewProps.md +0 -80
- package/api/@xmachines/play-xstate/interfaces/CatalogEntry.md +0 -16
- package/api/@xmachines/play-xstate/type-aliases/Catalog.md +0 -21
- package/api/@xmachines/play-xstate/type-aliases/ValidationResult.md +0 -17
- package/api/@xmachines/play-xstate/type-aliases/ViewMergeContext.md +0 -35
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
[Documentation](../../../README.md) / [@xmachines/play-solid-router](../README.md) / AbstractActor
|
|
2
2
|
|
|
3
|
-
# Abstract Interface: AbstractActor\<TLogic\>
|
|
3
|
+
# Abstract Interface: AbstractActor\<TLogic, TEvent\>
|
|
4
4
|
|
|
5
|
-
Defined in: packages/play-actor/dist/abstract-actor.d.ts:
|
|
5
|
+
Defined in: packages/play-actor/dist/abstract-actor.d.ts:225
|
|
6
6
|
|
|
7
7
|
Abstract base class for Play Architecture actors.
|
|
8
8
|
|
|
@@ -23,7 +23,7 @@ Concrete implementations created by @xmachines/play-xstate adapter.
|
|
|
23
23
|
|
|
24
24
|
## Examples
|
|
25
25
|
|
|
26
|
-
Simple actor (no routing, no view)
|
|
26
|
+
Simple actor (no routing, no view) - single type param, backward compat
|
|
27
27
|
|
|
28
28
|
```typescript
|
|
29
29
|
class SimpleActor extends AbstractActor<AnyActorLogic> {
|
|
@@ -32,24 +32,24 @@ class SimpleActor extends AbstractActor<AnyActorLogic> {
|
|
|
32
32
|
}
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
Typed event actor - two type params
|
|
36
36
|
|
|
37
37
|
```typescript
|
|
38
|
-
|
|
38
|
+
type AuthEvent = { type: "auth.login"; username: string } | { type: "auth.logout" };
|
|
39
|
+
class AuthActor extends AbstractActor<AnyActorLogic, AuthEvent> {
|
|
39
40
|
state = new Signal.State({...});
|
|
40
|
-
|
|
41
|
-
send(event) { ... }
|
|
41
|
+
send(event: AuthEvent) { ... }
|
|
42
42
|
}
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
Full-featured actor (routing + view)
|
|
46
46
|
|
|
47
47
|
```typescript
|
|
48
|
-
class PlayerActor extends AbstractActor<AnyActorLogic
|
|
48
|
+
class PlayerActor extends AbstractActor<AnyActorLogic, EventFromLogic<TMachine>>
|
|
49
|
+
implements Routable, Viewable {
|
|
49
50
|
state = new Signal.State({...});
|
|
50
51
|
currentRoute = new Signal.Computed(() => deriveRoute(this.state.get()));
|
|
51
52
|
currentView = new Signal.State(null);
|
|
52
|
-
catalog = {};
|
|
53
53
|
send(event) { ... }
|
|
54
54
|
}
|
|
55
55
|
```
|
|
@@ -66,9 +66,10 @@ class PlayerActor extends AbstractActor<AnyActorLogic> implements Routable, View
|
|
|
66
66
|
|
|
67
67
|
## Type Parameters
|
|
68
68
|
|
|
69
|
-
| Type Parameter | Description
|
|
70
|
-
| ---------------------------------------------------------------------------------------- |
|
|
71
|
-
| `TLogic` _extends_ [`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic) | XState actor logic type (maintains type safety)
|
|
69
|
+
| Type Parameter | Default type | Description |
|
|
70
|
+
| ---------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
71
|
+
| `TLogic` _extends_ [`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic) | - | XState actor logic type (maintains type safety) |
|
|
72
|
+
| `TEvent` _extends_ [`EventObject`](https://www.jsdocs.io/package/xstate#EventObject) | [`EventObject`](https://www.jsdocs.io/package/xstate#EventObject) | Event type union that this actor's send() accepts. Defaults to `EventObject` (`{ type: string }`) for backward compatibility. Use `EventFromLogic<TMachine>` from xstate to infer the exact event union from a state machine (e.g., in `PlayerActor`). Invariant: Actor Authority - Actor is the sole source of truth for state transitions. Invariant: Signal-Only Reactivity - Infrastructure observes via TC39 Signals. Invariant: Passive Infrastructure - Infrastructure reflects, never decides. |
|
|
72
73
|
|
|
73
74
|
## Properties
|
|
74
75
|
|
|
@@ -82,7 +83,7 @@ class PlayerActor extends AbstractActor<AnyActorLogic> implements Routable, View
|
|
|
82
83
|
| <a id="property-ref"></a> `ref` | `public` | [`ActorRef`](https://www.jsdocs.io/package/xstate#ActorRef)\<[`SnapshotFrom`](https://www.jsdocs.io/package/xstate#SnapshotFrom)\<`TLogic`\>, [`EventFromLogic`](https://www.jsdocs.io/package/xstate#EventFromLogic)\<`TLogic`\>, [`EmittedFrom`](https://www.jsdocs.io/package/xstate#EmittedFrom)\<`TLogic`\>\> | - | `Actor.ref` | - |
|
|
83
84
|
| <a id="property-sessionid"></a> `sessionId` | `public` | `string` | The globally unique process ID for this invocation. | `Actor.sessionId` | - |
|
|
84
85
|
| <a id="property-src"></a> `src` | `public` | \| `string` \| [`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic) | - | `Actor.src` | - |
|
|
85
|
-
| <a id="property-state"></a> `state` | `abstract` | [`State`](../../play-signals/namespaces/Signal/classes/State.md)\<`unknown`\> | Reactive snapshot of current actor state. Typed as `Signal.State<unknown>` at the abstract level; concrete implementations narrow this to the actual snapshot type (e.g., `Signal.State<AnyMachineSnapshot>` in `@xmachines/play-xstate`'s `PlayerActor`). Infrastructure observes this signal to react to state changes without directly coupling to the Actor's internal state machine implementation. **Example** `// Infrastructure observes state signal const watcher = new Signal.subtle.Watcher(() => { console.log('Actor state changed:', actor.state.get()); }); watcher.watch(actor.state);` | - | packages/play-actor/dist/abstract-actor.d.ts:
|
|
86
|
+
| <a id="property-state"></a> `state` | `abstract` | [`State`](../../play-signals/namespaces/Signal/classes/State.md)\<`unknown`\> | Reactive snapshot of current actor state. Typed as `Signal.State<unknown>` at the abstract level; concrete implementations narrow this to the actual snapshot type (e.g., `Signal.State<AnyMachineSnapshot>` in `@xmachines/play-xstate`'s `PlayerActor`). Infrastructure observes this signal to react to state changes without directly coupling to the Actor's internal state machine implementation. **Example** `// Infrastructure observes state signal const watcher = new Signal.subtle.Watcher(() => { console.log('Actor state changed:', actor.state.get()); }); watcher.watch(actor.state);` | - | packages/play-actor/dist/abstract-actor.d.ts:245 |
|
|
86
87
|
| <a id="property-system"></a> `system` | `public` | [`AnyActorSystem`](https://www.jsdocs.io/package/xstate#AnyActorSystem) | The system to which this actor belongs. | `Actor.system` | - |
|
|
87
88
|
| <a id="property-systemid"></a> `systemId` | `public` | `string` \| `undefined` | - | `Actor.systemId` | - |
|
|
88
89
|
|
|
@@ -243,7 +244,7 @@ Actor.select;
|
|
|
243
244
|
abstract send(event): void;
|
|
244
245
|
```
|
|
245
246
|
|
|
246
|
-
Defined in: packages/play-actor/dist/abstract-actor.d.ts:
|
|
247
|
+
Defined in: packages/play-actor/dist/abstract-actor.d.ts:268
|
|
247
248
|
|
|
248
249
|
Send event to Actor
|
|
249
250
|
|
|
@@ -253,9 +254,9 @@ each event is valid from the current state.
|
|
|
253
254
|
|
|
254
255
|
#### Parameters
|
|
255
256
|
|
|
256
|
-
| Parameter | Type
|
|
257
|
-
| --------- |
|
|
258
|
-
| `event` | `
|
|
257
|
+
| Parameter | Type | Description |
|
|
258
|
+
| --------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
259
|
+
| `event` | `TEvent` | Event object with type property (e.g., PlayEvent, PlayRouteEvent) Invariant: Actor Authority - Only Actor decides whether an event is valid. |
|
|
259
260
|
|
|
260
261
|
#### Returns
|
|
261
262
|
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
[Documentation](../../../README.md) / [@xmachines/play-solid-router](../README.md) / PlayRouterProviderProps
|
|
2
2
|
|
|
3
|
-
# Interface: PlayRouterProviderProps
|
|
3
|
+
# Interface: PlayRouterProviderProps\<TActor\>
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-solid-router/src/play-router-provider.tsx:
|
|
5
|
+
Defined in: [packages/play-solid-router/src/play-router-provider.tsx:16](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.18/packages/play-solid-router/src/play-router-provider.tsx#L16)
|
|
6
|
+
|
|
7
|
+
## Type Parameters
|
|
8
|
+
|
|
9
|
+
| Type Parameter | Default type |
|
|
10
|
+
| ---------------------------------------------------------------------- | --------------------------------------------------- |
|
|
11
|
+
| `TActor` _extends_ [`RoutableActor`](../type-aliases/RoutableActor.md) | [`RoutableActor`](../type-aliases/RoutableActor.md) |
|
|
6
12
|
|
|
7
13
|
## Properties
|
|
8
14
|
|
|
9
|
-
| Property | Type | Defined in |
|
|
10
|
-
| ----------------------------------------- | --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
11
|
-
| <a id="property-actor"></a> `actor` |
|
|
12
|
-
| <a id="property-renderer"></a> `renderer` | (`actor`, `router`) => `any` | [packages/play-solid-router/src/play-router-provider.tsx:
|
|
13
|
-
| <a id="property-routemap"></a> `routeMap` | [`RouteMap`](../classes/RouteMap.md) | [packages/play-solid-router/src/play-router-provider.tsx:
|
|
14
|
-
| <a id="property-router"></a> `router` | [`SolidRouterHooks`](../type-aliases/SolidRouterHooks.md) | [packages/play-solid-router/src/play-router-provider.tsx:
|
|
15
|
+
| Property | Type | Description | Defined in |
|
|
16
|
+
| ----------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
17
|
+
| <a id="property-actor"></a> `actor` | `TActor` | - | [packages/play-solid-router/src/play-router-provider.tsx:17](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.18/packages/play-solid-router/src/play-router-provider.tsx#L17) |
|
|
18
|
+
| <a id="property-renderer"></a> `renderer` | (`actor`, `router`) => `any` | Renderer callback receives the same concrete actor type that was passed in. | [packages/play-solid-router/src/play-router-provider.tsx:21](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.18/packages/play-solid-router/src/play-router-provider.tsx#L21) |
|
|
19
|
+
| <a id="property-routemap"></a> `routeMap` | [`RouteMap`](../classes/RouteMap.md) | - | [packages/play-solid-router/src/play-router-provider.tsx:18](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.18/packages/play-solid-router/src/play-router-provider.tsx#L18) |
|
|
20
|
+
| <a id="property-router"></a> `router` | [`SolidRouterHooks`](../type-aliases/SolidRouterHooks.md) | - | [packages/play-solid-router/src/play-router-provider.tsx:19](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.18/packages/play-solid-router/src/play-router-provider.tsx#L19) |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: RouteMapping
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-solid-router/src/types.ts:8](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
5
|
+
Defined in: [packages/play-solid-router/src/types.ts:8](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.18/packages/play-solid-router/src/types.ts#L8)
|
|
6
6
|
|
|
7
7
|
Mapping between state ID and URL path for SolidJS Router
|
|
8
8
|
|
|
@@ -10,5 +10,5 @@ Mapping between state ID and URL path for SolidJS Router
|
|
|
10
10
|
|
|
11
11
|
| Property | Modifier | Type | Description | Defined in |
|
|
12
12
|
| --------------------------------------- | ---------- | -------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
13
|
-
| <a id="property-path"></a> `path` | `readonly` | `string` | SolidJS Router path pattern **Example** `'/', '/profile/:userId', '/settings/:section?'` | [packages/play-solid-router/src/types.ts:19](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
14
|
-
| <a id="property-stateid"></a> `stateId` | `readonly` | `string` | XMachines state ID with # prefix **Example** `'#home', '#profile'` | [packages/play-solid-router/src/types.ts:13](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
13
|
+
| <a id="property-path"></a> `path` | `readonly` | `string` | SolidJS Router path pattern **Example** `'/', '/profile/:userId', '/settings/:section?'` | [packages/play-solid-router/src/types.ts:19](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.18/packages/play-solid-router/src/types.ts#L19) |
|
|
14
|
+
| <a id="property-stateid"></a> `stateId` | `readonly` | `string` | XMachines state ID with # prefix **Example** `'#home', '#profile'` | [packages/play-solid-router/src/types.ts:13](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.18/packages/play-solid-router/src/types.ts#L13) |
|
|
@@ -6,4 +6,6 @@
|
|
|
6
6
|
type RoutableActor = AbstractActor<AnyActorLogic> & Routable & Viewable;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-solid-router/src/play-router-provider.tsx:
|
|
9
|
+
Defined in: [packages/play-solid-router/src/play-router-provider.tsx:8](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.18/packages/play-solid-router/src/play-router-provider.tsx#L8)
|
|
10
|
+
|
|
11
|
+
Minimum actor shape accepted by PlayRouterProvider.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
type SolidRouterHooks = object;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-solid-router/src/play-router-provider.tsx:
|
|
9
|
+
Defined in: [packages/play-solid-router/src/play-router-provider.tsx:10](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.18/packages/play-solid-router/src/play-router-provider.tsx#L10)
|
|
10
10
|
|
|
11
11
|
## Properties
|
|
12
12
|
|
|
@@ -16,7 +16,7 @@ Defined in: [packages/play-solid-router/src/play-router-provider.tsx:8](https://
|
|
|
16
16
|
location: object;
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
Defined in: [packages/play-solid-router/src/play-router-provider.tsx:
|
|
19
|
+
Defined in: [packages/play-solid-router/src/play-router-provider.tsx:12](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.18/packages/play-solid-router/src/play-router-provider.tsx#L12)
|
|
20
20
|
|
|
21
21
|
#### pathname
|
|
22
22
|
|
|
@@ -38,7 +38,7 @@ search: string;
|
|
|
38
38
|
navigate: ((path) => void) | ((path, ...args) => unknown);
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
Defined in: [packages/play-solid-router/src/play-router-provider.tsx:
|
|
41
|
+
Defined in: [packages/play-solid-router/src/play-router-provider.tsx:11](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.18/packages/play-solid-router/src/play-router-provider.tsx#L11)
|
|
42
42
|
|
|
43
43
|
---
|
|
44
44
|
|
|
@@ -48,4 +48,4 @@ Defined in: [packages/play-solid-router/src/play-router-provider.tsx:9](https://
|
|
|
48
48
|
params: Record<string, string | undefined>;
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
Defined in: [packages/play-solid-router/src/play-router-provider.tsx:
|
|
51
|
+
Defined in: [packages/play-solid-router/src/play-router-provider.tsx:13](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.18/packages/play-solid-router/src/play-router-provider.tsx#L13)
|
|
@@ -79,7 +79,7 @@ import { PlayRenderer } from "@xmachines/play-react";
|
|
|
79
79
|
router={router}
|
|
80
80
|
routeMap={routeMap}
|
|
81
81
|
renderer={(currentActor, currentRouter) => (
|
|
82
|
-
<PlayRenderer actor={currentActor}
|
|
82
|
+
<PlayRenderer actor={currentActor} registry={registry} actions={{ login: "auth.login" }} />
|
|
83
83
|
)}
|
|
84
84
|
/>;
|
|
85
85
|
```
|
|
@@ -173,10 +173,6 @@ Bridge-first flow:
|
|
|
173
173
|
|
|
174
174
|
This keeps routing infrastructure passive while preserving business-logic control.
|
|
175
175
|
|
|
176
|
-
## Historical Note
|
|
177
|
-
|
|
178
|
-
`SignalSyncedHistory` and `createPlayRouter` are legacy migration-era APIs and are not part of the current quick-start path. Use `TanStackReactRouterBridge` + `RouteMap` for new integrations.
|
|
179
|
-
|
|
180
176
|
## Related Packages
|
|
181
177
|
|
|
182
178
|
- [@xmachines/play-router](../play-router/README.md)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Class: RouteMap
|
|
4
4
|
|
|
5
|
-
Defined in: [play-tanstack-react-router/src/route-map.ts:54](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
5
|
+
Defined in: [play-tanstack-react-router/src/route-map.ts:54](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.18/packages/play-tanstack-react-router/src/route-map.ts#L54)
|
|
6
6
|
|
|
7
7
|
Bidirectional route mapper for TanStack React Router.
|
|
8
8
|
|
|
@@ -40,12 +40,12 @@ routeMap.getPathByStateId("home"); // "/"
|
|
|
40
40
|
new RouteMap(mappings): RouteMap;
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
Defined in: play-router/dist/base-route-map.d.ts:
|
|
43
|
+
Defined in: play-router/dist/base-route-map.d.ts:82
|
|
44
44
|
|
|
45
45
|
Build a route map from an array of state ID ↔ path mappings.
|
|
46
46
|
|
|
47
47
|
Static paths (no `:param`) are indexed in an O(1) `Map`.
|
|
48
|
-
Parameterized paths are compiled to `
|
|
48
|
+
Parameterized paths are compiled to `URLPattern` and grouped into first-segment
|
|
49
49
|
buckets for efficient candidate selection.
|
|
50
50
|
|
|
51
51
|
#### Parameters
|
|
@@ -70,7 +70,7 @@ buckets for efficient candidate selection.
|
|
|
70
70
|
getPathByStateId(stateId): string | null;
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
-
Defined in: play-router/dist/base-route-map.d.ts:
|
|
73
|
+
Defined in: play-router/dist/base-route-map.d.ts:112
|
|
74
74
|
|
|
75
75
|
Look up the path pattern registered for a state ID.
|
|
76
76
|
|
|
@@ -105,7 +105,7 @@ map.getPathByStateId("missing"); // null
|
|
|
105
105
|
getStateIdByPath(path): string | null;
|
|
106
106
|
```
|
|
107
107
|
|
|
108
|
-
Defined in: play-router/dist/base-route-map.d.ts:
|
|
108
|
+
Defined in: play-router/dist/base-route-map.d.ts:99
|
|
109
109
|
|
|
110
110
|
Resolve a URL path to its mapped state ID.
|
|
111
111
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Class: TanStackReactRouterBridge
|
|
4
4
|
|
|
5
|
-
Defined in: [play-tanstack-react-router/src/tanstack-router-bridge.ts:
|
|
5
|
+
Defined in: [play-tanstack-react-router/src/tanstack-router-bridge.ts:80](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.18/packages/play-tanstack-react-router/src/tanstack-router-bridge.ts#L80)
|
|
6
6
|
|
|
7
7
|
TanStack React Router adapter implementing RouterBridge protocol via RouterBridgeBase
|
|
8
8
|
|
|
@@ -47,17 +47,17 @@ new TanStackReactRouterBridge(
|
|
|
47
47
|
routeMap): TanStackReactRouterBridge;
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
Defined in: [play-tanstack-react-router/src/tanstack-router-bridge.ts:
|
|
50
|
+
Defined in: [play-tanstack-react-router/src/tanstack-router-bridge.ts:90](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.18/packages/play-tanstack-react-router/src/tanstack-router-bridge.ts#L90)
|
|
51
51
|
|
|
52
52
|
Create TanStack React Router bridge
|
|
53
53
|
|
|
54
54
|
#### Parameters
|
|
55
55
|
|
|
56
|
-
| Parameter | Type
|
|
57
|
-
| ---------- |
|
|
58
|
-
| `router` | [`TanStackRouterLike`](../type-aliases/TanStackRouterLike.md)
|
|
59
|
-
| `actor` | [`AbstractActor`](../../play-actor/classes/AbstractActor.md)\<[`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic)\> & [`Routable`](../../play-actor/interfaces/Routable.md) | XMachines actor instance |
|
|
60
|
-
| `routeMap` | [`RouteMap`](RouteMap.md)
|
|
56
|
+
| Parameter | Type | Description |
|
|
57
|
+
| ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------- |
|
|
58
|
+
| `router` | [`TanStackRouterLike`](../type-aliases/TanStackRouterLike.md) | TanStack React Router instance |
|
|
59
|
+
| `actor` | [`AbstractActor`](../../play-actor/classes/AbstractActor.md)\<[`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic), [`EventObject`](https://www.jsdocs.io/package/xstate#EventObject)\> & [`Routable`](../../play-actor/interfaces/Routable.md) | XMachines actor instance |
|
|
60
|
+
| `routeMap` | [`RouteMap`](RouteMap.md) | Bidirectional mapping between state IDs and paths |
|
|
61
61
|
|
|
62
62
|
#### Returns
|
|
63
63
|
|
|
@@ -69,17 +69,17 @@ Create TanStack React Router bridge
|
|
|
69
69
|
|
|
70
70
|
## Properties
|
|
71
71
|
|
|
72
|
-
| Property | Modifier | Type
|
|
73
|
-
| --------------------------------------------------------------------- | ----------- |
|
|
74
|
-
| <a id="property-actor"></a> `actor` | `readonly` | [`AbstractActor`](../../play-actor/classes/AbstractActor.md)\<[`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic)\> & [`Routable`](../../play-actor/interfaces/Routable.md) |
|
|
75
|
-
| <a id="property-hasconnectedonce"></a> `hasConnectedOnce` | `protected` | `boolean`
|
|
76
|
-
| <a id="property-isconnected"></a> `isConnected` | `protected` | `boolean`
|
|
77
|
-
| <a id="property-isprocessingnavigation"></a> `isProcessingNavigation` | `protected` | `boolean`
|
|
78
|
-
| <a id="property-lastsyncedpath"></a> `lastSyncedPath` | `protected` | `string`
|
|
79
|
-
| <a id="property-routemap"></a> `routeMap` | `readonly` | `object`
|
|
80
|
-
| `routeMap.getPathByStateId` | `public` | `string` \| `null` \| `undefined`
|
|
81
|
-
| `routeMap.getStateIdByPath` | `public` | `string` \| `null` \| `undefined`
|
|
82
|
-
| <a id="property-routewatcher"></a> `routeWatcher` | `protected` | \| [`
|
|
72
|
+
| Property | Modifier | Type | Description | Inherited from | Defined in |
|
|
73
|
+
| --------------------------------------------------------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------- |
|
|
74
|
+
| <a id="property-actor"></a> `actor` | `readonly` | [`AbstractActor`](../../play-actor/classes/AbstractActor.md)\<[`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic), [`EventObject`](https://www.jsdocs.io/package/xstate#EventObject)\> & [`Routable`](../../play-actor/interfaces/Routable.md) | A `Routable` actor exposing `currentRoute` and `send`. | [`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`actor`](../../play-router/classes/RouterBridgeBase.md#property-actor) | play-router/dist/router-bridge-base.d.ts:73 |
|
|
75
|
+
| <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:79 |
|
|
76
|
+
| <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:78 |
|
|
77
|
+
| <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:81 |
|
|
78
|
+
| <a id="property-lastsyncedpath"></a> `lastSyncedPath` | `protected` | `string` \| `null` | - | [`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`lastSyncedPath`](../../play-router/classes/RouterBridgeBase.md#property-lastsyncedpath) | play-router/dist/router-bridge-base.d.ts:80 |
|
|
79
|
+
| <a id="property-routemap"></a> `routeMap` | `readonly` | `object` | Bidirectional route map for `stateId ↔ path` resolution. Provide `getStateIdByPath` and `getPathByStateId`. Framework adapters typically wrap the result of `createRouteMap()` or an equivalent. | [`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`routeMap`](../../play-router/classes/RouterBridgeBase.md#property-routemap) | play-router/dist/router-bridge-base.d.ts:74 |
|
|
80
|
+
| `routeMap.getPathByStateId` | `public` | `string` \| `null` \| `undefined` | - | - | play-router/dist/router-bridge-base.d.ts:76 |
|
|
81
|
+
| `routeMap.getStateIdByPath` | `public` | `string` \| `null` \| `undefined` | - | - | play-router/dist/router-bridge-base.d.ts:75 |
|
|
82
|
+
| <a id="property-routewatcher"></a> `routeWatcher` | `protected` | \| [`RouteWatcherHandle`](../../play-router/interfaces/RouteWatcherHandle.md) \| `null` | - | [`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`routeWatcher`](../../play-router/classes/RouterBridgeBase.md#property-routewatcher) | play-router/dist/router-bridge-base.d.ts:82 |
|
|
83
83
|
|
|
84
84
|
## Methods
|
|
85
85
|
|
|
@@ -89,7 +89,7 @@ Create TanStack React Router bridge
|
|
|
89
89
|
connect(): void;
|
|
90
90
|
```
|
|
91
91
|
|
|
92
|
-
Defined in: play-router/dist/router-bridge-base.d.ts:
|
|
92
|
+
Defined in: play-router/dist/router-bridge-base.d.ts:99
|
|
93
93
|
|
|
94
94
|
Connect the router bridge to the Actor.
|
|
95
95
|
|
|
@@ -112,7 +112,7 @@ starts watching router changes (framework-specific).
|
|
|
112
112
|
disconnect(): void;
|
|
113
113
|
```
|
|
114
114
|
|
|
115
|
-
Defined in: play-router/dist/router-bridge-base.d.ts:
|
|
115
|
+
Defined in: play-router/dist/router-bridge-base.d.ts:105
|
|
116
116
|
|
|
117
117
|
Disconnect the router bridge from the Actor.
|
|
118
118
|
|
|
@@ -134,7 +134,7 @@ Stops signal watching and unregisters framework-specific router listener.
|
|
|
134
134
|
protected extractParams(pathname, stateId): Record<string, string>;
|
|
135
135
|
```
|
|
136
136
|
|
|
137
|
-
Defined in: play-router/dist/router-bridge-base.d.ts:
|
|
137
|
+
Defined in: play-router/dist/router-bridge-base.d.ts:132
|
|
138
138
|
|
|
139
139
|
Extract path parameters from URL using the URLPattern API.
|
|
140
140
|
|
|
@@ -145,10 +145,10 @@ works, params will be empty).
|
|
|
145
145
|
|
|
146
146
|
#### Parameters
|
|
147
147
|
|
|
148
|
-
| Parameter | Type | Description
|
|
149
|
-
| ---------- | -------- |
|
|
150
|
-
| `pathname` | `string` | The actual URL path (e.g., '/profile/john')
|
|
151
|
-
| `stateId` | `string` | The matched state ID for looking up route pattern |
|
|
148
|
+
| Parameter | Type | Description |
|
|
149
|
+
| ---------- | -------- | ----------------------------------------------------- |
|
|
150
|
+
| `pathname` | `string` | The actual URL path (e.g., '/profile/john') |
|
|
151
|
+
| `stateId` | `string` | The matched state ID for looking up the route pattern |
|
|
152
152
|
|
|
153
153
|
#### Returns
|
|
154
154
|
|
|
@@ -168,7 +168,7 @@ Extracted path parameters, or empty object if URLPattern is unavailable or no ma
|
|
|
168
168
|
protected extractQuery(search): Record<string, string>;
|
|
169
169
|
```
|
|
170
170
|
|
|
171
|
-
Defined in: play-router/dist/router-bridge-base.d.ts:
|
|
171
|
+
Defined in: play-router/dist/router-bridge-base.d.ts:139
|
|
172
172
|
|
|
173
173
|
Extract query parameters from URL search string.
|
|
174
174
|
|
|
@@ -196,12 +196,24 @@ Extracted query parameters or empty object
|
|
|
196
196
|
protected getInitialRouterPath(): string | null;
|
|
197
197
|
```
|
|
198
198
|
|
|
199
|
-
Defined in: [play-tanstack-react-router/src/tanstack-router-bridge.ts:
|
|
199
|
+
Defined in: [play-tanstack-react-router/src/tanstack-router-bridge.ts:123](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.18/packages/play-tanstack-react-router/src/tanstack-router-bridge.ts#L123)
|
|
200
200
|
|
|
201
201
|
Read the router's current pathname for initial sync.
|
|
202
202
|
|
|
203
203
|
Called once in connect() to handle cold-load / deep-link scenarios where
|
|
204
|
-
the URL differs from the actor's initial state.
|
|
204
|
+
the URL differs from the actor's initial state (e.g. user pastes /dashboard
|
|
205
|
+
while logged out — the actor must be redirected to /login before rendering).
|
|
206
|
+
|
|
207
|
+
Uses `router.history.location.pathname` — reflects `window.location` immediately,
|
|
208
|
+
before the router has been loaded or a `<RouterProvider>` mounted.
|
|
209
|
+
`router.state.location` is only populated after `router.load()` which may not
|
|
210
|
+
have run yet when the bridge first connects in a `useEffect`.
|
|
211
|
+
|
|
212
|
+
The base class `connect()` uses `actor.initialRoute` to distinguish:
|
|
213
|
+
|
|
214
|
+
- **Deep-link:** router URL differs from machine's initial route → router wins.
|
|
215
|
+
- **Restore:** router at machine's initial route, actor at a different restored
|
|
216
|
+
route → actor wins, bridge pushes actor's restored route to the router.
|
|
205
217
|
|
|
206
218
|
#### Returns
|
|
207
219
|
|
|
@@ -219,7 +231,7 @@ the URL differs from the actor's initial state.
|
|
|
219
231
|
protected navigateRouter(path): void;
|
|
220
232
|
```
|
|
221
233
|
|
|
222
|
-
Defined in: [play-tanstack-react-router/src/tanstack-router-bridge.ts:
|
|
234
|
+
Defined in: [play-tanstack-react-router/src/tanstack-router-bridge.ts:102](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.18/packages/play-tanstack-react-router/src/tanstack-router-bridge.ts#L102)
|
|
223
235
|
|
|
224
236
|
Navigate the framework router to the given path.
|
|
225
237
|
|
|
@@ -248,7 +260,7 @@ Must trigger the framework router's navigation (e.g., router.navigate(path)).
|
|
|
248
260
|
protected syncActorFromRouter(pathname, search?): void;
|
|
249
261
|
```
|
|
250
262
|
|
|
251
|
-
Defined in: play-router/dist/router-bridge-base.d.ts:
|
|
263
|
+
Defined in: play-router/dist/router-bridge-base.d.ts:119
|
|
252
264
|
|
|
253
265
|
Sync actor state when router location changes.
|
|
254
266
|
|
|
@@ -278,7 +290,7 @@ Prevents circular updates via isProcessingNavigation flag.
|
|
|
278
290
|
protected syncRouterFromActor(route): void;
|
|
279
291
|
```
|
|
280
292
|
|
|
281
|
-
Defined in: play-router/dist/router-bridge-base.d.ts:
|
|
293
|
+
Defined in: play-router/dist/router-bridge-base.d.ts:112
|
|
282
294
|
|
|
283
295
|
Sync router location when actor route signal changes.
|
|
284
296
|
|
|
@@ -307,7 +319,7 @@ Prevents circular updates via isProcessingNavigation flag.
|
|
|
307
319
|
protected unwatchRouterChanges(): void;
|
|
308
320
|
```
|
|
309
321
|
|
|
310
|
-
Defined in: [play-tanstack-react-router/src/tanstack-router-bridge.ts:
|
|
322
|
+
Defined in: [play-tanstack-react-router/src/tanstack-router-bridge.ts:148](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.18/packages/play-tanstack-react-router/src/tanstack-router-bridge.ts#L148)
|
|
311
323
|
|
|
312
324
|
Stop watching for router location changes.
|
|
313
325
|
|
|
@@ -329,7 +341,7 @@ Called by disconnect(). Should clean up the framework-specific subscription.
|
|
|
329
341
|
protected watchRouterChanges(): void;
|
|
330
342
|
```
|
|
331
343
|
|
|
332
|
-
Defined in: [play-tanstack-react-router/src/tanstack-router-bridge.ts:
|
|
344
|
+
Defined in: [play-tanstack-react-router/src/tanstack-router-bridge.ts:140](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.18/packages/play-tanstack-react-router/src/tanstack-router-bridge.ts#L140)
|
|
333
345
|
|
|
334
346
|
Subscribe to ALL navigation events via router.history.
|
|
335
347
|
|
|
@@ -3,16 +3,22 @@
|
|
|
3
3
|
# Function: PlayRouterProvider()
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
|
-
function PlayRouterProvider(__namedParameters): Element;
|
|
6
|
+
function PlayRouterProvider<TActor>(__namedParameters): Element;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [play-tanstack-react-router/src/play-router-provider.tsx:
|
|
9
|
+
Defined in: [play-tanstack-react-router/src/play-router-provider.tsx:41](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.18/packages/play-tanstack-react-router/src/play-router-provider.tsx#L41)
|
|
10
|
+
|
|
11
|
+
## Type Parameters
|
|
12
|
+
|
|
13
|
+
| Type Parameter |
|
|
14
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
15
|
+
| `TActor` _extends_ [`AbstractActor`](../../play-actor/classes/AbstractActor.md)\<[`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic), [`EventObject`](https://www.jsdocs.io/package/xstate#EventObject)\> & [`Routable`](../../play-actor/interfaces/Routable.md) & [`Viewable`](../../play-actor/interfaces/Viewable.md) |
|
|
10
16
|
|
|
11
17
|
## Parameters
|
|
12
18
|
|
|
13
|
-
| Parameter | Type
|
|
14
|
-
| ------------------- |
|
|
15
|
-
| `__namedParameters` | [`PlayRouterProviderProps`](../interfaces/PlayRouterProviderProps.md) |
|
|
19
|
+
| Parameter | Type |
|
|
20
|
+
| ------------------- | --------------------------------------------------------------------------------- |
|
|
21
|
+
| `__namedParameters` | [`PlayRouterProviderProps`](../interfaces/PlayRouterProviderProps.md)\<`TActor`\> |
|
|
16
22
|
|
|
17
23
|
## Returns
|
|
18
24
|
|
|
@@ -27,8 +27,8 @@ before calling this function:
|
|
|
27
27
|
import "urlpattern-polyfill"; // before importing @xmachines/play-router
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
If `URLPattern` is unavailable,
|
|
31
|
-
|
|
30
|
+
If `URLPattern` is unavailable, a `URLPatternUnavailableError` is thrown.
|
|
31
|
+
Static (exact) routes are unaffected by URLPattern availability.
|
|
32
32
|
|
|
33
33
|
Usage:
|
|
34
34
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function createRouteMapFromTree(routeTree): RouteMap;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [play-tanstack-react-router/src/route-map.ts:73](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [play-tanstack-react-router/src/route-map.ts:73](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.18/packages/play-tanstack-react-router/src/route-map.ts#L73)
|
|
10
10
|
|
|
11
11
|
Create RouteMap from RouteTree
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function extractParams(pathname, pattern): Record<string, string>;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [play-tanstack-react-router/src/extract-params.ts:29](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [play-tanstack-react-router/src/extract-params.ts:29](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.18/packages/play-tanstack-react-router/src/extract-params.ts#L29)
|
|
10
10
|
|
|
11
11
|
Extract route parameters from URL path based on route pattern using URLPattern API
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function extractQueryParams(search): Record<string, string>;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [play-tanstack-react-router/src/extract-params.ts:68](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [play-tanstack-react-router/src/extract-params.ts:68](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.18/packages/play-tanstack-react-router/src/extract-params.ts#L68)
|
|
10
10
|
|
|
11
11
|
Extract query parameters from search string
|
|
12
12
|
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
[Documentation](../../../README.md) / [@xmachines/play-tanstack-react-router](../README.md) / PlayRouterProviderProps
|
|
2
2
|
|
|
3
|
-
# Interface: PlayRouterProviderProps
|
|
3
|
+
# Interface: PlayRouterProviderProps\<TActor\>
|
|
4
4
|
|
|
5
|
-
Defined in: [play-tanstack-react-router/src/play-router-provider.tsx:
|
|
5
|
+
Defined in: [play-tanstack-react-router/src/play-router-provider.tsx:30](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.18/packages/play-tanstack-react-router/src/play-router-provider.tsx#L30)
|
|
6
|
+
|
|
7
|
+
## Type Parameters
|
|
8
|
+
|
|
9
|
+
| Type Parameter | Default type |
|
|
10
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
11
|
+
| `TActor` _extends_ [`AbstractActor`](../../play-actor/classes/AbstractActor.md)\<[`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic)\> & [`Routable`](../../play-actor/interfaces/Routable.md) & [`Viewable`](../../play-actor/interfaces/Viewable.md) | [`AbstractActor`](../../play-actor/classes/AbstractActor.md)\<[`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic)\> & [`Routable`](../../play-actor/interfaces/Routable.md) & [`Viewable`](../../play-actor/interfaces/Viewable.md) |
|
|
6
12
|
|
|
7
13
|
## Properties
|
|
8
14
|
|
|
9
|
-
| Property | Type
|
|
10
|
-
| ----------------------------------------- |
|
|
11
|
-
| <a id="property-actor"></a> `actor` |
|
|
12
|
-
| <a id="property-renderer"></a> `renderer` | (`actor`, `router`) => `ReactNode`
|
|
13
|
-
| <a id="property-routemap"></a> `routeMap` | [`RouteMap`](../classes/RouteMap.md)
|
|
14
|
-
| <a id="property-router"></a> `router` | [`TanStackRouterLike`](../type-aliases/TanStackRouterLike.md)
|
|
15
|
+
| Property | Type | Description | Defined in |
|
|
16
|
+
| ----------------------------------------- | ------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
17
|
+
| <a id="property-actor"></a> `actor` | `TActor` | - | [play-tanstack-react-router/src/play-router-provider.tsx:34](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.18/packages/play-tanstack-react-router/src/play-router-provider.tsx#L34) |
|
|
18
|
+
| <a id="property-renderer"></a> `renderer` | (`actor`, `router`) => `ReactNode` | Renderer callback receives the same concrete actor type that was passed in. | [play-tanstack-react-router/src/play-router-provider.tsx:38](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.18/packages/play-tanstack-react-router/src/play-router-provider.tsx#L38) |
|
|
19
|
+
| <a id="property-routemap"></a> `routeMap` | [`RouteMap`](../classes/RouteMap.md) | - | [play-tanstack-react-router/src/play-router-provider.tsx:36](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.18/packages/play-tanstack-react-router/src/play-router-provider.tsx#L36) |
|
|
20
|
+
| <a id="property-router"></a> `router` | [`TanStackRouterLike`](../type-aliases/TanStackRouterLike.md) | - | [play-tanstack-react-router/src/play-router-provider.tsx:35](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.18/packages/play-tanstack-react-router/src/play-router-provider.tsx#L35) |
|