@xmachines/docs 1.0.0-beta.25 → 1.0.0-beta.26
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/classes/PlayError.md +10 -4
- package/api/@xmachines/play/type-aliases/PlayEvent.md +2 -2
- package/api/@xmachines/play-actor/README.md +4 -0
- package/api/@xmachines/play-actor/classes/AbstractActor.md +49 -92
- package/api/@xmachines/play-actor/functions/typedSpec.md +57 -0
- package/api/@xmachines/play-actor/interfaces/PlaySpec.md +9 -18
- package/api/@xmachines/play-actor/interfaces/Routable.md +5 -21
- package/api/@xmachines/play-actor/interfaces/ViewMetadata.md +6 -6
- package/api/@xmachines/play-actor/interfaces/Viewable.md +5 -6
- 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-dom-router/README.md +10 -0
- package/api/@xmachines/play-dom-router/functions/connectRouter.md +18 -46
- package/api/@xmachines/play-dom-router/functions/createBrowserHistory.md +1 -1
- package/api/@xmachines/play-dom-router/functions/createRouteMap.md +38 -0
- package/api/@xmachines/play-dom-router/functions/createRouter.md +1 -1
- package/api/@xmachines/play-dom-router/interfaces/BrowserHistory.md +16 -16
- package/api/@xmachines/play-dom-router/interfaces/BrowserWindow.md +16 -16
- package/api/@xmachines/play-dom-router/interfaces/ConnectRouterOptions.md +6 -6
- package/api/@xmachines/play-dom-router/interfaces/PlayRouteEvent.md +119 -0
- package/api/@xmachines/play-dom-router/interfaces/RouteMap.md +114 -0
- package/api/@xmachines/play-dom-router/interfaces/RouteMapLike.md +50 -0
- package/api/@xmachines/play-dom-router/interfaces/RouteMapping.md +27 -0
- package/api/@xmachines/play-dom-router/interfaces/RouterBridge.md +104 -0
- package/api/@xmachines/play-dom-router/interfaces/VanillaRouter.md +6 -6
- package/api/@xmachines/play-dom-router/type-aliases/RoutableActor.md +9 -0
- package/api/@xmachines/play-react/README.md +4 -4
- package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +31 -5
- package/api/@xmachines/play-react/functions/defineRegistry.md +2 -0
- package/api/@xmachines/play-react/functions/useActor.md +1 -1
- package/api/@xmachines/play-react/functions/useBoundProp.md +2 -0
- package/api/@xmachines/play-react/functions/useSignalEffect.md +1 -1
- package/api/@xmachines/play-react/functions/useStateBinding.md +2 -0
- package/api/@xmachines/play-react/interfaces/ComponentContext.md +2 -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 +7 -7
- package/api/@xmachines/play-react/type-aliases/ComponentFn.md +2 -0
- 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/README.md +5 -1
- package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +102 -25
- package/api/@xmachines/play-react-router/classes/RouteMap.md +17 -33
- package/api/@xmachines/play-react-router/functions/PlayRouterProvider.md +8 -1
- package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +21 -11
- package/api/@xmachines/play-react-router/interfaces/PlayRouteEvent.md +8 -8
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +7 -7
- package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +18 -8
- package/api/@xmachines/play-react-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-router/README.md +42 -5
- package/api/@xmachines/play-router/classes/BaseRouteMap.md +12 -19
- package/api/@xmachines/play-router/classes/RouterBridgeBase.md +100 -25
- package/api/@xmachines/play-router/functions/buildPlayRouteEvent.md +1 -1
- package/api/@xmachines/play-router/functions/buildRouteTree.md +1 -1
- package/api/@xmachines/play-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-router/functions/createRouteMapFromMachine.md +38 -0
- package/api/@xmachines/play-router/functions/createRouteMapFromTree.md +45 -0
- 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/extractQuery.md +1 -1
- package/api/@xmachines/play-router/functions/extractRouteParams.md +46 -0
- 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 +1 -1
- package/api/@xmachines/play-router/functions/isRouteReachable.md +1 -1
- package/api/@xmachines/play-router/functions/machineToGraph.md +1 -1
- package/api/@xmachines/play-router/functions/routeExists.md +1 -1
- package/api/@xmachines/play-router/functions/sanitizePathname.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/BuildPlayRouteEventOptions.md +4 -4
- package/api/@xmachines/play-router/interfaces/LocationLike.md +27 -0
- package/api/@xmachines/play-router/interfaces/MachineEdgeData.md +3 -3
- package/api/@xmachines/play-router/interfaces/MachineNodeData.md +5 -5
- package/api/@xmachines/play-router/interfaces/PlayRouteEvent.md +8 -8
- 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/{BaseRouteMapping.md → RouteMapping.md} +5 -5
- package/api/@xmachines/play-router/interfaces/RouteMatch.md +5 -5
- 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 +5 -5
- package/api/@xmachines/play-router/interfaces/RouteWatcherHandle.md +3 -3
- package/api/@xmachines/play-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-router/interfaces/WindowLike.md +65 -0
- package/api/@xmachines/play-router/type-aliases/MachineGraph.md +1 -1
- package/api/@xmachines/play-router/type-aliases/RouteMetadata.md +1 -1
- package/api/@xmachines/play-signals/functions/watchSignal.md +1 -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/namespaces/Signal/classes/Computed.md +6 -0
- package/api/@xmachines/play-signals/namespaces/Signal/classes/State.md +8 -0
- package/api/@xmachines/play-signals/namespaces/Signal/interfaces/Options.md +2 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/classes/Watcher.md +10 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/currentComputed.md +2 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/hasSinks.md +2 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/hasSources.md +2 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/introspectSinks.md +2 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/introspectSources.md +2 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/untrack.md +2 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/variables/unwatched.md +2 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/variables/watched.md +2 -0
- package/api/@xmachines/play-signals/namespaces/Signal/variables/isComputed.md +2 -0
- package/api/@xmachines/play-signals/namespaces/Signal/variables/isState.md +2 -0
- package/api/@xmachines/play-signals/namespaces/Signal/variables/isWatcher.md +2 -0
- package/api/@xmachines/play-signals/type-aliases/WatcherNotify.md +1 -1
- package/api/@xmachines/play-solid/README.md +4 -4
- package/api/@xmachines/play-solid/functions/defineRegistry.md +2 -0
- package/api/@xmachines/play-solid/functions/useActor.md +1 -1
- package/api/@xmachines/play-solid/functions/useStateBinding.md +2 -0
- package/api/@xmachines/play-solid/interfaces/ComponentContext.md +2 -0
- package/api/@xmachines/play-solid/interfaces/PlayRendererProps.md +7 -7
- package/api/@xmachines/play-solid/type-aliases/ComponentFn.md +2 -0
- 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 +2 -2
- package/api/@xmachines/play-solid-router/classes/RouteMap.md +13 -26
- package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +121 -46
- package/api/@xmachines/play-solid-router/functions/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-solid-router/functions/createRouteMap.md +15 -9
- package/api/@xmachines/play-solid-router/interfaces/AbstractActor.md +47 -92
- package/api/@xmachines/play-solid-router/interfaces/PlayRouteEvent.md +8 -8
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +5 -5
- package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +19 -6
- package/api/@xmachines/play-solid-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-solid-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +21 -18
- package/api/@xmachines/play-svelte/README.md +28 -0
- package/api/@xmachines/play-svelte/functions/defineRegistry.md +2 -0
- package/api/@xmachines/play-svelte/interfaces/BaseComponentProps.md +2 -0
- package/api/@xmachines/play-svelte/interfaces/ComponentContext.md +2 -0
- package/api/@xmachines/play-svelte/interfaces/PlayRendererProps.md +9 -9
- package/api/@xmachines/play-svelte/type-aliases/ComponentFn.md +2 -0
- package/api/@xmachines/play-svelte/type-aliases/PlayRenderer.md +2 -0
- package/api/@xmachines/play-svelte/variables/PlayRenderer.md +2 -0
- package/api/@xmachines/play-svelte-spa-router/README.md +1 -0
- package/api/@xmachines/play-svelte-spa-router/classes/RouteMap.md +13 -26
- package/api/@xmachines/play-svelte-spa-router/functions/connectRouter.md +14 -1
- package/api/@xmachines/play-svelte-spa-router/functions/createRouteMap.md +23 -4
- package/api/@xmachines/play-svelte-spa-router/interfaces/ConnectRouterOptions.md +6 -5
- package/api/@xmachines/play-svelte-spa-router/interfaces/PlayRouteEvent.md +10 -10
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapping.md +20 -5
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-svelte-spa-router/interfaces/WindowLike.md +65 -0
- package/api/@xmachines/play-svelte-spa-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-sveltekit-router/README.md +2 -1
- package/api/@xmachines/play-sveltekit-router/classes/RouteMap.md +46 -24
- package/api/@xmachines/play-sveltekit-router/functions/connectRouter.md +14 -1
- package/api/@xmachines/play-sveltekit-router/functions/createRouteMap.md +23 -4
- package/api/@xmachines/play-sveltekit-router/interfaces/ConnectRouterOptions.md +6 -5
- package/api/@xmachines/play-sveltekit-router/interfaces/LocationLike.md +27 -0
- package/api/@xmachines/play-sveltekit-router/interfaces/PlayRouteEvent.md +10 -10
- package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapping.md +20 -5
- package/api/@xmachines/play-sveltekit-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-sveltekit-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/README.md +5 -3
- package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +17 -33
- package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +93 -25
- 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 +21 -11
- package/api/@xmachines/play-tanstack-react-router/functions/extractMachineRoutes.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouteEvent.md +8 -8
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +5 -5
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapping.md +18 -8
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteNavigateEvent.md +3 -3
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouterBridge.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 +6 -26
- package/api/@xmachines/play-tanstack-solid-router/README.md +8 -8
- package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +13 -26
- package/api/@xmachines/play-tanstack-solid-router/classes/SolidRouterBridge.md +101 -36
- package/api/@xmachines/play-tanstack-solid-router/functions/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +15 -9
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouteEvent.md +8 -8
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +5 -5
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +13 -9
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouterBridge.md +3 -3
- 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 +23 -24
- package/api/@xmachines/play-vue/README.md +4 -4
- package/api/@xmachines/play-vue/functions/defineRegistry.md +1 -1
- package/api/@xmachines/play-vue/functions/useActor.md +1 -1
- package/api/@xmachines/play-vue/functions/useStateBinding.md +2 -0
- package/api/@xmachines/play-vue/interfaces/ComponentContext.md +2 -0
- package/api/@xmachines/play-vue/interfaces/PlayRendererProps.md +5 -5
- package/api/@xmachines/play-vue/type-aliases/ComponentEntry.md +1 -1
- package/api/@xmachines/play-vue/type-aliases/ComponentFn.md +2 -0
- package/api/@xmachines/play-vue/type-aliases/ComponentsMap.md +1 -1
- package/api/@xmachines/play-vue/type-aliases/DefineRegistryOptions.md +2 -2
- 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 +2 -2
- package/api/@xmachines/play-vue-router/classes/RouteMap.md +18 -108
- package/api/@xmachines/play-vue-router/classes/VueBaseRouteMap.md +44 -104
- package/api/@xmachines/play-vue-router/classes/VueRouterBridge.md +127 -62
- package/api/@xmachines/play-vue-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-vue-router/interfaces/PlayRouteEvent.md +8 -8
- package/api/@xmachines/play-vue-router/interfaces/RouteMapping.md +19 -7
- package/api/@xmachines/play-vue-router/interfaces/RouterBridge.md +3 -3
- 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 +15 -15
- package/api/@xmachines/play-xstate/classes/PlayerActor.md +46 -30
- package/api/@xmachines/play-xstate/functions/buildRouteUrl.md +20 -15
- 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 +1 -1
- package/api/@xmachines/play-xstate/functions/definePlayer.md +1 -1
- 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 +2 -2
- 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 +14 -12
- 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 +4 -4
- package/api/llms.txt +3 -3
- package/examples/README.md +5 -0
- package/examples/routing-patterns.md +6 -4
- package/package.json +2 -2
- package/api/@xmachines/play-tanstack-react-router/functions/extractParams.md +0 -38
- package/api/@xmachines/play-tanstack-react-router/functions/extractQueryParams.md +0 -33
|
@@ -2,63 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
# Abstract Interface: AbstractActor\<TLogic, TEvent\>
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-actor/src/abstract-actor.ts:
|
|
5
|
+
Defined in: [packages/play-actor/src/abstract-actor.ts:141](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-actor/src/abstract-actor.ts#L141)
|
|
6
6
|
|
|
7
7
|
Abstract base class for Play Architecture actors.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
The core protocol contains only:
|
|
13
|
-
|
|
14
|
-
- state: Reactive state snapshot
|
|
15
|
-
- send: Event dispatch method
|
|
16
|
-
|
|
17
|
-
Optional capabilities (routing, view rendering) are provided via interfaces:
|
|
18
|
-
|
|
19
|
-
- Implement Routable for routing support
|
|
20
|
-
- Implement Viewable for view rendering support
|
|
21
|
-
|
|
22
|
-
Concrete implementations created by @xmachines/play-xstate adapter.
|
|
23
|
-
|
|
24
|
-
## Examples
|
|
25
|
-
|
|
26
|
-
Simple actor (no routing, no view) - single type param, backward compat
|
|
27
|
-
|
|
28
|
-
```typescript
|
|
29
|
-
class SimpleActor extends AbstractActor<AnyActorLogic> {
|
|
30
|
-
state = new Signal.State({...});
|
|
31
|
-
send(event) { ... }
|
|
32
|
-
}
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
Typed event actor - two type params
|
|
36
|
-
|
|
37
|
-
```typescript
|
|
38
|
-
type AuthEvent = { type: "auth.login"; username: string } | { type: "auth.logout" };
|
|
39
|
-
class AuthActor extends AbstractActor<AnyActorLogic, AuthEvent> {
|
|
40
|
-
state = new Signal.State({...});
|
|
41
|
-
send(event: AuthEvent) { ... }
|
|
42
|
-
}
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
Full-featured actor (routing + view)
|
|
46
|
-
|
|
47
|
-
```typescript
|
|
48
|
-
class PlayerActor extends AbstractActor<AnyActorLogic, EventFromLogic<TMachine>>
|
|
49
|
-
implements Routable, Viewable {
|
|
50
|
-
state = new Signal.State({...});
|
|
51
|
-
currentRoute = new Signal.Computed(() => deriveRoute(this.state.get()));
|
|
52
|
-
currentView = new Signal.State(null);
|
|
53
|
-
send(event) { ... }
|
|
54
|
-
}
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
## See
|
|
58
|
-
|
|
59
|
-
- [Play RFC](../../../../rfc/play.md)
|
|
60
|
-
- [Routable](../../play-actor/interfaces/Routable.md) for routing capability
|
|
61
|
-
- [Viewable](../../play-actor/interfaces/Viewable.md) for view rendering capability
|
|
9
|
+
Provides signal-driven state observation that integrates with XState ecosystem
|
|
10
|
+
tooling (devtools, inspection) while exposing reactive signals for
|
|
11
|
+
Infrastructure layer communication.
|
|
62
12
|
|
|
63
13
|
## Extends
|
|
64
14
|
|
|
@@ -66,26 +16,26 @@ class PlayerActor extends AbstractActor<AnyActorLogic, EventFromLogic<TMachine>>
|
|
|
66
16
|
|
|
67
17
|
## Type Parameters
|
|
68
18
|
|
|
69
|
-
| Type Parameter | Default type | Description
|
|
70
|
-
| ---------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
|
|
71
|
-
| `TLogic` _extends_ [`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic) | - | XState actor logic type
|
|
72
|
-
| `TEvent` _extends_ [`EventObject`](https://www.jsdocs.io/package/xstate#EventObject) | [`EventObject`](https://www.jsdocs.io/package/xstate#EventObject) | Event type
|
|
19
|
+
| Type Parameter | Default type | Description |
|
|
20
|
+
| ---------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------- |
|
|
21
|
+
| `TLogic` _extends_ [`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic) | - | XState actor logic type |
|
|
22
|
+
| `TEvent` _extends_ [`EventObject`](https://www.jsdocs.io/package/xstate#EventObject) | [`EventObject`](https://www.jsdocs.io/package/xstate#EventObject) | Event type constraint (defaults to EventObject) |
|
|
73
23
|
|
|
74
24
|
## Properties
|
|
75
25
|
|
|
76
|
-
| Property | Modifier | Type | Description
|
|
77
|
-
| ------------------------------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
78
|
-
| <a id="property-_parent"></a> `_parent?` | `public` | [`AnyActorRef`](https://www.jsdocs.io/package/xstate#AnyActorRef) | -
|
|
79
|
-
| <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.
|
|
80
|
-
| <a id="property-id"></a> `id` | `public` | `string` | The unique identifier for this actor relative to its parent.
|
|
81
|
-
| <a id="property-logic"></a> `logic` | `public` | `TLogic` | -
|
|
82
|
-
| <a id="property-options"></a> `options` | `public` | `Readonly`\<[`ActorOptions`](https://www.jsdocs.io/package/xstate#ActorOptions)\<`TLogic`\>\> | -
|
|
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`\>\> | -
|
|
84
|
-
| <a id="property-sessionid"></a> `sessionId` | `public` | `string` | The globally unique process ID for this invocation.
|
|
85
|
-
| <a id="property-src"></a> `src` | `public` | \| `string` \| [`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic) | -
|
|
86
|
-
| <a id="property-state"></a> `state` | `abstract` | [`State`](../../play-signals/namespaces/Signal/classes/State.md)\<`unknown`\> | Reactive snapshot of current actor state.
|
|
87
|
-
| <a id="property-system"></a> `system` | `public` | [`AnyActorSystem`](https://www.jsdocs.io/package/xstate#AnyActorSystem) | The system to which this actor belongs.
|
|
88
|
-
| <a id="property-systemid"></a> `systemId` | `public` | `string` \| `undefined` | -
|
|
26
|
+
| Property | Modifier | Type | Description | Inherited from | Defined in |
|
|
27
|
+
| ------------------------------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
28
|
+
| <a id="property-_parent"></a> `_parent?` | `public` | [`AnyActorRef`](https://www.jsdocs.io/package/xstate#AnyActorRef) | - | `Actor._parent` | - |
|
|
29
|
+
| <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. | `Actor.clock` | - |
|
|
30
|
+
| <a id="property-id"></a> `id` | `public` | `string` | The unique identifier for this actor relative to its parent. | `Actor.id` | - |
|
|
31
|
+
| <a id="property-logic"></a> `logic` | `public` | `TLogic` | - | `Actor.logic` | - |
|
|
32
|
+
| <a id="property-options"></a> `options` | `public` | `Readonly`\<[`ActorOptions`](https://www.jsdocs.io/package/xstate#ActorOptions)\<`TLogic`\>\> | - | `Actor.options` | - |
|
|
33
|
+
| <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` | - |
|
|
34
|
+
| <a id="property-sessionid"></a> `sessionId` | `public` | `string` | The globally unique process ID for this invocation. | `Actor.sessionId` | - |
|
|
35
|
+
| <a id="property-src"></a> `src` | `public` | \| `string` \| [`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic) | - | `Actor.src` | - |
|
|
36
|
+
| <a id="property-state"></a> `state` | `abstract` | [`State`](../../play-signals/namespaces/Signal/classes/State.md)\<`unknown`\> | Reactive snapshot of current actor state. Infrastructure observes this signal to react to state changes without directly coupling to the actor's internal state machine implementation. | - | [packages/play-actor/src/abstract-actor.ts:151](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-actor/src/abstract-actor.ts#L151) |
|
|
37
|
+
| <a id="property-system"></a> `system` | `public` | [`AnyActorSystem`](https://www.jsdocs.io/package/xstate#AnyActorSystem) | The system to which this actor belongs. | `Actor.system` | - |
|
|
38
|
+
| <a id="property-systemid"></a> `systemId` | `public` | `string` \| `undefined` | - | `Actor.systemId` | - |
|
|
89
39
|
|
|
90
40
|
## Methods
|
|
91
41
|
|
|
@@ -95,6 +45,8 @@ class PlayerActor extends AbstractActor<AnyActorLogic, EventFromLogic<TMachine>>
|
|
|
95
45
|
observable: InteropSubscribable<SnapshotFrom<TLogic>>;
|
|
96
46
|
```
|
|
97
47
|
|
|
48
|
+
Defined in: `xstate`
|
|
49
|
+
|
|
98
50
|
#### Returns
|
|
99
51
|
|
|
100
52
|
[`InteropSubscribable`](https://www.jsdocs.io/package/xstate#InteropSubscribable)\<[`SnapshotFrom`](https://www.jsdocs.io/package/xstate#SnapshotFrom)\<`TLogic`\>\>
|
|
@@ -113,6 +65,8 @@ Actor.[observable]
|
|
|
113
65
|
getPersistedSnapshot(): Snapshot<unknown>;
|
|
114
66
|
```
|
|
115
67
|
|
|
68
|
+
Defined in: `xstate`
|
|
69
|
+
|
|
116
70
|
Obtain the internal state of the actor, which can be persisted.
|
|
117
71
|
|
|
118
72
|
#### Returns
|
|
@@ -147,6 +101,8 @@ Actor.getPersistedSnapshot;
|
|
|
147
101
|
getSnapshot(): SnapshotFrom<TLogic>;
|
|
148
102
|
```
|
|
149
103
|
|
|
104
|
+
Defined in: `xstate`
|
|
105
|
+
|
|
150
106
|
Read an actor’s snapshot synchronously.
|
|
151
107
|
|
|
152
108
|
#### Returns
|
|
@@ -182,6 +138,8 @@ Actor.getSnapshot;
|
|
|
182
138
|
on<TType>(type, handler): Subscription;
|
|
183
139
|
```
|
|
184
140
|
|
|
141
|
+
Defined in: `xstate`
|
|
142
|
+
|
|
185
143
|
#### Type Parameters
|
|
186
144
|
|
|
187
145
|
| Type Parameter |
|
|
@@ -213,6 +171,8 @@ Actor.on;
|
|
|
213
171
|
select<TSelected>(selector, equalityFn?): Readable<TSelected>;
|
|
214
172
|
```
|
|
215
173
|
|
|
174
|
+
Defined in: `xstate`
|
|
175
|
+
|
|
216
176
|
#### Type Parameters
|
|
217
177
|
|
|
218
178
|
| Type Parameter |
|
|
@@ -244,37 +204,22 @@ Actor.select;
|
|
|
244
204
|
abstract send(event): void;
|
|
245
205
|
```
|
|
246
206
|
|
|
247
|
-
Defined in: [packages/play-actor/src/abstract-actor.ts:
|
|
207
|
+
Defined in: [packages/play-actor/src/abstract-actor.ts:158](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-actor/src/abstract-actor.ts#L158)
|
|
248
208
|
|
|
249
|
-
Send event to Actor
|
|
209
|
+
Send event to Actor.
|
|
250
210
|
|
|
251
|
-
|
|
252
|
-
as events to the Actor. The Actor's state machine guards determine whether
|
|
253
|
-
each event is valid from the current state.
|
|
211
|
+
Constrained to TEvent for type safety in concrete implementations.
|
|
254
212
|
|
|
255
213
|
#### Parameters
|
|
256
214
|
|
|
257
|
-
| Parameter | Type |
|
|
258
|
-
| --------- | -------- |
|
|
259
|
-
| `event` | `TEvent` |
|
|
215
|
+
| Parameter | Type |
|
|
216
|
+
| --------- | -------- |
|
|
217
|
+
| `event` | `TEvent` |
|
|
260
218
|
|
|
261
219
|
#### Returns
|
|
262
220
|
|
|
263
221
|
`void`
|
|
264
222
|
|
|
265
|
-
#### Example
|
|
266
|
-
|
|
267
|
-
```typescript
|
|
268
|
-
// Infrastructure forwards user intent
|
|
269
|
-
actor.send({ type: "auth.login", userId: "123" });
|
|
270
|
-
// Actor's guards determine if event is allowed
|
|
271
|
-
```
|
|
272
|
-
|
|
273
|
-
#### Remarks
|
|
274
|
-
|
|
275
|
-
Accepts any event object with a type property. Core events (PlayEvent) are in
|
|
276
|
-
@xmachines/play, routing events (PlayRouteEvent) are in @xmachines/play-router.
|
|
277
|
-
|
|
278
223
|
#### Overrides
|
|
279
224
|
|
|
280
225
|
```ts
|
|
@@ -289,6 +234,8 @@ Actor.send;
|
|
|
289
234
|
start(): this;
|
|
290
235
|
```
|
|
291
236
|
|
|
237
|
+
Defined in: `xstate`
|
|
238
|
+
|
|
292
239
|
Starts the Actor from the initial state
|
|
293
240
|
|
|
294
241
|
#### Returns
|
|
@@ -309,6 +256,8 @@ Actor.start;
|
|
|
309
256
|
stop(): this;
|
|
310
257
|
```
|
|
311
258
|
|
|
259
|
+
Defined in: `xstate`
|
|
260
|
+
|
|
312
261
|
Stops the Actor and unsubscribe all listeners.
|
|
313
262
|
|
|
314
263
|
#### Returns
|
|
@@ -331,6 +280,8 @@ Actor.stop;
|
|
|
331
280
|
subscribe(observer): Subscription;
|
|
332
281
|
```
|
|
333
282
|
|
|
283
|
+
Defined in: `xstate`
|
|
284
|
+
|
|
334
285
|
Subscribe an observer to an actor’s snapshot values.
|
|
335
286
|
|
|
336
287
|
##### Parameters
|
|
@@ -407,6 +358,8 @@ subscribe(
|
|
|
407
358
|
completeListener?): Subscription;
|
|
408
359
|
```
|
|
409
360
|
|
|
361
|
+
Defined in: `xstate`
|
|
362
|
+
|
|
410
363
|
Subscribe an observer to an actor’s snapshot values.
|
|
411
364
|
|
|
412
365
|
##### Parameters
|
|
@@ -484,6 +437,8 @@ Actor.subscribe;
|
|
|
484
437
|
toJSON(): object;
|
|
485
438
|
```
|
|
486
439
|
|
|
440
|
+
Defined in: `xstate`
|
|
441
|
+
|
|
487
442
|
#### Returns
|
|
488
443
|
|
|
489
444
|
`object`
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: PlayRouteEvent
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-router/src/types.ts:
|
|
5
|
+
Defined in: [packages/play-router/src/types.ts:223](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-router/src/types.ts#L223)
|
|
6
6
|
|
|
7
7
|
Enhanced routing event with parameter and query support
|
|
8
8
|
|
|
@@ -30,7 +30,7 @@ Target state ID with # prefix (e.g., '#home', '#profile')
|
|
|
30
30
|
|
|
31
31
|
## Param
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
Path-only route parameters extracted from the URL path (e.g., `{ userId: '123' }` from `/profile/123`). Query parameters are kept separate in `query`.
|
|
34
34
|
|
|
35
35
|
## Param
|
|
36
36
|
|
|
@@ -85,7 +85,7 @@ import type { PlayRouteEvent } from "@xmachines/play-router";
|
|
|
85
85
|
const event: PlayRouteEvent = {
|
|
86
86
|
type: "play.route",
|
|
87
87
|
to: "#settings",
|
|
88
|
-
params: { section: "profile" }, //
|
|
88
|
+
params: { section: "profile" }, // Path-only route parameter
|
|
89
89
|
query: { tab: "security" }, // Query-only
|
|
90
90
|
};
|
|
91
91
|
actor.send(event);
|
|
@@ -112,8 +112,8 @@ URLPatternResult for advanced use cases (debugging, pattern analysis).
|
|
|
112
112
|
|
|
113
113
|
| Property | Modifier | Type | Defined in |
|
|
114
114
|
| -------------------------------------- | ---------- | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
115
|
-
| <a id="property-match"></a> `match?` | `readonly` | `unknown` | [packages/play-router/src/types.ts:
|
|
116
|
-
| <a id="property-params"></a> `params?` | `readonly` | `Record`\<`string`, `string`\> | [packages/play-router/src/types.ts:
|
|
117
|
-
| <a id="property-query"></a> `query?` | `readonly` | `Record`\<`string`, `string`\> | [packages/play-router/src/types.ts:
|
|
118
|
-
| <a id="property-to"></a> `to` | `readonly` | `string` | [packages/play-router/src/types.ts:
|
|
119
|
-
| <a id="property-type"></a> `type` | `readonly` | `"play.route"` | [packages/play-router/src/types.ts:
|
|
115
|
+
| <a id="property-match"></a> `match?` | `readonly` | `unknown` | [packages/play-router/src/types.ts:228](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-router/src/types.ts#L228) |
|
|
116
|
+
| <a id="property-params"></a> `params?` | `readonly` | `Record`\<`string`, `string`\> | [packages/play-router/src/types.ts:226](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-router/src/types.ts#L226) |
|
|
117
|
+
| <a id="property-query"></a> `query?` | `readonly` | `Record`\<`string`, `string`\> | [packages/play-router/src/types.ts:227](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-router/src/types.ts#L227) |
|
|
118
|
+
| <a id="property-to"></a> `to` | `readonly` | `string` | [packages/play-router/src/types.ts:225](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-router/src/types.ts#L225) |
|
|
119
|
+
| <a id="property-type"></a> `type` | `readonly` | `"play.route"` | [packages/play-router/src/types.ts:224](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-router/src/types.ts#L224) |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
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:33](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-solid-router/src/play-router-provider.tsx#L33)
|
|
6
6
|
|
|
7
7
|
## Type Parameters
|
|
8
8
|
|
|
@@ -14,7 +14,7 @@ Defined in: [packages/play-solid-router/src/play-router-provider.tsx:16](https:/
|
|
|
14
14
|
|
|
15
15
|
| Property | Type | Description | Defined in |
|
|
16
16
|
| ----------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
17
|
-
| <a id="property-actor"></a> `actor` | `TActor` | - | [packages/play-solid-router/src/play-router-provider.tsx:
|
|
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:
|
|
19
|
-
| <a id="property-routemap"></a> `routeMap` | [`RouteMap`](../classes/RouteMap.md) | - | [packages/play-solid-router/src/play-router-provider.tsx:
|
|
20
|
-
| <a id="property-router"></a> `router` | [`SolidRouterHooks`](../type-aliases/SolidRouterHooks.md) | - | [packages/play-solid-router/src/play-router-provider.tsx:
|
|
17
|
+
| <a id="property-actor"></a> `actor` | `TActor` | - | [packages/play-solid-router/src/play-router-provider.tsx:34](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-solid-router/src/play-router-provider.tsx#L34) |
|
|
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:38](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-solid-router/src/play-router-provider.tsx#L38) |
|
|
19
|
+
| <a id="property-routemap"></a> `routeMap` | [`RouteMap`](../classes/RouteMap.md) | - | [packages/play-solid-router/src/play-router-provider.tsx:35](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-solid-router/src/play-router-provider.tsx#L35) |
|
|
20
|
+
| <a id="property-router"></a> `router` | [`SolidRouterHooks`](../type-aliases/SolidRouterHooks.md) | - | [packages/play-solid-router/src/play-router-provider.tsx:36](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-solid-router/src/play-router-provider.tsx#L36) |
|
|
@@ -2,13 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: RouteMapping
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-
|
|
5
|
+
Defined in: [packages/play-router/src/base-route-map.ts:57](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-router/src/base-route-map.ts#L57)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
A single state ID ↔ path mapping entry.
|
|
8
|
+
|
|
9
|
+
Both fields are `readonly` — mappings are immutable once passed to `BaseRouteMap`.
|
|
10
|
+
Adapter packages re-export a structurally compatible `RouteMapping` type under
|
|
11
|
+
their own name. This type is published from `@xmachines/play-router` as
|
|
12
|
+
`BaseRouteMapping` to avoid name collisions with those adapter-local types.
|
|
13
|
+
|
|
14
|
+
## Example
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
const mapping: BaseRouteMapping = { stateId: "home", path: "/" };
|
|
18
|
+
const paramMapping: BaseRouteMapping = { stateId: "profile", path: "/profile/:userId" };
|
|
19
|
+
const optionalMapping: BaseRouteMapping = { stateId: "settings", path: "/settings/:section?" };
|
|
20
|
+
```
|
|
8
21
|
|
|
9
22
|
## Properties
|
|
10
23
|
|
|
11
|
-
| Property | Modifier | Type | Description
|
|
12
|
-
| --------------------------------------- | ---------- | -------- |
|
|
13
|
-
| <a id="property-path"></a> `path` | `readonly` | `string` |
|
|
14
|
-
| <a id="property-stateid"></a> `stateId` | `readonly` | `string` |
|
|
24
|
+
| Property | Modifier | Type | Description | Defined in |
|
|
25
|
+
| --------------------------------------- | ---------- | -------- | ----------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
26
|
+
| <a id="property-path"></a> `path` | `readonly` | `string` | URL path pattern (e.g., `"/"`, `"/profile/:userId"`, `"/settings/:section?"`) | [packages/play-router/src/base-route-map.ts:61](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-router/src/base-route-map.ts#L61) |
|
|
27
|
+
| <a id="property-stateid"></a> `stateId` | `readonly` | `string` | State machine state ID (e.g., `"home"`, `"#profile"`) | [packages/play-router/src/base-route-map.ts:59](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-router/src/base-route-map.ts#L59) |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: RouterBridge
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-router/src/types.ts:
|
|
5
|
+
Defined in: [packages/play-router/src/types.ts:271](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-router/src/types.ts#L271)
|
|
6
6
|
|
|
7
7
|
RouterBridge interface for runtime infrastructure adapters
|
|
8
8
|
|
|
@@ -54,7 +54,7 @@ class TanStackRouterBridge implements RouterBridge {
|
|
|
54
54
|
connect(): void | Promise<void>;
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
Defined in: [packages/play-router/src/types.ts:
|
|
57
|
+
Defined in: [packages/play-router/src/types.ts:287](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-router/src/types.ts#L287)
|
|
58
58
|
|
|
59
59
|
Connect the router bridge to the Actor
|
|
60
60
|
|
|
@@ -83,7 +83,7 @@ await bridge.connect();
|
|
|
83
83
|
disconnect(): void | Promise<void>;
|
|
84
84
|
```
|
|
85
85
|
|
|
86
|
-
Defined in: [packages/play-router/src/types.ts:
|
|
86
|
+
Defined in: [packages/play-router/src/types.ts:303](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-router/src/types.ts#L303)
|
|
87
87
|
|
|
88
88
|
Disconnect the router bridge from the Actor
|
|
89
89
|
|
|
@@ -6,6 +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:9](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-solid-router/src/play-router-provider.tsx#L9)
|
|
10
10
|
|
|
11
11
|
Minimum actor shape accepted by PlayRouterProvider.
|
|
@@ -6,46 +6,49 @@
|
|
|
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:27](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-solid-router/src/play-router-provider.tsx#L27)
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
### location
|
|
11
|
+
The three Solid Router hook results that `PlayRouterProvider` and `SolidRouterBridge`
|
|
12
|
+
require. Pass these directly from your component's hook calls:
|
|
14
13
|
|
|
15
|
-
```
|
|
16
|
-
|
|
14
|
+
```tsx
|
|
15
|
+
const navigate = useNavigate(); // → SolidRouterHooks.navigate
|
|
16
|
+
const location = useLocation(); // → SolidRouterHooks.location
|
|
17
|
+
const params = useParams(); // → SolidRouterHooks.params
|
|
17
18
|
```
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
- `navigate` — used to push URL changes when the actor's `currentRoute` changes.
|
|
21
|
+
- `location` — `pathname` and `search` are read at `connect()` time for deep-link sync.
|
|
22
|
+
Subsequent pathname changes drive router→actor sync via `createEffect`.
|
|
23
|
+
- `params` — Solid's pre-parsed path parameters for the current route segment. Used
|
|
24
|
+
directly in `extractParams()` to avoid re-parsing with URLPattern.
|
|
22
25
|
|
|
23
|
-
|
|
24
|
-
pathname: string;
|
|
25
|
-
```
|
|
26
|
+
## Properties
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
### location
|
|
28
29
|
|
|
29
30
|
```ts
|
|
30
|
-
|
|
31
|
+
location: Location;
|
|
31
32
|
```
|
|
32
33
|
|
|
34
|
+
Defined in: [packages/play-solid-router/src/play-router-provider.tsx:29](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-solid-router/src/play-router-provider.tsx#L29)
|
|
35
|
+
|
|
33
36
|
---
|
|
34
37
|
|
|
35
38
|
### navigate
|
|
36
39
|
|
|
37
40
|
```ts
|
|
38
|
-
navigate:
|
|
41
|
+
navigate: Navigator;
|
|
39
42
|
```
|
|
40
43
|
|
|
41
|
-
Defined in: [packages/play-solid-router/src/play-router-provider.tsx:
|
|
44
|
+
Defined in: [packages/play-solid-router/src/play-router-provider.tsx:28](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-solid-router/src/play-router-provider.tsx#L28)
|
|
42
45
|
|
|
43
46
|
---
|
|
44
47
|
|
|
45
48
|
### params
|
|
46
49
|
|
|
47
50
|
```ts
|
|
48
|
-
params:
|
|
51
|
+
params: Params;
|
|
49
52
|
```
|
|
50
53
|
|
|
51
|
-
Defined in: [packages/play-solid-router/src/play-router-provider.tsx:
|
|
54
|
+
Defined in: [packages/play-solid-router/src/play-router-provider.tsx:30](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-solid-router/src/play-router-provider.tsx#L30)
|
|
@@ -60,6 +60,28 @@ For anything else (`schema`, `Renderer`, `JsonUIProvider`, context helpers), imp
|
|
|
60
60
|
- If you do not pass a `store`, `PlayRenderer` creates an internal `@xstate/store` atom from `view.spec.state`.
|
|
61
61
|
- If you do pass a `store`, that external store wins and no internal store is created for the view.
|
|
62
62
|
|
|
63
|
+
## Error handling
|
|
64
|
+
|
|
65
|
+
`PlayRenderer` wraps its content in a Svelte 5 `<svelte:boundary>`. Two props control error behavior:
|
|
66
|
+
|
|
67
|
+
- **`fallback`** — a Svelte snippet rendered when `currentView` is `null` (no active view) or when a catalog component throws during render.
|
|
68
|
+
- **`onError`** — a callback invoked when a catalog component throws. Receives the error and a `reset` function that clears the boundary and attempts to re-render.
|
|
69
|
+
|
|
70
|
+
```svelte
|
|
71
|
+
<PlayRenderer
|
|
72
|
+
{actor}
|
|
73
|
+
{registry}
|
|
74
|
+
fallback={errorSnippet}
|
|
75
|
+
onError={(error, reset) => {
|
|
76
|
+
console.error("Render error:", error);
|
|
77
|
+
// Optionally attempt recovery:
|
|
78
|
+
// reset();
|
|
79
|
+
}}
|
|
80
|
+
/>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
`onError` is optional. When omitted, render errors are silently caught by the boundary and `fallback` is shown if provided. The `reset` parameter follows Svelte 5's `<svelte:boundary onerror>` contract.
|
|
84
|
+
|
|
63
85
|
@xmachines/play-svelte - Svelte renderer for XMachines Play architecture
|
|
64
86
|
|
|
65
87
|
Provides a thin Svelte rendering layer that passively observes actor signals
|
|
@@ -89,3 +111,9 @@ from `@xmachines/play-svelte` rather than `@json-render/svelte` directly.
|
|
|
89
111
|
## Functions
|
|
90
112
|
|
|
91
113
|
- [defineRegistry](functions/defineRegistry.md)
|
|
114
|
+
|
|
115
|
+
## References
|
|
116
|
+
|
|
117
|
+
### getStateValue
|
|
118
|
+
|
|
119
|
+
Renames and re-exports [getBoundProp](variables/getBoundProp.md)
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
function defineRegistry<C, TComponents>(_catalog, options): DefineRegistryResult;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
+
Defined in: `@json-render/svelte`
|
|
10
|
+
|
|
9
11
|
Create a registry from a catalog with Svelte components and/or actions.
|
|
10
12
|
|
|
11
13
|
Components must accept `BaseComponentProps` as their props interface.
|