@xmachines/docs 1.0.0-beta.17 → 1.0.0-beta.19
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 +1 -1
- package/api/@xmachines/play/classes/PlayError.md +4 -4
- package/api/@xmachines/play/type-aliases/PlayEvent.md +3 -3
- package/api/@xmachines/play-actor/README.md +2 -2
- package/api/@xmachines/play-actor/classes/AbstractActor.md +4 -4
- package/api/@xmachines/play-actor/interfaces/PlaySpec.md +2 -2
- package/api/@xmachines/play-actor/interfaces/Routable.md +3 -3
- package/api/@xmachines/play-actor/interfaces/ViewMetadata.md +3 -3
- package/api/@xmachines/play-actor/interfaces/Viewable.md +2 -2
- package/api/@xmachines/play-dom/classes/PlayRenderer.md +4 -4
- package/api/@xmachines/play-dom/functions/connectRenderer.md +1 -1
- package/api/@xmachines/play-dom/functions/renderSpec.md +1 -1
- package/api/@xmachines/play-dom/interfaces/ConnectRendererOptions.md +7 -7
- package/api/@xmachines/play-dom/interfaces/DomRenderContext.md +7 -7
- package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +3 -3
- package/api/@xmachines/play-dom/type-aliases/DomComponentRenderer.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/DomRegistry.md +1 -1
- package/api/@xmachines/play-react/README.md +8 -2
- package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +9 -5
- package/api/@xmachines/play-react/functions/useActor.md +1 -1
- 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 +1 -1
- 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 +6 -6
- package/api/@xmachines/play-react/type-aliases/PlayActor.md +1 -1
- package/api/@xmachines/play-react/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +23 -23
- package/api/@xmachines/play-react-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-react-router/functions/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +1 -1
- package/api/@xmachines/play-react-router/interfaces/PlayRouteEvent.md +9 -9
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +5 -5
- package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-react-router/interfaces/RouterBridge.md +4 -4
- package/api/@xmachines/play-router/README.md +103 -47
- package/api/@xmachines/play-router/classes/BaseRouteMap.md +4 -4
- package/api/@xmachines/play-router/classes/RouterBridgeBase.md +21 -21
- 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/createBrowserHistory.md +1 -1
- package/api/@xmachines/play-router/functions/createRouteMap.md +1 -1
- 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 +6 -42
- 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/getTransitionReachableRoutes.md +38 -0
- package/api/@xmachines/play-router/functions/isRouteReachable.md +38 -0
- package/api/@xmachines/play-router/functions/machineToGraph.md +19 -0
- package/api/@xmachines/play-router/functions/routeExists.md +1 -1
- package/api/@xmachines/play-router/functions/sanitizePathname.md +40 -0
- package/api/@xmachines/play-router/functions/validateRouteFormat.md +9 -8
- package/api/@xmachines/play-router/functions/validateStateExists.md +8 -8
- package/api/@xmachines/play-router/interfaces/BaseRouteMapping.md +3 -3
- package/api/@xmachines/play-router/interfaces/BrowserHistory.md +14 -14
- package/api/@xmachines/play-router/interfaces/BrowserWindow.md +14 -14
- package/api/@xmachines/play-router/interfaces/ConnectRouterOptions.md +4 -4
- package/api/@xmachines/play-router/interfaces/MachineEdgeData.md +15 -0
- package/api/@xmachines/play-router/interfaces/MachineNodeData.md +17 -0
- package/api/@xmachines/play-router/interfaces/PlayRouteEvent.md +7 -7
- 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 +12 -12
- package/api/@xmachines/play-router/interfaces/RouteObject.md +2 -2
- package/api/@xmachines/play-router/interfaces/RouteTree.md +7 -6
- package/api/@xmachines/play-router/interfaces/RouteWatcherHandle.md +3 -3
- package/api/@xmachines/play-router/interfaces/RouterBridge.md +4 -4
- package/api/@xmachines/play-router/interfaces/VanillaRouter.md +4 -4
- package/api/@xmachines/play-router/type-aliases/MachineGraph.md +20 -0
- package/api/@xmachines/play-router/type-aliases/RouteMetadata.md +1 -1
- package/api/@xmachines/play-signals/README.md +8 -2
- package/api/@xmachines/play-signals/functions/watchSignal.md +8 -1
- 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 +1 -1
- package/api/@xmachines/play-solid/functions/useActor.md +1 -1
- package/api/@xmachines/play-solid/interfaces/PlayRendererProps.md +6 -6
- package/api/@xmachines/play-solid/type-aliases/PlayActor.md +1 -1
- package/api/@xmachines/play-solid/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-solid-router/README.md +55 -31
- package/api/@xmachines/play-solid-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +24 -24
- package/api/@xmachines/play-solid-router/functions/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-solid-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-solid-router/interfaces/AbstractActor.md +16 -16
- package/api/@xmachines/play-solid-router/interfaces/PlayRouteEvent.md +9 -9
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +5 -5
- package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-solid-router/interfaces/RouterBridge.md +4 -4
- package/api/@xmachines/play-solid-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +4 -4
- package/api/@xmachines/play-tanstack-react-router/README.md +1 -4
- package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +23 -23
- package/api/@xmachines/play-tanstack-react-router/functions/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMapFromTree.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/functions/extractMachineRoutes.md +28 -0
- 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/PlayRouteEvent.md +9 -9
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +5 -5
- 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/interfaces/RouterBridge.md +4 -4
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterInstance.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterLike.md +4 -4
- package/api/@xmachines/play-tanstack-solid-router/README.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-tanstack-solid-router/classes/SolidRouterBridge.md +26 -25
- package/api/@xmachines/play-tanstack-solid-router/functions/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouteEvent.md +9 -9
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +5 -5
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouterBridge.md +4 -4
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/RoutableActor.md +1 -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 +4 -1
- package/api/@xmachines/play-vue/functions/defineRegistry.md +5 -5
- package/api/@xmachines/play-vue/functions/useActor.md +1 -1
- package/api/@xmachines/play-vue/interfaces/PlayRendererProps.md +5 -5
- package/api/@xmachines/play-vue/type-aliases/ComponentEntry.md +16 -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 +1 -1
- package/api/@xmachines/play-vue/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-vue-router/README.md +55 -30
- 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 +27 -32
- package/api/@xmachines/play-vue-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-vue-router/interfaces/PlayRouteEvent.md +9 -9
- package/api/@xmachines/play-vue-router/interfaces/RouteMapping.md +4 -4
- package/api/@xmachines/play-vue-router/interfaces/RouterBridge.md +4 -4
- package/api/@xmachines/play-vue-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-vue-router/variables/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-xstate/README.md +6 -6
- package/api/@xmachines/play-xstate/classes/PlayerActor.md +12 -12
- package/api/@xmachines/play-xstate/functions/buildRouteUrl.md +1 -1
- 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/contextFieldMatches.md +36 -0
- package/api/@xmachines/play-xstate/functions/definePlayer.md +2 -2
- package/api/@xmachines/play-xstate/functions/deriveRoute.md +2 -2
- 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/interfaces/PlayerConfig.md +3 -3
- package/api/@xmachines/play-xstate/interfaces/PlayerFactoryResumeOptions.md +2 -2
- package/api/@xmachines/play-xstate/interfaces/PlayerOptions.md +6 -6
- 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 +4 -4
- package/api/@xmachines/play-xstate/type-aliases/RouteStateNode.md +4 -4
- package/api/@xmachines/shared/functions/defineXmVitestConfig.md +2 -2
- package/api/@xmachines/shared/functions/xmAliases.md +1 -1
- package/api/README.md +1 -1
- package/api/_media/play.md +447 -0
- package/api/llms.txt +1 -1
- package/examples/multi-router-integration.md +1 -1
- package/examples/routing-patterns.md +1 -1
- package/guides/README.md +2 -1
- package/guides/installation.md +30 -35
- package/package.json +2 -2
- package/api/@xmachines/play-router/functions/crawlMachine.md +0 -92
- package/api/@xmachines/play-router/functions/extractRoute.md +0 -45
- package/api/@xmachines/play-router/interfaces/StateVisit.md +0 -15
- package/api/@xmachines/play-tanstack-react-router/variables/extractMachineRoutes.md +0 -64
- package/api/@xmachines/play-xstate/functions/stateMatches.md +0 -25
|
@@ -10,7 +10,7 @@ Transform declarative state machines into live actors with TC39 Signals and para
|
|
|
10
10
|
|
|
11
11
|
`@xmachines/play-xstate` provides `definePlayer()`, the primary API for binding XState v5 state machines to the Play Architecture actor base. It enables business logic to control routing and state through guard-enforced transitions, signal lifecycle management, and XState DevTools compatibility.
|
|
12
12
|
|
|
13
|
-
Per [
|
|
13
|
+
Per [Play RFC](../../_media/play.md), this package implements:
|
|
14
14
|
|
|
15
15
|
- **Actor Authority (INV-01):** State machine guards decide navigation validity
|
|
16
16
|
- **Strict Separation (INV-02):** Zero React/framework imports in business logic
|
|
@@ -223,7 +223,7 @@ import {
|
|
|
223
223
|
negateGuard,
|
|
224
224
|
hasContext,
|
|
225
225
|
eventMatches,
|
|
226
|
-
|
|
226
|
+
contextFieldMatches,
|
|
227
227
|
} from "@xmachines/play-xstate";
|
|
228
228
|
|
|
229
229
|
const machine = setup({
|
|
@@ -256,7 +256,7 @@ const machine = setup({
|
|
|
256
256
|
|
|
257
257
|
- `hasContext(path: string)` - Check if context property is truthy
|
|
258
258
|
- `eventMatches(type: string)` - Check event type
|
|
259
|
-
- `
|
|
259
|
+
- `contextFieldMatches(fieldPath: string, expectedValue: unknown)` - Check context field with proper equality (no substring false-matches; use this instead of the removed `stateMatches`)
|
|
260
260
|
- `composeGuards(guards: Array)` - AND composition
|
|
261
261
|
- `composeGuardsOr(guards: Array)` - OR composition
|
|
262
262
|
- `negateGuard(guard)` - NOT composition
|
|
@@ -575,7 +575,7 @@ If both a route param and a `contextProps` field share the same key, the route p
|
|
|
575
575
|
|
|
576
576
|
## Architecture
|
|
577
577
|
|
|
578
|
-
This package implements
|
|
578
|
+
This package implements Play RFC requirements:
|
|
579
579
|
|
|
580
580
|
**Architectural Invariants:**
|
|
581
581
|
|
|
@@ -616,7 +616,7 @@ For a copy, see <https://opensource.org/licenses/MIT>.
|
|
|
616
616
|
Provides definePlayer() API for binding XState state machines to the
|
|
617
617
|
actor base with signal lifecycle and DevTools integration.
|
|
618
618
|
|
|
619
|
-
Per
|
|
619
|
+
Per the Play RFC, this package implements the Logic Layer adapter that
|
|
620
620
|
transforms declarative machine definitions into live actors with signal-driven
|
|
621
621
|
reactivity.
|
|
622
622
|
|
|
@@ -645,6 +645,7 @@ reactivity.
|
|
|
645
645
|
- [buildRouteUrl](functions/buildRouteUrl.md)
|
|
646
646
|
- [composeGuards](functions/composeGuards.md)
|
|
647
647
|
- [composeGuardsOr](functions/composeGuardsOr.md)
|
|
648
|
+
- [contextFieldMatches](functions/contextFieldMatches.md)
|
|
648
649
|
- [definePlayer](functions/definePlayer.md)
|
|
649
650
|
- [deriveRoute](functions/deriveRoute.md)
|
|
650
651
|
- [eventMatches](functions/eventMatches.md)
|
|
@@ -652,4 +653,3 @@ reactivity.
|
|
|
652
653
|
- [hasContext](functions/hasContext.md)
|
|
653
654
|
- [isAbsoluteRoute](functions/isAbsoluteRoute.md)
|
|
654
655
|
- [negateGuard](functions/negateGuard.md)
|
|
655
|
-
- [stateMatches](functions/stateMatches.md)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Class: PlayerActor\<TMachine\>
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:332](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
5
|
+
Defined in: [packages/play-xstate/src/player-actor.ts:332](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/player-actor.ts#L332)
|
|
6
6
|
|
|
7
7
|
Concrete XState actor implementing Play Architecture signal protocol
|
|
8
8
|
|
|
@@ -65,7 +65,7 @@ actor.send({ type: "play.route", to: "#about" });
|
|
|
65
65
|
|
|
66
66
|
## See
|
|
67
67
|
|
|
68
|
-
- [
|
|
68
|
+
- [Play RFC](../../../_media/play.md)
|
|
69
69
|
- [definePlayer](../functions/definePlayer.md) for factory creation
|
|
70
70
|
- [@xmachines/play-actor!AbstractActor](../../play-actor/classes/AbstractActor.md) for signal protocol
|
|
71
71
|
- [@xmachines/play-actor!Routable](../../play-actor/interfaces/Routable.md) for routing capability
|
|
@@ -108,7 +108,7 @@ new PlayerActor<TMachine>(
|
|
|
108
108
|
snapshot?): PlayerActor<TMachine>;
|
|
109
109
|
```
|
|
110
110
|
|
|
111
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:400](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
111
|
+
Defined in: [packages/play-xstate/src/player-actor.ts:400](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/player-actor.ts#L400)
|
|
112
112
|
|
|
113
113
|
#### Parameters
|
|
114
114
|
|
|
@@ -133,16 +133,16 @@ Defined in: [packages/play-xstate/src/player-actor.ts:400](https://gitlab.com/xm
|
|
|
133
133
|
| ------------------------------------------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
134
134
|
| <a id="property-_parent"></a> `_parent?` | `public` | [`AnyActorRef`](https://www.jsdocs.io/package/xstate#AnyActorRef) | - | - | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`_parent`](../../play-actor/classes/AbstractActor.md#property-_parent) | - |
|
|
135
135
|
| <a id="property-clock"></a> `clock` | `public` | [`Clock`](https://www.jsdocs.io/package/xstate#Clock) | The clock that is responsible for setting and clearing timeouts, such as delayed events and transitions. | - | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`clock`](../../play-actor/classes/AbstractActor.md#property-clock) | - |
|
|
136
|
-
| <a id="property-currentroute"></a> `currentRoute` | `public` | [`Computed`](../../play-signals/namespaces/Signal/classes/Computed.md)\<`string` \| `null`\> | A TC39 `Signal.Computed` that derives the current URL path from the active machine state's `meta.route` template and the actor's context. Returns `null` when the current state has no `meta.route`, or when the route template cannot be fully resolved (e.g. a required parameter is absent from context). **Throws** When a required `:param` placeholder in the route template has no matching value in the actor's context. Import the class from `@xmachines/play-xstate/errors`. **Example** `// Returns "/profile/alice" when context.userId === "alice" const route = actor.currentRoute.get();` | - | - | [packages/play-xstate/src/player-actor.ts:362](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
137
|
-
| <a id="property-currentview"></a> `currentView` | `public` | [`State`](../../play-signals/namespaces/Signal/classes/State.md)\<[`ViewMetadata`](../../play-actor/interfaces/ViewMetadata.md) \| `null`\> | Reactive signal containing the current view spec derived from the active state's `meta.view` metadata. Always emits a **fresh object reference** on every state transition (including self-transitions with `reenter: true`) so TC39 Signal equality checks reliably detect changes. The emitted `ViewMetadata` has its spec element `props` enriched with `context.routeParams` before emission — URL path parameters (e.g. `:section?`) flow into component props automatically. See `mergeRouteParamsIntoProps` for the merge priority rules. Returns `null` when the current state has no `meta.view` metadata. **Example** `const view = actor.currentView.get(); if (view) { console.log(view.component); // e.g. "Dashboard" console.log(view.spec); // @json-render/core Spec object }` | - | - | [packages/play-xstate/src/player-actor.ts:398](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
136
|
+
| <a id="property-currentroute"></a> `currentRoute` | `public` | [`Computed`](../../play-signals/namespaces/Signal/classes/Computed.md)\<`string` \| `null`\> | A TC39 `Signal.Computed` that derives the current URL path from the active machine state's `meta.route` template and the actor's context. Returns `null` when the current state has no `meta.route`, or when the route template cannot be fully resolved (e.g. a required parameter is absent from context). **Throws** When a required `:param` placeholder in the route template has no matching value in the actor's context. Import the class from `@xmachines/play-xstate/errors`. **Example** `// Returns "/profile/alice" when context.userId === "alice" const route = actor.currentRoute.get();` | - | - | [packages/play-xstate/src/player-actor.ts:362](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/player-actor.ts#L362) |
|
|
137
|
+
| <a id="property-currentview"></a> `currentView` | `public` | [`State`](../../play-signals/namespaces/Signal/classes/State.md)\<[`ViewMetadata`](../../play-actor/interfaces/ViewMetadata.md) \| `null`\> | Reactive signal containing the current view spec derived from the active state's `meta.view` metadata. Always emits a **fresh object reference** on every state transition (including self-transitions with `reenter: true`) so TC39 Signal equality checks reliably detect changes. The emitted `ViewMetadata` has its spec element `props` enriched with `context.routeParams` before emission — URL path parameters (e.g. `:section?`) flow into component props automatically. See `mergeRouteParamsIntoProps` for the merge priority rules. Returns `null` when the current state has no `meta.view` metadata. **Example** `const view = actor.currentView.get(); if (view) { console.log(view.component); // e.g. "Dashboard" console.log(view.spec); // @json-render/core Spec object }` | - | - | [packages/play-xstate/src/player-actor.ts:398](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/player-actor.ts#L398) |
|
|
138
138
|
| <a id="property-id"></a> `id` | `public` | `string` | The unique identifier for this actor relative to its parent. | - | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`id`](../../play-actor/classes/AbstractActor.md#property-id) | - |
|
|
139
|
-
| <a id="property-initialroute"></a> `initialRoute` | `readonly` | `string` \| `null` | The route derived from the machine's initial state — fixed at construction, never changes even when the actor is restored from a snapshot. Router bridges compare this against the browser URL to distinguish a deep-link (non-initial URL → router wins) from a restore (initial URL + actor at a different restored route → actor wins). | - | - | [packages/play-xstate/src/player-actor.ts:372](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
139
|
+
| <a id="property-initialroute"></a> `initialRoute` | `readonly` | `string` \| `null` | The route derived from the machine's initial state — fixed at construction, never changes even when the actor is restored from a snapshot. Router bridges compare this against the browser URL to distinguish a deep-link (non-initial URL → router wins) from a restore (initial URL + actor at a different restored route → actor wins). | - | - | [packages/play-xstate/src/player-actor.ts:372](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/player-actor.ts#L372) |
|
|
140
140
|
| <a id="property-logic"></a> `logic` | `public` | [`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic) | - | - | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`logic`](../../play-actor/classes/AbstractActor.md#property-logic) | - |
|
|
141
141
|
| <a id="property-options"></a> `options` | `public` | `Readonly`\<[`ActorOptions`](https://www.jsdocs.io/package/xstate#ActorOptions)\<`TLogic`\>\> | - | - | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`options`](../../play-actor/classes/AbstractActor.md#property-options) | - |
|
|
142
142
|
| <a id="property-ref"></a> `ref` | `public` | [`ActorRef`](https://www.jsdocs.io/package/xstate#ActorRef)\<`any`, `any`, `any`\> | - | - | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`ref`](../../play-actor/classes/AbstractActor.md#property-ref) | - |
|
|
143
143
|
| <a id="property-sessionid"></a> `sessionId` | `public` | `string` | The globally unique process ID for this invocation. | - | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`sessionId`](../../play-actor/classes/AbstractActor.md#property-sessionid) | - |
|
|
144
144
|
| <a id="property-src"></a> `src` | `public` | \| `string` \| [`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic) | - | - | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`src`](../../play-actor/classes/AbstractActor.md#property-src) | - |
|
|
145
|
-
| <a id="property-state"></a> `state` | `public` | [`State`](../../play-signals/namespaces/Signal/classes/State.md)\<[`AnyMachineSnapshot`](https://www.jsdocs.io/package/xstate#AnyMachineSnapshot)\> | 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);` | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`state`](../../play-actor/classes/AbstractActor.md#property-state) | - | [packages/play-xstate/src/player-actor.ts:342](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
145
|
+
| <a id="property-state"></a> `state` | `public` | [`State`](../../play-signals/namespaces/Signal/classes/State.md)\<[`AnyMachineSnapshot`](https://www.jsdocs.io/package/xstate#AnyMachineSnapshot)\> | 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);` | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`state`](../../play-actor/classes/AbstractActor.md#property-state) | - | [packages/play-xstate/src/player-actor.ts:342](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/player-actor.ts#L342) |
|
|
146
146
|
| <a id="property-system"></a> `system` | `public` | [`AnyActorSystem`](https://www.jsdocs.io/package/xstate#AnyActorSystem) | The system to which this actor belongs. | - | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`system`](../../play-actor/classes/AbstractActor.md#property-system) | - |
|
|
147
147
|
| <a id="property-systemid"></a> `systemId` | `public` | `string` \| `undefined` | - | - | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`systemId`](../../play-actor/classes/AbstractActor.md#property-systemid) | - |
|
|
148
148
|
|
|
@@ -170,7 +170,7 @@ observable: InteropSubscribable<any>;
|
|
|
170
170
|
dispose(): void;
|
|
171
171
|
```
|
|
172
172
|
|
|
173
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:578](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
173
|
+
Defined in: [packages/play-xstate/src/player-actor.ts:578](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/player-actor.ts#L578)
|
|
174
174
|
|
|
175
175
|
Convenience dispose method for cleanup
|
|
176
176
|
|
|
@@ -220,7 +220,7 @@ https://stately.ai/docs/persistence
|
|
|
220
220
|
getSnapshot(): SnapshotFrom<TMachine>;
|
|
221
221
|
```
|
|
222
222
|
|
|
223
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:547](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
223
|
+
Defined in: [packages/play-xstate/src/player-actor.ts:547](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/player-actor.ts#L547)
|
|
224
224
|
|
|
225
225
|
Get current snapshot
|
|
226
226
|
|
|
@@ -298,7 +298,7 @@ select<TSelected>(selector, equalityFn?): Readable<TSelected>;
|
|
|
298
298
|
send(event): void;
|
|
299
299
|
```
|
|
300
300
|
|
|
301
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:524](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
301
|
+
Defined in: [packages/play-xstate/src/player-actor.ts:524](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/player-actor.ts#L524)
|
|
302
302
|
|
|
303
303
|
Send an event to the underlying XState actor.
|
|
304
304
|
|
|
@@ -342,7 +342,7 @@ actor.send({ type: "play.route", to: "#home" });
|
|
|
342
342
|
start(): this;
|
|
343
343
|
```
|
|
344
344
|
|
|
345
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:478](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
345
|
+
Defined in: [packages/play-xstate/src/player-actor.ts:478](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/player-actor.ts#L478)
|
|
346
346
|
|
|
347
347
|
Start the actor
|
|
348
348
|
|
|
@@ -364,7 +364,7 @@ Per RESEARCH.md Pitfall 1: Always call start() after creation
|
|
|
364
364
|
stop(): this;
|
|
365
365
|
```
|
|
366
366
|
|
|
367
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:492](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
367
|
+
Defined in: [packages/play-xstate/src/player-actor.ts:492](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/player-actor.ts#L492)
|
|
368
368
|
|
|
369
369
|
Stop the actor and cleanup
|
|
370
370
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function buildRouteUrl(routeTemplate, context?): string;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-xstate/src/routing/build-url.ts:35](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-xstate/src/routing/build-url.ts:35](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/routing/build-url.ts#L35)
|
|
10
10
|
|
|
11
11
|
Build a full URL from a route template and the actor's context.
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function composeGuards<TContext, TEvent>(guards): ComposedGuard;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-xstate/src/guards/compose.ts:77](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-xstate/src/guards/compose.ts:77](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/guards/compose.ts#L77)
|
|
10
10
|
|
|
11
11
|
Compose guards with AND logic using XState's and() helper
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function composeGuardsOr<TContext, TEvent>(guards): ComposedGuard;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-xstate/src/guards/compose.ts:143](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-xstate/src/guards/compose.ts:143](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/guards/compose.ts#L143)
|
|
10
10
|
|
|
11
11
|
Compose guards with OR logic using XState's or() helper
|
|
12
12
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
[Documentation](../../../README.md) / [@xmachines/play-xstate](../README.md) / contextFieldMatches
|
|
2
|
+
|
|
3
|
+
# Function: contextFieldMatches()
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
function contextFieldMatches<TContext>(fieldPath, expectedValue): Guard<TContext, PlayEvent>;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [packages/play-xstate/src/guards/helpers.ts:68](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/guards/helpers.ts#L68)
|
|
10
|
+
|
|
11
|
+
Check if a context field matches an expected value.
|
|
12
|
+
|
|
13
|
+
- Accepts an explicit dot-separated field path (e.g. `"user.role"`)
|
|
14
|
+
- Uses strict equality for primitives, deep structural equality for objects
|
|
15
|
+
- Does NOT use substring matching — `"a"` will not match `"active"`
|
|
16
|
+
|
|
17
|
+
For XState state-node matching, use the built-in `in:` guard syntax instead.
|
|
18
|
+
|
|
19
|
+
## Type Parameters
|
|
20
|
+
|
|
21
|
+
| Type Parameter | Default type |
|
|
22
|
+
| -------------- | ------------------------------- |
|
|
23
|
+
| `TContext` | `Record`\<`string`, `unknown`\> |
|
|
24
|
+
|
|
25
|
+
## Parameters
|
|
26
|
+
|
|
27
|
+
| Parameter | Type | Description |
|
|
28
|
+
| --------------- | --------- | -------------------------------------------------------------------- |
|
|
29
|
+
| `fieldPath` | `string` | Dot-separated path to context property (e.g., "status", "user.role") |
|
|
30
|
+
| `expectedValue` | `unknown` | Value to compare against (string or object) |
|
|
31
|
+
|
|
32
|
+
## Returns
|
|
33
|
+
|
|
34
|
+
[`Guard`](../type-aliases/Guard.md)\<`TContext`, [`PlayEvent`](../../play/type-aliases/PlayEvent.md)\>
|
|
35
|
+
|
|
36
|
+
Guard predicate checking if context field matches
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function definePlayer<TMachine>(config): PlayerFactory<TMachine>;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-xstate/src/define-player.ts:61](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-xstate/src/define-player.ts:61](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/define-player.ts#L61)
|
|
10
10
|
|
|
11
11
|
Create a player factory from an XState machine
|
|
12
12
|
|
|
@@ -72,7 +72,7 @@ console.log(alice.state.get() !== bob.state.get());
|
|
|
72
72
|
|
|
73
73
|
## See
|
|
74
74
|
|
|
75
|
-
- [
|
|
75
|
+
- [Play RFC](../../../_media/play.md)
|
|
76
76
|
- [PlayerActor](../classes/PlayerActor.md) for the concrete actor implementation
|
|
77
77
|
- [PlayerConfig](../interfaces/PlayerConfig.md) for configuration options
|
|
78
78
|
- [PlayerFactory](../type-aliases/PlayerFactory.md) for factory function signature
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function deriveRoute(stateMeta): string | null;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-xstate/src/routing/derive-route.ts:90](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-xstate/src/routing/derive-route.ts:90](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/routing/derive-route.ts#L90)
|
|
10
10
|
|
|
11
11
|
Derive route from XState state metadata
|
|
12
12
|
|
|
@@ -94,7 +94,7 @@ console.log(route); // "/dashboard"
|
|
|
94
94
|
|
|
95
95
|
## See
|
|
96
96
|
|
|
97
|
-
- [
|
|
97
|
+
- [Play RFC](../../../_media/play.md)
|
|
98
98
|
- [buildRouteUrl](buildRouteUrl.md) for URL construction with parameter substitution
|
|
99
99
|
- [isAbsoluteRoute](isAbsoluteRoute.md) for checking path absoluteness
|
|
100
100
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function eventMatches<TEvent>(eventType): Guard<unknown, TEvent>;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-xstate/src/guards/helpers.ts:49](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-xstate/src/guards/helpers.ts:49](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/guards/helpers.ts#L49)
|
|
10
10
|
|
|
11
11
|
Check if event type matches expected type
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function formatPlayRouteTransitions<T>(machineConfig): T;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:88](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:88](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/routing/format-play-route-transitions.ts#L88)
|
|
10
10
|
|
|
11
11
|
Formats play.route transitions from declarative route configs
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function hasContext<TContext>(path): Guard<TContext, PlayEvent>;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-xstate/src/guards/helpers.ts:23](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-xstate/src/guards/helpers.ts:23](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/guards/helpers.ts#L23)
|
|
10
10
|
|
|
11
11
|
Check if context has a truthy value at path
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function isAbsoluteRoute(path): boolean;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-xstate/src/routing/derive-route.ts:150](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-xstate/src/routing/derive-route.ts:150](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/routing/derive-route.ts#L150)
|
|
10
10
|
|
|
11
11
|
Check if route path is absolute
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function negateGuard<TContext, TEvent>(guard): ComposedGuard;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-xstate/src/guards/compose.ts:203](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-xstate/src/guards/compose.ts:203](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/guards/compose.ts#L203)
|
|
10
10
|
|
|
11
11
|
Negate a guard using XState's not() helper
|
|
12
12
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: PlayerConfig\<TMachine\>
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-xstate/src/types.ts:7](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
5
|
+
Defined in: [packages/play-xstate/src/types.ts:7](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/types.ts#L7)
|
|
6
6
|
|
|
7
7
|
Configuration for definePlayer()
|
|
8
8
|
|
|
@@ -16,5 +16,5 @@ Configuration for definePlayer()
|
|
|
16
16
|
|
|
17
17
|
| Property | Type | Description | Defined in |
|
|
18
18
|
| ---------------------------------------- | ------------------------------------------------- | --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
19
|
-
| <a id="property-machine"></a> `machine` | `TMachine` | XState v5 state machine | [packages/play-xstate/src/types.ts:9](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
20
|
-
| <a id="property-options"></a> `options?` | [`PlayerOptions`](PlayerOptions.md)\<`TMachine`\> | Lifecycle hooks and configuration | [packages/play-xstate/src/types.ts:12](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
19
|
+
| <a id="property-machine"></a> `machine` | `TMachine` | XState v5 state machine | [packages/play-xstate/src/types.ts:9](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/types.ts#L9) |
|
|
20
|
+
| <a id="property-options"></a> `options?` | [`PlayerOptions`](PlayerOptions.md)\<`TMachine`\> | Lifecycle hooks and configuration | [packages/play-xstate/src/types.ts:12](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/types.ts#L12) |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: PlayerFactoryResumeOptions\<TMachine\>
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-xstate/src/types.ts:47](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
5
|
+
Defined in: [packages/play-xstate/src/types.ts:47](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/types.ts#L47)
|
|
6
6
|
|
|
7
7
|
Optional restore arguments for the player factory.
|
|
8
8
|
|
|
@@ -19,4 +19,4 @@ Mirrors XState's createActor options bag while preserving the existing
|
|
|
19
19
|
|
|
20
20
|
| Property | Type | Description | Defined in |
|
|
21
21
|
| ------------------------------------------ | --------------------------------------------------------------------------------- | ------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
22
|
-
| <a id="property-snapshot"></a> `snapshot?` | [`SnapshotFrom`](https://www.jsdocs.io/package/xstate#SnapshotFrom)\<`TMachine`\> | Persisted XState snapshot used to restore actor state. | [packages/play-xstate/src/types.ts:49](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
22
|
+
| <a id="property-snapshot"></a> `snapshot?` | [`SnapshotFrom`](https://www.jsdocs.io/package/xstate#SnapshotFrom)\<`TMachine`\> | Persisted XState snapshot used to restore actor state. | [packages/play-xstate/src/types.ts:49](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/types.ts#L49) |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: PlayerOptions\<TMachine\>
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-xstate/src/types.ts:20](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
5
|
+
Defined in: [packages/play-xstate/src/types.ts:20](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/types.ts#L20)
|
|
6
6
|
|
|
7
7
|
Player lifecycle hooks
|
|
8
8
|
|
|
@@ -18,8 +18,8 @@ Per CONTEXT.md: Rich set of hooks for observability
|
|
|
18
18
|
|
|
19
19
|
| Property | Type | Description | Defined in |
|
|
20
20
|
| ---------------------------------------------------- | --------------------------------------------- | -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
21
|
-
| <a id="property-onerror"></a> `onError?` | (`actor`, `error`) => `void` | Called on actor errors | [packages/play-xstate/src/types.ts:38](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
22
|
-
| <a id="property-onstart"></a> `onStart?` | (`actor`) => `void` | Called when actor starts | [packages/play-xstate/src/types.ts:22](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
23
|
-
| <a id="property-onstatechange"></a> `onStateChange?` | (`actor`, `state`) => `void` | Called when state signal changes | [packages/play-xstate/src/types.ts:35](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
24
|
-
| <a id="property-onstop"></a> `onStop?` | (`actor`) => `void` | Called when actor stops | [packages/play-xstate/src/types.ts:25](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
25
|
-
| <a id="property-ontransition"></a> `onTransition?` | (`actor`, `prevState`, `nextState`) => `void` | Called on every state transition | [packages/play-xstate/src/types.ts:28](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
21
|
+
| <a id="property-onerror"></a> `onError?` | (`actor`, `error`) => `void` | Called on actor errors | [packages/play-xstate/src/types.ts:38](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/types.ts#L38) |
|
|
22
|
+
| <a id="property-onstart"></a> `onStart?` | (`actor`) => `void` | Called when actor starts | [packages/play-xstate/src/types.ts:22](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/types.ts#L22) |
|
|
23
|
+
| <a id="property-onstatechange"></a> `onStateChange?` | (`actor`, `state`) => `void` | Called when state signal changes | [packages/play-xstate/src/types.ts:35](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/types.ts#L35) |
|
|
24
|
+
| <a id="property-onstop"></a> `onStop?` | (`actor`) => `void` | Called when actor stops | [packages/play-xstate/src/types.ts:25](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/types.ts#L25) |
|
|
25
|
+
| <a id="property-ontransition"></a> `onTransition?` | (`actor`, `prevState`, `nextState`) => `void` | Called on every state transition | [packages/play-xstate/src/types.ts:28](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/types.ts#L28) |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: RouteContext
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-xstate/src/routing/types.ts:11](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
5
|
+
Defined in: [packages/play-xstate/src/routing/types.ts:11](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/routing/types.ts#L11)
|
|
6
6
|
|
|
7
7
|
Route build context from machine context
|
|
8
8
|
|
|
@@ -16,7 +16,7 @@ Route build context from machine context
|
|
|
16
16
|
|
|
17
17
|
| Property | Type | Description | Defined in |
|
|
18
18
|
| ------------------------------------------------ | ------------------------------- | ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
19
|
-
| <a id="property-basepath"></a> `basePath?` | `string` | Base path for relative routes | [packages/play-xstate/src/routing/types.ts:13](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
20
|
-
| <a id="property-hash"></a> `hash?` | `string` | Hash fragment | [packages/play-xstate/src/routing/types.ts:19](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
21
|
-
| <a id="property-query"></a> `query?` | `Record`\<`string`, `unknown`\> | Query parameters | [packages/play-xstate/src/routing/types.ts:17](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
22
|
-
| <a id="property-routeparams"></a> `routeParams?` | `Record`\<`string`, `unknown`\> | Route parameters to substitute | [packages/play-xstate/src/routing/types.ts:15](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
19
|
+
| <a id="property-basepath"></a> `basePath?` | `string` | Base path for relative routes | [packages/play-xstate/src/routing/types.ts:13](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/routing/types.ts#L13) |
|
|
20
|
+
| <a id="property-hash"></a> `hash?` | `string` | Hash fragment | [packages/play-xstate/src/routing/types.ts:19](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/routing/types.ts#L19) |
|
|
21
|
+
| <a id="property-query"></a> `query?` | `Record`\<`string`, `unknown`\> | Query parameters | [packages/play-xstate/src/routing/types.ts:17](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/routing/types.ts#L17) |
|
|
22
|
+
| <a id="property-routeparams"></a> `routeParams?` | `Record`\<`string`, `unknown`\> | Route parameters to substitute | [packages/play-xstate/src/routing/types.ts:15](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/routing/types.ts#L15) |
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
type ComposedGuard = GuardPredicate<MachineContext, EventObject, unknown, ParameterizedObject>;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-xstate/src/guards/compose.ts:14](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-xstate/src/guards/compose.ts:14](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/guards/compose.ts#L14)
|
|
10
10
|
|
|
11
11
|
Narrowest public return type for guard composition helpers.
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
type Guard<TContext, TEvent> = (args) => boolean;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-xstate/src/guards/types.ts:13](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-xstate/src/guards/types.ts:13](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/guards/types.ts#L13)
|
|
10
10
|
|
|
11
11
|
Standard XState guard function signature
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
type GuardArray<TContext, TEvent> = Guard<TContext, TEvent>[] | string[];
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-xstate/src/guards/types.ts:23](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-xstate/src/guards/types.ts:23](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/guards/types.ts#L23)
|
|
10
10
|
|
|
11
11
|
Array of guard predicates or guard names
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
type PlayerFactory<TMachine> = (input?, options?) => PlayerActor<TMachine>;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-xstate/src/types.ts:57](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-xstate/src/types.ts:57](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/types.ts#L57)
|
|
10
10
|
|
|
11
11
|
Factory function returned by definePlayer()
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
type RouteMachineConfig = object;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:52](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:52](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/routing/format-play-route-transitions.ts#L52)
|
|
10
10
|
|
|
11
11
|
Minimal structural constraint for machine configs accepted by
|
|
12
12
|
`formatPlayRouteTransitions`.
|
|
@@ -32,7 +32,7 @@ through the transform, so the return value remains directly usable by
|
|
|
32
32
|
optional context?: unknown;
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:53](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
35
|
+
Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:53](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/routing/format-play-route-transitions.ts#L53)
|
|
36
36
|
|
|
37
37
|
---
|
|
38
38
|
|
|
@@ -42,7 +42,7 @@ Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:5
|
|
|
42
42
|
optional on?: Record<string, unknown>;
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:55](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
45
|
+
Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:55](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/routing/format-play-route-transitions.ts#L55)
|
|
46
46
|
|
|
47
47
|
---
|
|
48
48
|
|
|
@@ -52,4 +52,4 @@ Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:5
|
|
|
52
52
|
optional states?: Record<string, unknown>;
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:54](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
55
|
+
Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:54](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/routing/format-play-route-transitions.ts#L54)
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
type RouteStateNode = object;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:21](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:21](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/routing/format-play-route-transitions.ts#L21)
|
|
10
10
|
|
|
11
11
|
Minimal structural shape of a single XState state node as read by
|
|
12
12
|
`formatPlayRouteTransitions` when crawling the machine config.
|
|
@@ -29,7 +29,7 @@ the index signature.
|
|
|
29
29
|
optional id?: string;
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:23](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
32
|
+
Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:23](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/routing/format-play-route-transitions.ts#L23)
|
|
33
33
|
|
|
34
34
|
Optional explicit state ID (e.g. `"home"`, `"settings"`). Used as the `#id` target in `play.route` events.
|
|
35
35
|
|
|
@@ -41,7 +41,7 @@ Optional explicit state ID (e.g. `"home"`, `"settings"`). Used as the `#id` targ
|
|
|
41
41
|
optional meta?: object;
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:25](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
44
|
+
Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:25](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/routing/format-play-route-transitions.ts#L25)
|
|
45
45
|
|
|
46
46
|
State metadata — `meta.route` marks the state as routable.
|
|
47
47
|
|
|
@@ -61,6 +61,6 @@ URL path template (e.g. `"/profile/:username"`, `"/settings/:section?"`).
|
|
|
61
61
|
optional states?: Record<string, RouteStateNode>;
|
|
62
62
|
```
|
|
63
63
|
|
|
64
|
-
Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:30](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
64
|
+
Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:30](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/play-xstate/src/routing/format-play-route-transitions.ts#L30)
|
|
65
65
|
|
|
66
66
|
Nested child states, recursively crawled for additional route declarations.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function defineXmVitestConfig(importMetaUrl, overrides): object;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [src/index.ts:10](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [src/index.ts:10](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/shared/src/index.ts#L10)
|
|
10
10
|
|
|
11
11
|
Create a Vitest config with XMachines workspace defaults.
|
|
12
12
|
|
|
@@ -26,4 +26,4 @@ render it under `@xmachines/shared` instead of nested module pages.
|
|
|
26
26
|
|
|
27
27
|
| Name | Type | Defined in |
|
|
28
28
|
| ------ | ----- | ---------------------------------------------------------------------------------------------------------------------------- |
|
|
29
|
-
| `test` | `any` | [config/vitest.ts:82](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
29
|
+
| `test` | `any` | [config/vitest.ts:82](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/shared/config/vitest.ts#L82) |
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function xmAliases(importMetaUrl): Record<string, string>;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [src/index.ts:20](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [src/index.ts:20](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.19/packages/shared/src/index.ts#L20)
|
|
10
10
|
|
|
11
11
|
Build Vite/Vitest alias entries for all `@xmachines/*` workspace packages.
|
|
12
12
|
|