@xmachines/docs 1.0.0-beta.24 → 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 -17
- 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 +6 -6
- 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 +119 -0
- package/api/@xmachines/play-svelte/functions/defineRegistry.md +54 -0
- package/api/@xmachines/play-svelte/interfaces/BaseComponentProps.md +29 -0
- package/api/@xmachines/play-svelte/interfaces/ComponentContext.md +29 -0
- package/api/@xmachines/play-svelte/interfaces/PlayRendererProps.md +22 -0
- package/api/@xmachines/play-svelte/type-aliases/ComponentFn.md +18 -0
- package/api/@xmachines/play-svelte/type-aliases/PlayRenderer.md +9 -0
- package/api/@xmachines/play-svelte/variables/PlayRenderer.md +9 -0
- package/api/@xmachines/play-svelte/variables/getBoundProp.md +7 -0
- package/api/@xmachines/play-svelte-spa-router/README.md +54 -0
- package/api/@xmachines/play-svelte-spa-router/classes/RouteMap.md +137 -0
- package/api/@xmachines/play-svelte-spa-router/functions/connectRouter.md +32 -0
- package/api/@xmachines/play-svelte-spa-router/functions/createRouteMap.md +38 -0
- package/api/@xmachines/play-svelte-spa-router/interfaces/ConnectRouterOptions.md +17 -0
- package/api/@xmachines/play-svelte-spa-router/interfaces/PlayRouteEvent.md +119 -0
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapping.md +27 -0
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouterBridge.md +104 -0
- package/api/@xmachines/play-svelte-spa-router/interfaces/WindowLike.md +65 -0
- package/api/@xmachines/play-svelte-spa-router/type-aliases/RoutableActor.md +9 -0
- package/api/@xmachines/play-svelte-spa-router-demo/README.md +23 -0
- package/api/@xmachines/play-sveltekit-router/README.md +54 -0
- package/api/@xmachines/play-sveltekit-router/classes/RouteMap.md +137 -0
- package/api/@xmachines/play-sveltekit-router/functions/connectRouter.md +32 -0
- package/api/@xmachines/play-sveltekit-router/functions/createRouteMap.md +38 -0
- package/api/@xmachines/play-sveltekit-router/interfaces/ConnectRouterOptions.md +13 -0
- package/api/@xmachines/play-sveltekit-router/interfaces/LocationLike.md +27 -0
- package/api/@xmachines/play-sveltekit-router/interfaces/PlayRouteEvent.md +119 -0
- package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapping.md +27 -0
- package/api/@xmachines/play-sveltekit-router/interfaces/RouterBridge.md +104 -0
- package/api/@xmachines/play-sveltekit-router/type-aliases/RoutableActor.md +9 -0
- package/api/@xmachines/play-sveltekit-router-demo/README.md +23 -0
- 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 +9 -4
- package/api/llms.txt +6 -3
- package/examples/README.md +5 -0
- package/examples/multi-router-integration.md +34 -6
- 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,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Class: PlayError
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play/src/errors.ts:63](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
5
|
+
Defined in: [packages/play/src/errors.ts:63](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play/src/errors.ts#L63)
|
|
6
6
|
|
|
7
7
|
Base class for all typed runtime errors thrown by `@xmachines/*` packages.
|
|
8
8
|
|
|
@@ -82,7 +82,7 @@ new PlayError(
|
|
|
82
82
|
options?): PlayError;
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
-
Defined in: [packages/play/src/errors.ts:82](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
85
|
+
Defined in: [packages/play/src/errors.ts:82](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play/src/errors.ts#L82)
|
|
86
86
|
|
|
87
87
|
#### Parameters
|
|
88
88
|
|
|
@@ -108,10 +108,10 @@ Error.constructor;
|
|
|
108
108
|
| Property | Modifier | Type | Description | Inherited from | Defined in |
|
|
109
109
|
| ------------------------------------------------------- | ---------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
|
|
110
110
|
| <a id="property-cause"></a> `cause?` | `public` | `unknown` | - | `Error.cause` | - |
|
|
111
|
-
| <a id="property-code"></a> `code` | `readonly` | `string` | A stable, machine-readable error identifier. Error codes follow the `PLAY_<PACKAGE>_<DESCRIPTION>` naming convention and are guaranteed stable across patch and minor releases within a major version. Never match on `.message` — always match on `.code` or the subclass. | - | [packages/play/src/errors.ts:74](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
111
|
+
| <a id="property-code"></a> `code` | `readonly` | `string` | A stable, machine-readable error identifier. Error codes follow the `PLAY_<PACKAGE>_<DESCRIPTION>` naming convention and are guaranteed stable across patch and minor releases within a major version. Never match on `.message` — always match on `.code` or the subclass. | - | [packages/play/src/errors.ts:74](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play/src/errors.ts#L74) |
|
|
112
112
|
| <a id="property-message"></a> `message` | `public` | `string` | - | `Error.message` | - |
|
|
113
113
|
| <a id="property-name"></a> `name` | `public` | `string` | - | `Error.name` | - |
|
|
114
|
-
| <a id="property-scope"></a> `scope` | `readonly` | `string` | The class or module that threw this error (e.g. `"RouterBridgeBase"`). | - | [packages/play/src/errors.ts:65](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
114
|
+
| <a id="property-scope"></a> `scope` | `readonly` | `string` | The class or module that threw this error (e.g. `"RouterBridgeBase"`). | - | [packages/play/src/errors.ts:65](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play/src/errors.ts#L65) |
|
|
115
115
|
| <a id="property-stack"></a> `stack?` | `public` | `string` | - | `Error.stack` | - |
|
|
116
116
|
| <a id="property-stacktracelimit"></a> `stackTraceLimit` | `static` | `number` | The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. | `Error.stackTraceLimit` | - |
|
|
117
117
|
|
|
@@ -123,6 +123,8 @@ Error.constructor;
|
|
|
123
123
|
static captureStackTrace(targetObject, constructorOpt?): void;
|
|
124
124
|
```
|
|
125
125
|
|
|
126
|
+
Defined in: `@types/node`
|
|
127
|
+
|
|
126
128
|
Creates a `.stack` property on `targetObject`, which when accessed returns
|
|
127
129
|
a string representing the location in the code at which
|
|
128
130
|
`Error.captureStackTrace()` was called.
|
|
@@ -192,6 +194,8 @@ Error.captureStackTrace;
|
|
|
192
194
|
static isError(error): error is Error;
|
|
193
195
|
```
|
|
194
196
|
|
|
197
|
+
Defined in: `typescript`
|
|
198
|
+
|
|
195
199
|
Indicates whether the argument provided is a built-in Error instance or not.
|
|
196
200
|
|
|
197
201
|
#### Parameters
|
|
@@ -218,6 +222,8 @@ Error.isError;
|
|
|
218
222
|
static prepareStackTrace(err, stackTraces): any;
|
|
219
223
|
```
|
|
220
224
|
|
|
225
|
+
Defined in: `@types/node`
|
|
226
|
+
|
|
221
227
|
#### Parameters
|
|
222
228
|
|
|
223
229
|
| Parameter | Type |
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
type PlayEvent<TPayload> = object & TPayload;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play/src/types.ts:69](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play/src/types.ts:69](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play/src/types.ts#L69)
|
|
10
10
|
|
|
11
11
|
Generic event type for Play Architecture
|
|
12
12
|
|
|
@@ -34,7 +34,7 @@ Robot, and other state machine libraries.
|
|
|
34
34
|
|
|
35
35
|
| Name | Type | Defined in |
|
|
36
36
|
| ------ | -------- | -------------------------------------------------------------------------------------------------------------------------------- |
|
|
37
|
-
| `type` | `string` | [packages/play/src/types.ts:70](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
37
|
+
| `type` | `string` | [packages/play/src/types.ts:70](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play/src/types.ts#L70) |
|
|
38
38
|
|
|
39
39
|
## Type Parameters
|
|
40
40
|
|
|
@@ -2,63 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
# Abstract Class: 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](../interfaces/Routable.md) for routing capability
|
|
61
|
-
- [Viewable](../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
|
|
|
@@ -70,10 +20,10 @@ class PlayerActor extends AbstractActor<AnyActorLogic, EventFromLogic<TMachine>>
|
|
|
70
20
|
|
|
71
21
|
## Type Parameters
|
|
72
22
|
|
|
73
|
-
| Type Parameter | Default type | Description
|
|
74
|
-
| ---------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
|
|
75
|
-
| `TLogic` _extends_ [`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic) | - | XState actor logic type
|
|
76
|
-
| `TEvent` _extends_ [`EventObject`](https://www.jsdocs.io/package/xstate#EventObject) | [`EventObject`](https://www.jsdocs.io/package/xstate#EventObject) | Event type
|
|
23
|
+
| Type Parameter | Default type | Description |
|
|
24
|
+
| ---------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------- |
|
|
25
|
+
| `TLogic` _extends_ [`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic) | - | XState actor logic type |
|
|
26
|
+
| `TEvent` _extends_ [`EventObject`](https://www.jsdocs.io/package/xstate#EventObject) | [`EventObject`](https://www.jsdocs.io/package/xstate#EventObject) | Event type constraint (defaults to EventObject) |
|
|
77
27
|
|
|
78
28
|
## Constructors
|
|
79
29
|
|
|
@@ -83,6 +33,8 @@ class PlayerActor extends AbstractActor<AnyActorLogic, EventFromLogic<TMachine>>
|
|
|
83
33
|
new AbstractActor<TLogic, TEvent>(logic, options?): AbstractActor<TLogic, TEvent>;
|
|
84
34
|
```
|
|
85
35
|
|
|
36
|
+
Defined in: `xstate`
|
|
37
|
+
|
|
86
38
|
Creates a new actor instance for the given logic with the provided options,
|
|
87
39
|
if any.
|
|
88
40
|
|
|
@@ -105,19 +57,19 @@ Actor<TLogic>.constructor
|
|
|
105
57
|
|
|
106
58
|
## Properties
|
|
107
59
|
|
|
108
|
-
| Property | Modifier | Type | Description
|
|
109
|
-
| ------------------------------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
110
|
-
| <a id="property-_parent"></a> `_parent?` | `public` | [`AnyActorRef`](https://www.jsdocs.io/package/xstate#AnyActorRef) | -
|
|
111
|
-
| <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.
|
|
112
|
-
| <a id="property-id"></a> `id` | `public` | `string` | The unique identifier for this actor relative to its parent.
|
|
113
|
-
| <a id="property-logic"></a> `logic` | `public` | `TLogic` | -
|
|
114
|
-
| <a id="property-options"></a> `options` | `public` | `Readonly`\<[`ActorOptions`](https://www.jsdocs.io/package/xstate#ActorOptions)\<`TLogic`\>\> | -
|
|
115
|
-
| <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`\>\> | -
|
|
116
|
-
| <a id="property-sessionid"></a> `sessionId` | `public` | `string` | The globally unique process ID for this invocation.
|
|
117
|
-
| <a id="property-src"></a> `src` | `public` | \| `string` \| [`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic) | -
|
|
118
|
-
| <a id="property-state"></a> `state` | `abstract` | [`State`](../../play-signals/namespaces/Signal/classes/State.md)\<`unknown`\> | Reactive snapshot of current actor state.
|
|
119
|
-
| <a id="property-system"></a> `system` | `public` | [`AnyActorSystem`](https://www.jsdocs.io/package/xstate#AnyActorSystem) | The system to which this actor belongs.
|
|
120
|
-
| <a id="property-systemid"></a> `systemId` | `public` | `string` \| `undefined` | -
|
|
60
|
+
| Property | Modifier | Type | Description | Inherited from | Defined in |
|
|
61
|
+
| ------------------------------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
62
|
+
| <a id="property-_parent"></a> `_parent?` | `public` | [`AnyActorRef`](https://www.jsdocs.io/package/xstate#AnyActorRef) | - | `Actor._parent` | - |
|
|
63
|
+
| <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` | - |
|
|
64
|
+
| <a id="property-id"></a> `id` | `public` | `string` | The unique identifier for this actor relative to its parent. | `Actor.id` | - |
|
|
65
|
+
| <a id="property-logic"></a> `logic` | `public` | `TLogic` | - | `Actor.logic` | - |
|
|
66
|
+
| <a id="property-options"></a> `options` | `public` | `Readonly`\<[`ActorOptions`](https://www.jsdocs.io/package/xstate#ActorOptions)\<`TLogic`\>\> | - | `Actor.options` | - |
|
|
67
|
+
| <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` | - |
|
|
68
|
+
| <a id="property-sessionid"></a> `sessionId` | `public` | `string` | The globally unique process ID for this invocation. | `Actor.sessionId` | - |
|
|
69
|
+
| <a id="property-src"></a> `src` | `public` | \| `string` \| [`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic) | - | `Actor.src` | - |
|
|
70
|
+
| <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) |
|
|
71
|
+
| <a id="property-system"></a> `system` | `public` | [`AnyActorSystem`](https://www.jsdocs.io/package/xstate#AnyActorSystem) | The system to which this actor belongs. | `Actor.system` | - |
|
|
72
|
+
| <a id="property-systemid"></a> `systemId` | `public` | `string` \| `undefined` | - | `Actor.systemId` | - |
|
|
121
73
|
|
|
122
74
|
## Methods
|
|
123
75
|
|
|
@@ -127,6 +79,8 @@ Actor<TLogic>.constructor
|
|
|
127
79
|
observable: InteropSubscribable<SnapshotFrom<TLogic>>;
|
|
128
80
|
```
|
|
129
81
|
|
|
82
|
+
Defined in: `xstate`
|
|
83
|
+
|
|
130
84
|
#### Returns
|
|
131
85
|
|
|
132
86
|
[`InteropSubscribable`](https://www.jsdocs.io/package/xstate#InteropSubscribable)\<[`SnapshotFrom`](https://www.jsdocs.io/package/xstate#SnapshotFrom)\<`TLogic`\>\>
|
|
@@ -145,6 +99,8 @@ Actor.[observable]
|
|
|
145
99
|
getPersistedSnapshot(): Snapshot<unknown>;
|
|
146
100
|
```
|
|
147
101
|
|
|
102
|
+
Defined in: `xstate`
|
|
103
|
+
|
|
148
104
|
Obtain the internal state of the actor, which can be persisted.
|
|
149
105
|
|
|
150
106
|
#### Returns
|
|
@@ -179,6 +135,8 @@ Actor.getPersistedSnapshot;
|
|
|
179
135
|
getSnapshot(): SnapshotFrom<TLogic>;
|
|
180
136
|
```
|
|
181
137
|
|
|
138
|
+
Defined in: `xstate`
|
|
139
|
+
|
|
182
140
|
Read an actor’s snapshot synchronously.
|
|
183
141
|
|
|
184
142
|
#### Returns
|
|
@@ -214,6 +172,8 @@ Actor.getSnapshot;
|
|
|
214
172
|
on<TType>(type, handler): Subscription;
|
|
215
173
|
```
|
|
216
174
|
|
|
175
|
+
Defined in: `xstate`
|
|
176
|
+
|
|
217
177
|
#### Type Parameters
|
|
218
178
|
|
|
219
179
|
| Type Parameter |
|
|
@@ -245,6 +205,8 @@ Actor.on;
|
|
|
245
205
|
select<TSelected>(selector, equalityFn?): Readable<TSelected>;
|
|
246
206
|
```
|
|
247
207
|
|
|
208
|
+
Defined in: `xstate`
|
|
209
|
+
|
|
248
210
|
#### Type Parameters
|
|
249
211
|
|
|
250
212
|
| Type Parameter |
|
|
@@ -276,37 +238,22 @@ Actor.select;
|
|
|
276
238
|
abstract send(event): void;
|
|
277
239
|
```
|
|
278
240
|
|
|
279
|
-
Defined in: [packages/play-actor/src/abstract-actor.ts:
|
|
241
|
+
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)
|
|
280
242
|
|
|
281
|
-
Send event to Actor
|
|
243
|
+
Send event to Actor.
|
|
282
244
|
|
|
283
|
-
|
|
284
|
-
as events to the Actor. The Actor's state machine guards determine whether
|
|
285
|
-
each event is valid from the current state.
|
|
245
|
+
Constrained to TEvent for type safety in concrete implementations.
|
|
286
246
|
|
|
287
247
|
#### Parameters
|
|
288
248
|
|
|
289
|
-
| Parameter | Type |
|
|
290
|
-
| --------- | -------- |
|
|
291
|
-
| `event` | `TEvent` |
|
|
249
|
+
| Parameter | Type |
|
|
250
|
+
| --------- | -------- |
|
|
251
|
+
| `event` | `TEvent` |
|
|
292
252
|
|
|
293
253
|
#### Returns
|
|
294
254
|
|
|
295
255
|
`void`
|
|
296
256
|
|
|
297
|
-
#### Example
|
|
298
|
-
|
|
299
|
-
```typescript
|
|
300
|
-
// Infrastructure forwards user intent
|
|
301
|
-
actor.send({ type: "auth.login", userId: "123" });
|
|
302
|
-
// Actor's guards determine if event is allowed
|
|
303
|
-
```
|
|
304
|
-
|
|
305
|
-
#### Remarks
|
|
306
|
-
|
|
307
|
-
Accepts any event object with a type property. Core events (PlayEvent) are in
|
|
308
|
-
@xmachines/play, routing events (PlayRouteEvent) are in @xmachines/play-router.
|
|
309
|
-
|
|
310
257
|
#### Overrides
|
|
311
258
|
|
|
312
259
|
```ts
|
|
@@ -321,6 +268,8 @@ Actor.send;
|
|
|
321
268
|
start(): this;
|
|
322
269
|
```
|
|
323
270
|
|
|
271
|
+
Defined in: `xstate`
|
|
272
|
+
|
|
324
273
|
Starts the Actor from the initial state
|
|
325
274
|
|
|
326
275
|
#### Returns
|
|
@@ -341,6 +290,8 @@ Actor.start;
|
|
|
341
290
|
stop(): this;
|
|
342
291
|
```
|
|
343
292
|
|
|
293
|
+
Defined in: `xstate`
|
|
294
|
+
|
|
344
295
|
Stops the Actor and unsubscribe all listeners.
|
|
345
296
|
|
|
346
297
|
#### Returns
|
|
@@ -363,6 +314,8 @@ Actor.stop;
|
|
|
363
314
|
subscribe(observer): Subscription;
|
|
364
315
|
```
|
|
365
316
|
|
|
317
|
+
Defined in: `xstate`
|
|
318
|
+
|
|
366
319
|
Subscribe an observer to an actor’s snapshot values.
|
|
367
320
|
|
|
368
321
|
##### Parameters
|
|
@@ -439,6 +392,8 @@ subscribe(
|
|
|
439
392
|
completeListener?): Subscription;
|
|
440
393
|
```
|
|
441
394
|
|
|
395
|
+
Defined in: `xstate`
|
|
396
|
+
|
|
442
397
|
Subscribe an observer to an actor’s snapshot values.
|
|
443
398
|
|
|
444
399
|
##### Parameters
|
|
@@ -516,6 +471,8 @@ Actor.subscribe;
|
|
|
516
471
|
toJSON(): object;
|
|
517
472
|
```
|
|
518
473
|
|
|
474
|
+
Defined in: `xstate`
|
|
475
|
+
|
|
519
476
|
#### Returns
|
|
520
477
|
|
|
521
478
|
`object`
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
[Documentation](../../../README.md) / [@xmachines/play-actor](../README.md) / typedSpec
|
|
2
|
+
|
|
3
|
+
# Function: typedSpec()
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
function typedSpec<TContext>(spec): PlaySpec;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [packages/play-actor/src/abstract-actor.ts:86](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-actor/src/abstract-actor.ts#L86)
|
|
10
|
+
|
|
11
|
+
Identity helper that constrains a `PlaySpec` object's `contextProps` to keys
|
|
12
|
+
of a specific machine context type, giving compile-time validation and IDE
|
|
13
|
+
autocomplete at the definition site.
|
|
14
|
+
|
|
15
|
+
XState's `meta` field is typed as `Record<string, unknown>`, so TypeScript
|
|
16
|
+
cannot infer the constraint from context. `typedSpec<MyCtx>(...)` is the
|
|
17
|
+
opt-in mechanism that activates enforcement where the spec is written.
|
|
18
|
+
|
|
19
|
+
At runtime this is a no-op — the spec object is returned unchanged.
|
|
20
|
+
|
|
21
|
+
## Type Parameters
|
|
22
|
+
|
|
23
|
+
| Type Parameter |
|
|
24
|
+
| ----------------------------- |
|
|
25
|
+
| `TContext` _extends_ `object` |
|
|
26
|
+
|
|
27
|
+
## Parameters
|
|
28
|
+
|
|
29
|
+
| Parameter | Type |
|
|
30
|
+
| --------- | ------------------------------------------------------------------------------ |
|
|
31
|
+
| `spec` | `Omit`\<[`PlaySpec`](../interfaces/PlaySpec.md), `"contextProps"`\> & `object` |
|
|
32
|
+
|
|
33
|
+
## Returns
|
|
34
|
+
|
|
35
|
+
[`PlaySpec`](../interfaces/PlaySpec.md)
|
|
36
|
+
|
|
37
|
+
## Example
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
interface DashboardCtx {
|
|
41
|
+
username: string;
|
|
42
|
+
params: Record<string, string>;
|
|
43
|
+
query: Record<string, string>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
meta: {
|
|
47
|
+
view: {
|
|
48
|
+
component: "Dashboard",
|
|
49
|
+
spec: typedSpec<DashboardCtx>({
|
|
50
|
+
root: "root",
|
|
51
|
+
contextProps: ["username"], // ✓ key of DashboardCtx
|
|
52
|
+
// contextProps: ["usernaem"], // ✗ compile error
|
|
53
|
+
elements: { root: { type: "Dashboard", props: {}, children: [] } },
|
|
54
|
+
}),
|
|
55
|
+
},
|
|
56
|
+
}
|
|
57
|
+
```
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: PlaySpec
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-actor/src/abstract-actor.ts:
|
|
5
|
+
Defined in: [packages/play-actor/src/abstract-actor.ts:43](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-actor/src/abstract-actor.ts#L43)
|
|
6
6
|
|
|
7
7
|
XMachines extension of `@json-render/core` `Spec`.
|
|
8
8
|
|
|
@@ -11,17 +11,8 @@ Adds `contextProps` — an explicit allowlist of machine context fields that
|
|
|
11
11
|
fields named here are ever exposed to components; nothing leaks from context
|
|
12
12
|
without an opt-in declaration.
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
```ts
|
|
17
|
-
spec: {
|
|
18
|
-
root: "root",
|
|
19
|
-
contextProps: ["username"], // expose context.username as a prop slot
|
|
20
|
-
elements: {
|
|
21
|
-
root: { type: "Dashboard", props: { username: undefined }, children: [] },
|
|
22
|
-
},
|
|
23
|
-
}
|
|
24
|
-
```
|
|
14
|
+
Use `typedSpec<TContext>(...)` at the definition site to validate `contextProps`
|
|
15
|
+
entries against your machine's context type at compile time.
|
|
25
16
|
|
|
26
17
|
## Extends
|
|
27
18
|
|
|
@@ -29,9 +20,9 @@ spec: {
|
|
|
29
20
|
|
|
30
21
|
## Properties
|
|
31
22
|
|
|
32
|
-
| Property | Type | Description
|
|
33
|
-
| -------------------------------------------------- | --------------------------------- |
|
|
34
|
-
| <a id="property-contextprops"></a> `contextProps?` | `string`[]
|
|
35
|
-
| <a id="property-elements"></a> `elements` | `Record`\<`string`, `UIElement`\> | Flat map of elements by key
|
|
36
|
-
| <a id="property-root"></a> `root` | `string` | Root element key
|
|
37
|
-
| <a id="property-state"></a> `state?` | `Record`\<`string`, `unknown`\> | Optional initial state to seed the state model. Components using statePath will read from / write to this state.
|
|
23
|
+
| Property | Modifier | Type | Description | Inherited from | Defined in |
|
|
24
|
+
| -------------------------------------------------- | ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
25
|
+
| <a id="property-contextprops"></a> `contextProps?` | `readonly` | readonly `string`[] | Explicit allowlist of machine context field names to expose as prop slots. Each named field is merged into every spec element's `props` at view derivation time, filling any slot whose current value is `undefined`. Use `typedSpec<TContext>(...)` to constrain entries to `keyof TContext & string`. | - | [packages/play-actor/src/abstract-actor.ts:51](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-actor/src/abstract-actor.ts#L51) |
|
|
26
|
+
| <a id="property-elements"></a> `elements` | `public` | `Record`\<`string`, `UIElement`\> | Flat map of elements by key | `Spec.elements` | - |
|
|
27
|
+
| <a id="property-root"></a> `root` | `public` | `string` | Root element key | `Spec.root` | - |
|
|
28
|
+
| <a id="property-state"></a> `state?` | `public` | `Record`\<`string`, `unknown`\> | Optional initial state to seed the state model. Components using statePath will read from / write to this state. | `Spec.state` | - |
|
|
@@ -2,29 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: Routable
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-actor/src/abstract-actor.ts:
|
|
5
|
+
Defined in: [packages/play-actor/src/abstract-actor.ts:27](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-actor/src/abstract-actor.ts#L27)
|
|
6
6
|
|
|
7
7
|
Optional capability: Routing support
|
|
8
8
|
|
|
9
|
-
Actors implementing this interface can derive a route from their state.
|
|
10
|
-
Router adapters observe the currentRoute signal to sync browser URLs.
|
|
11
|
-
|
|
12
|
-
## Example
|
|
13
|
-
|
|
14
|
-
```typescript
|
|
15
|
-
class MyActor extends AbstractActor implements Routable {
|
|
16
|
-
currentRoute = new Signal.Computed(() => deriveRoute(this.state.get()));
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// Router requires Routable
|
|
20
|
-
function connectRouter<T extends AbstractActor & Routable>(actor: T) {
|
|
21
|
-
watcher.watch(actor.currentRoute);
|
|
22
|
-
}
|
|
23
|
-
```
|
|
24
|
-
|
|
25
9
|
## Properties
|
|
26
10
|
|
|
27
|
-
| Property | Modifier | Type |
|
|
28
|
-
| ------------------------------------------------- | ---------- | -------------------------------------------------------------------------------------------- |
|
|
29
|
-
| <a id="property-currentroute"></a> `currentRoute` | `readonly` | [`Computed`](../../play-signals/namespaces/Signal/classes/Computed.md)\<`string` \| `null`\> |
|
|
30
|
-
| <a id="property-initialroute"></a> `initialRoute` | `readonly` | `string` \| `null` |
|
|
11
|
+
| Property | Modifier | Type | Defined in |
|
|
12
|
+
| ------------------------------------------------- | ---------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
13
|
+
| <a id="property-currentroute"></a> `currentRoute` | `readonly` | [`Computed`](../../play-signals/namespaces/Signal/classes/Computed.md)\<`string` \| `null`\> | [packages/play-actor/src/abstract-actor.ts:28](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-actor/src/abstract-actor.ts#L28) |
|
|
14
|
+
| <a id="property-initialroute"></a> `initialRoute` | `readonly` | `string` \| `null` | [packages/play-actor/src/abstract-actor.ts:29](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-actor/src/abstract-actor.ts#L29) |
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: ViewMetadata
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-actor/src/abstract-actor.ts:
|
|
5
|
+
Defined in: [packages/play-actor/src/abstract-actor.ts:100](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-actor/src/abstract-actor.ts#L100)
|
|
6
6
|
|
|
7
|
-
View metadata for rendering
|
|
7
|
+
View metadata for rendering.
|
|
8
8
|
|
|
9
9
|
Describes the component to be rendered and the json-render Spec to use.
|
|
10
10
|
Used by PlayRenderer to dynamically render UI based on actor state.
|
|
11
11
|
|
|
12
12
|
## Properties
|
|
13
13
|
|
|
14
|
-
| Property | Type | Description
|
|
15
|
-
| ------------------------------------------- | ------------------------- |
|
|
16
|
-
| <a id="property-component"></a> `component` | `string` | Root element type name (for diagnostics and component resolution)
|
|
17
|
-
| <a id="property-spec"></a> `spec` | [`PlaySpec`](PlaySpec.md) | XMachines view spec — extends `@json-render/core` Spec with `contextProps` for explicit context field exposure. | [packages/play-actor/src/abstract-actor.ts:
|
|
14
|
+
| Property | Type | Description | Defined in |
|
|
15
|
+
| ------------------------------------------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
16
|
+
| <a id="property-component"></a> `component` | `string` | Root element type name (for diagnostics and component resolution) | [packages/play-actor/src/abstract-actor.ts:102](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-actor/src/abstract-actor.ts#L102) |
|
|
17
|
+
| <a id="property-spec"></a> `spec` | [`PlaySpec`](PlaySpec.md) | XMachines view spec — extends `@json-render/core` Spec with `contextProps` for explicit context field exposure. Use `typedSpec<TContext>(...)` at the definition site to validate `contextProps` entries against the machine context type. | [packages/play-actor/src/abstract-actor.ts:110](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-actor/src/abstract-actor.ts#L110) |
|
|
@@ -2,18 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: Viewable
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-actor/src/abstract-actor.ts:
|
|
5
|
+
Defined in: [packages/play-actor/src/abstract-actor.ts:121](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-actor/src/abstract-actor.ts#L121)
|
|
6
6
|
|
|
7
7
|
Actor capability for exposing renderable view state.
|
|
8
8
|
|
|
9
9
|
`Viewable` marks actors that publish a `currentView` signal.
|
|
10
10
|
Renderers such as `PlayRenderer` consume this contract to resolve the
|
|
11
11
|
current view description into concrete UI without embedding view logic inside the
|
|
12
|
-
framework adapter.
|
|
13
|
-
passed to PlayRenderer, not stored on the actor.
|
|
12
|
+
framework adapter.
|
|
14
13
|
|
|
15
14
|
## Properties
|
|
16
15
|
|
|
17
|
-
| Property | Modifier | Type | Description
|
|
18
|
-
| ----------------------------------------------- | ---------- | --------------------------------------------------------------------------------------------------------------- |
|
|
19
|
-
| <a id="property-currentview"></a> `currentView` | `readonly` | [`State`](../../play-signals/namespaces/Signal/classes/State.md)\<[`ViewMetadata`](ViewMetadata.md) \| `null`\> | Current view signal State signal containing view.component and view.spec from meta.view. Infrastructure renders view
|
|
16
|
+
| Property | Modifier | Type | Description | Defined in |
|
|
17
|
+
| ----------------------------------------------- | ---------- | --------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
18
|
+
| <a id="property-currentview"></a> `currentView` | `readonly` | [`State`](../../play-signals/namespaces/Signal/classes/State.md)\<[`ViewMetadata`](ViewMetadata.md) \| `null`\> | Current view signal. State signal containing view.component and view.spec from meta.view. Infrastructure renders view — Logic-Driven UI invariant. | [packages/play-actor/src/abstract-actor.ts:128](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-actor/src/abstract-actor.ts#L128) |
|