@xmachines/docs 1.0.0 → 1.1.0
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/README.md +1 -3
- package/api/@xmachines/play/README.md +1 -3
- package/api/@xmachines/play/classes/NonNullableError.md +4 -4
- package/api/@xmachines/play/classes/PlayError.md +4 -4
- package/api/@xmachines/play/functions/assertNonNullable.md +1 -1
- package/api/@xmachines/play/type-aliases/PlayEvent.md +2 -2
- package/api/@xmachines/play-actor/README.md +22 -10
- package/api/@xmachines/play-actor/classes/AbstractActor.md +19 -3
- package/api/@xmachines/play-actor/functions/attachRenderErrorHandler.md +1 -1
- package/api/@xmachines/play-actor/functions/toAtomState.md +1 -1
- package/api/@xmachines/play-actor/functions/typedSpec.md +1 -1
- package/api/@xmachines/play-actor/interfaces/BaseActorProviderProps.md +5 -5
- package/api/@xmachines/play-actor/interfaces/BaseViewContextValue.md +5 -5
- package/api/@xmachines/play-actor/interfaces/PlaySpec.md +2 -2
- package/api/@xmachines/play-actor/interfaces/Routable.md +3 -3
- package/api/@xmachines/play-actor/interfaces/Viewable.md +2 -2
- package/api/@xmachines/play-dom/README.md +3 -2
- package/api/@xmachines/play-dom/classes/PlayRenderer.md +4 -4
- package/api/@xmachines/play-dom/functions/createPlayUI.md +1 -1
- package/api/@xmachines/play-dom/functions/createRenderer.md +1 -1
- package/api/@xmachines/play-dom/interfaces/CreatePlayUIOptions.md +2 -2
- package/api/@xmachines/play-dom/interfaces/MountOptions.md +3 -3
- package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +4 -4
- package/api/@xmachines/play-dom/type-aliases/MountFn.md +1 -1
- package/api/@xmachines/play-dom-router/README.md +3 -2
- package/api/@xmachines/play-dom-router/functions/connectRouter.md +1 -1
- package/api/@xmachines/play-dom-router/functions/createBrowserHistory.md +1 -1
- package/api/@xmachines/play-dom-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-dom-router/functions/createRouter.md +1 -1
- package/api/@xmachines/play-dom-router/interfaces/BrowserHistory.md +14 -14
- package/api/@xmachines/play-dom-router/interfaces/BrowserWindow.md +14 -14
- package/api/@xmachines/play-dom-router/interfaces/ConnectRouterOptions.md +4 -4
- package/api/@xmachines/play-dom-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-dom-router/interfaces/RoutableActor.md +4 -4
- package/api/@xmachines/play-dom-router/interfaces/RouteLookupContract.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/RouteMap.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-dom-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/VanillaRouter.md +4 -4
- package/api/@xmachines/play-react/README.md +3 -2
- package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +5 -5
- package/api/@xmachines/play-react/functions/useActor.md +1 -1
- package/api/@xmachines/play-react/functions/usePlayView.md +1 -1
- package/api/@xmachines/play-react/functions/useSignalEffect.md +1 -1
- package/api/@xmachines/play-react/interfaces/ActorProviderProps.md +8 -8
- 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/PlayUIProviderProps.md +8 -8
- package/api/@xmachines/play-react/interfaces/ViewContextValue.md +5 -5
- package/api/@xmachines/play-react/type-aliases/AnyPlayActor.md +1 -1
- package/api/@xmachines/play-react/variables/ActorProvider.md +1 -1
- package/api/@xmachines/play-react/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-react/variables/PlayUIProvider.md +1 -1
- package/api/@xmachines/play-react-router/README.md +1 -2
- package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +4 -4
- package/api/@xmachines/play-react-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-react-router/functions/createPlayRouterProvider.md +1 -1
- package/api/@xmachines/play-react-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +1 -1
- package/api/@xmachines/play-react-router/interfaces/PlayActor.md +5 -5
- package/api/@xmachines/play-react-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderBaseProps.md +5 -5
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +5 -5
- package/api/@xmachines/play-react-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-react-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-react-router/type-aliases/PlayRouterBridgeConstructor.md +1 -1
- package/api/@xmachines/play-react-router/variables/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-router/README.md +3 -2
- package/api/@xmachines/play-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-router/classes/RouterBridgeBase.md +4 -4
- 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/createRouteMapFromTree.md +1 -1
- package/api/@xmachines/play-router/functions/detectDuplicateRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/extractMachineRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/extractQuery.md +1 -1
- package/api/@xmachines/play-router/functions/extractRouteParams.md +1 -1
- package/api/@xmachines/play-router/functions/findRouteById.md +1 -1
- package/api/@xmachines/play-router/functions/findRouteByPath.md +1 -1
- package/api/@xmachines/play-router/functions/getNavigableRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/getRoutableRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/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 +3 -3
- 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/PlayActor.md +5 -5
- package/api/@xmachines/play-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-router/interfaces/ResolvedRoutePath.md +3 -3
- package/api/@xmachines/play-router/interfaces/RoutableActor.md +4 -4
- package/api/@xmachines/play-router/interfaces/RouteInfo.md +8 -8
- package/api/@xmachines/play-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-router/interfaces/RouteMatch.md +3 -3
- package/api/@xmachines/play-router/interfaces/RouteNode.md +10 -10
- package/api/@xmachines/play-router/interfaces/RouteObject.md +2 -2
- package/api/@xmachines/play-router/interfaces/RouteTree.md +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 +3 -3
- 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/README.md +3 -2
- 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/type-aliases/WatcherNotify.md +1 -1
- package/api/@xmachines/play-solid/README.md +3 -2
- package/api/@xmachines/play-solid/functions/useActor.md +1 -1
- package/api/@xmachines/play-solid/functions/usePlayView.md +1 -1
- package/api/@xmachines/play-solid/interfaces/ActorProviderProps.md +8 -8
- package/api/@xmachines/play-solid/interfaces/PlayUIProviderProps.md +8 -8
- package/api/@xmachines/play-solid/interfaces/ViewContextValue.md +5 -5
- package/api/@xmachines/play-solid/type-aliases/AnyPlayActor.md +1 -1
- package/api/@xmachines/play-solid/variables/ActorContext.md +1 -1
- package/api/@xmachines/play-solid/variables/ActorProvider.md +1 -1
- package/api/@xmachines/play-solid/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-solid/variables/PlayUIProvider.md +1 -1
- package/api/@xmachines/play-solid-router/README.md +3 -2
- package/api/@xmachines/play-solid-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +5 -5
- package/api/@xmachines/play-solid-router/functions/createPlayRouterProvider.md +1 -1
- package/api/@xmachines/play-solid-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-solid-router/interfaces/AbstractActor.md +19 -3
- package/api/@xmachines/play-solid-router/interfaces/PlayActor.md +5 -5
- package/api/@xmachines/play-solid-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderBaseProps.md +5 -5
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +5 -5
- package/api/@xmachines/play-solid-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-solid-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-solid-router/type-aliases/PlayRouterBridgeConstructor.md +1 -1
- package/api/@xmachines/play-solid-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +4 -4
- package/api/@xmachines/play-solid-router/variables/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-svelte/README.md +3 -2
- package/api/@xmachines/play-svelte/functions/defineRegistry.md +1 -1
- package/api/@xmachines/play-svelte/functions/getActorContext.md +1 -1
- package/api/@xmachines/play-svelte/functions/getPlayViewContext.md +1 -1
- package/api/@xmachines/play-svelte/functions/setActorContext.md +1 -1
- package/api/@xmachines/play-svelte/interfaces/ActorProviderProps.md +8 -8
- package/api/@xmachines/play-svelte/interfaces/DefineRegistryOptions.md +4 -4
- package/api/@xmachines/play-svelte/interfaces/PlayUIProviderProps.md +11 -11
- package/api/@xmachines/play-svelte/interfaces/ViewContextValue.md +5 -5
- package/api/@xmachines/play-svelte/type-aliases/AnyPlayActor.md +1 -1
- package/api/@xmachines/play-svelte-spa-router/README.md +1 -3
- package/api/@xmachines/play-svelte-spa-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-svelte-spa-router/functions/connectRouter.md +1 -1
- package/api/@xmachines/play-svelte-spa-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-svelte-spa-router/interfaces/ConnectRouterOptions.md +4 -4
- package/api/@xmachines/play-svelte-spa-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-svelte-spa-router/interfaces/WindowLike.md +3 -3
- package/api/@xmachines/play-svelte-spa-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-sveltekit-router/README.md +3 -2
- package/api/@xmachines/play-sveltekit-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-sveltekit-router/functions/connectRouter.md +1 -1
- package/api/@xmachines/play-sveltekit-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-sveltekit-router/interfaces/ConnectRouterOptions.md +4 -4
- package/api/@xmachines/play-sveltekit-router/interfaces/LocationLike.md +3 -3
- package/api/@xmachines/play-sveltekit-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapping.md +3 -3
- 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 +3 -2
- package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +4 -4
- package/api/@xmachines/play-tanstack-react-router/functions/createPlayRouterProvider.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMapFromTree.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/functions/extractMachineRoutes.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayActor.md +5 -5
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderBaseProps.md +5 -5
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +5 -5
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteNavigateEvent.md +3 -3
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-tanstack-react-router/type-aliases/PlayRouterBridgeConstructor.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterInstance.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterLike.md +4 -4
- package/api/@xmachines/play-tanstack-react-router/variables/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-tanstack-router/README.md +3 -0
- package/api/@xmachines/play-tanstack-router/classes/TanStackRouterBridgeBase.md +2 -2
- package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouteMapLike.md +3 -3
- package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouterLike.md +4 -4
- package/api/@xmachines/play-tanstack-solid-router/README.md +3 -2
- package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-tanstack-solid-router/classes/TanStackSolidRouterBridge.md +5 -5
- package/api/@xmachines/play-tanstack-solid-router/functions/createPlayRouterProvider.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayActor.md +5 -5
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderBaseProps.md +5 -5
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +5 -5
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/PlayRouterBridgeConstructor.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterInstance.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterLike.md +4 -4
- package/api/@xmachines/play-tanstack-solid-router/variables/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-vue/README.md +2 -4
- package/api/@xmachines/play-vue/functions/defineRegistry.md +1 -1
- package/api/@xmachines/play-vue/functions/getPlayViewContext.md +1 -1
- package/api/@xmachines/play-vue/functions/useActor.md +1 -1
- package/api/@xmachines/play-vue/interfaces/ActorProviderProps.md +5 -5
- package/api/@xmachines/play-vue/interfaces/PlayUIProviderProps.md +8 -8
- package/api/@xmachines/play-vue/interfaces/ViewContextValue.md +5 -5
- package/api/@xmachines/play-vue/interfaces/VisibilityProviderProps.md +1 -1
- package/api/@xmachines/play-vue/type-aliases/AnyPlayActor.md +1 -1
- package/api/@xmachines/play-vue/type-aliases/ComponentEntry.md +1 -1
- 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/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-vue-router/README.md +3 -2
- package/api/@xmachines/play-vue-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-vue-router/classes/VueRouterBridge.md +5 -5
- package/api/@xmachines/play-vue-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-vue-router/interfaces/PlayActor.md +5 -5
- package/api/@xmachines/play-vue-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-vue-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-vue-router/interfaces/RouteMapping.md +3 -3
- 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 +41 -23
- package/api/@xmachines/play-xstate/classes/PlayerActor.md +77 -53
- package/api/@xmachines/play-xstate/functions/buildRouteUrl.md +5 -12
- package/api/@xmachines/play-xstate/functions/composeGuards.md +7 -2
- package/api/@xmachines/play-xstate/functions/composeGuardsOr.md +7 -2
- package/api/@xmachines/play-xstate/functions/contextFieldMatches.md +7 -2
- 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 +7 -2
- package/api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md +1 -1
- package/api/@xmachines/play-xstate/functions/hasContext.md +7 -4
- package/api/@xmachines/play-xstate/functions/isAbsoluteRoute.md +1 -1
- package/api/@xmachines/play-xstate/functions/negateGuard.md +7 -2
- package/api/@xmachines/play-xstate/interfaces/PlayerConfig.md +3 -3
- package/api/@xmachines/play-xstate/interfaces/PlayerFactoryResumeOptions.md +4 -4
- package/api/@xmachines/play-xstate/interfaces/PlayerOptions.md +10 -11
- package/api/@xmachines/play-xstate/interfaces/RouteContext.md +5 -5
- package/api/@xmachines/play-xstate/interfaces/RouteObject.md +2 -2
- package/api/@xmachines/play-xstate/type-aliases/ComposedGuard.md +7 -2
- package/api/@xmachines/play-xstate/type-aliases/Guard.md +7 -5
- package/api/@xmachines/play-xstate/type-aliases/GuardArray.md +7 -5
- package/api/@xmachines/play-xstate/type-aliases/PlayerFactory.md +11 -15
- package/api/@xmachines/play-xstate/type-aliases/RouteMachineConfig.md +4 -4
- package/api/@xmachines/play-xstate/type-aliases/RouteMetadata.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/RouteStateNode.md +4 -4
- package/api/@xmachines/shared/README.md +2 -2
- package/api/@xmachines/shared/vite-aliases/functions/xmAliases.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmCacheDir.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmOptimizeDeps.md +12 -7
- package/api/@xmachines/shared/vite-aliases/functions/xmResolve.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmSvelteRunes.md +2 -2
- package/api/@xmachines/shared/vitest/functions/defineXmBrowserConfig.md +1 -1
- package/api/@xmachines/shared/vitest/functions/defineXmVitestConfig.md +1 -1
- package/api/@xmachines/shared/vitest/interfaces/XmBrowserConfigOptions.md +4 -4
- package/contributing/architecture.md +18 -16
- package/contributing/configuration.md +10 -10
- package/contributing/deployment.md +49 -28
- package/contributing/development.md +56 -17
- package/contributing/testing.md +12 -4
- package/examples/@xmachines/play-dom-demo/README.md +2 -2
- package/examples/@xmachines/play-dom-demo/functions/createNavBar.md +1 -1
- package/examples/@xmachines/play-dom-demo/functions/initShell.md +7 -6
- package/examples/@xmachines/play-dom-demo/type-aliases/AuthCatalog.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/About.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Contact.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Dashboard.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Home.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Login.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/NavBarView.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Navigation.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Overview.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Profile.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Settings.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Stats.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/authCatalog.md +1 -1
- package/examples/@xmachines/play-dom-router-demo/README.md +2 -2
- package/examples/@xmachines/play-react-demo/README.md +2 -2
- package/examples/@xmachines/play-react-demo/functions/App.md +1 -1
- package/examples/@xmachines/play-react-demo/type-aliases/AuthCatalog.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/About.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Contact.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Dashboard.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/DebugPanel.md +3 -2
- package/examples/@xmachines/play-react-demo/variables/Home.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Login.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/NavBar.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/NavBarView.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Navigation.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Overview.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Profile.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Settings.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Shell.md +2 -1
- package/examples/@xmachines/play-react-demo/variables/Stats.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/authCatalog.md +1 -1
- package/examples/@xmachines/play-react-router-demo/README.md +2 -2
- package/examples/@xmachines/play-solid-demo/README.md +2 -2
- package/examples/@xmachines/play-solid-demo/functions/App.md +1 -1
- package/examples/@xmachines/play-solid-demo/type-aliases/AuthCatalog.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/About.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Contact.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Dashboard.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/DebugPanel.md +4 -2
- package/examples/@xmachines/play-solid-demo/variables/Home.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Login.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/NavBar.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/NavBarView.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Navigation.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Overview.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Profile.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Settings.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Shell.md +2 -1
- package/examples/@xmachines/play-solid-demo/variables/Stats.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/authCatalog.md +1 -1
- package/examples/@xmachines/play-solid-router-demo/README.md +2 -2
- package/examples/@xmachines/play-svelte-demo/README.md +2 -2
- package/examples/@xmachines/play-svelte-demo/type-aliases/AuthCatalog.md +1 -1
- package/examples/@xmachines/play-svelte-demo/variables/authCatalog.md +1 -1
- package/examples/@xmachines/play-svelte-spa-router-demo/README.md +2 -2
- package/examples/@xmachines/play-sveltekit-router-demo/README.md +2 -2
- package/examples/@xmachines/play-tanstack-react-router-demo/README.md +2 -2
- package/examples/@xmachines/play-tanstack-solid-router-demo/README.md +2 -2
- package/examples/@xmachines/play-vue-demo/README.md +2 -2
- package/examples/@xmachines/play-vue-demo/type-aliases/AuthCatalog.md +1 -1
- package/examples/@xmachines/play-vue-demo/variables/App.md +1 -1
- package/examples/@xmachines/play-vue-demo/variables/authCatalog.md +1 -1
- package/examples/@xmachines/play-vue-router-demo/README.md +2 -2
- package/examples/basic-state-machine.md +0 -2
- package/examples/form-validation.md +0 -2
- package/examples/multi-router-integration.md +0 -2
- package/examples/routing-patterns.md +0 -2
- package/examples/traffic-light.md +0 -2
- package/guides/README.md +0 -2
- package/guides/getting-started.md +19 -11
- package/package.json +9 -6
|
@@ -2,14 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
# Class: PlayerActor\<TMachine\>
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:
|
|
5
|
+
Defined in: [packages/play-xstate/src/player-actor.ts:193](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.1.0/packages/play-xstate/src/player-actor.ts#L193)
|
|
6
6
|
|
|
7
7
|
Concrete XState actor implementing Play Architecture signal protocol
|
|
8
8
|
|
|
9
|
-
Extends [@xmachines/play-actor!AbstractActor](../../play-actor/classes/AbstractActor.md)
|
|
10
|
-
while maintaining ecosystem compatibility (XState
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
Extends [@xmachines/play-actor!AbstractActor](../../play-actor/classes/AbstractActor.md) — and so XState's own `Actor` —
|
|
10
|
+
to provide XState v5 integration while maintaining ecosystem compatibility (XState
|
|
11
|
+
inspection, devtools). The machine is handed to the base constructor, so a
|
|
12
|
+
`PlayerActor` **is** the XState actor rather than a wrapper around one: everything
|
|
13
|
+
XState's `Actor` exposes operates on this instance's own state, and the class adds
|
|
14
|
+
TC39 Signal-based reactive state for Infrastructure observation on top.
|
|
13
15
|
|
|
14
16
|
**Capabilities:** Implements both [@xmachines/play-actor!Routable](../../play-actor/interfaces/Routable.md) and
|
|
15
17
|
[@xmachines/play-actor!Viewable](../../play-actor/interfaces/Viewable.md) interfaces, providing routing and view
|
|
@@ -32,7 +34,14 @@ const machine = setup({}).createMachine({
|
|
|
32
34
|
initial: "idle",
|
|
33
35
|
states: {
|
|
34
36
|
idle: {
|
|
35
|
-
meta: {
|
|
37
|
+
meta: {
|
|
38
|
+
route: "/",
|
|
39
|
+
// A view spec needs `root` and `elements` — other shapes derive null.
|
|
40
|
+
view: {
|
|
41
|
+
root: "home",
|
|
42
|
+
elements: { home: { type: "HomePage", props: {}, children: [] } },
|
|
43
|
+
},
|
|
44
|
+
},
|
|
36
45
|
},
|
|
37
46
|
},
|
|
38
47
|
});
|
|
@@ -43,7 +52,7 @@ actor.start();
|
|
|
43
52
|
|
|
44
53
|
// Observe signals
|
|
45
54
|
console.log(actor.currentRoute.get()); // '/'
|
|
46
|
-
console.log(actor.currentView.get()); //
|
|
55
|
+
console.log(actor.currentView.get()?.root); // 'home'
|
|
47
56
|
```
|
|
48
57
|
|
|
49
58
|
Signal lifecycle with watchers
|
|
@@ -108,16 +117,16 @@ new PlayerActor<TMachine>(
|
|
|
108
117
|
restoredSnapshot?): PlayerActor<TMachine>;
|
|
109
118
|
```
|
|
110
119
|
|
|
111
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:
|
|
120
|
+
Defined in: [packages/play-xstate/src/player-actor.ts:343](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.1.0/packages/play-xstate/src/player-actor.ts#L343)
|
|
112
121
|
|
|
113
122
|
#### Parameters
|
|
114
123
|
|
|
115
|
-
| Parameter | Type
|
|
116
|
-
| ------------------- |
|
|
117
|
-
| `machine` | `TMachine`
|
|
118
|
-
| `options` | [`PlayerOptions`](../interfaces/PlayerOptions.md)\<`TMachine`\>
|
|
119
|
-
| `input?` | [`InputFrom`](https://www.jsdocs.io/package/xstate#InputFrom)\<`TMachine`\>
|
|
120
|
-
| `restoredSnapshot?` | [`
|
|
124
|
+
| Parameter | Type |
|
|
125
|
+
| ------------------- | --------------------------------------------------------------------------- |
|
|
126
|
+
| `machine` | `TMachine` |
|
|
127
|
+
| `options` | [`PlayerOptions`](../interfaces/PlayerOptions.md)\<`TMachine`\> |
|
|
128
|
+
| `input?` | [`InputFrom`](https://www.jsdocs.io/package/xstate#InputFrom)\<`TMachine`\> |
|
|
129
|
+
| `restoredSnapshot?` | [`Snapshot`](https://www.jsdocs.io/package/xstate#Snapshot)\<`unknown`\> |
|
|
121
130
|
|
|
122
131
|
#### Returns
|
|
123
132
|
|
|
@@ -129,22 +138,22 @@ Defined in: [packages/play-xstate/src/player-actor.ts:454](https://gitlab.com/xm
|
|
|
129
138
|
|
|
130
139
|
## Properties
|
|
131
140
|
|
|
132
|
-
| Property | Modifier | Type | Description
|
|
133
|
-
| ------------------------------------------------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------- |
|
|
134
|
-
| <a id="property-_parent"></a> `_parent?` | `public` | [`AnyActorRef`](https://www.jsdocs.io/package/xstate#AnyActorRef) | -
|
|
135
|
-
| <a id="property-clock"></a> `clock` | `public` | [`Clock`](https://www.jsdocs.io/package/xstate#Clock) | The clock that is responsible for setting and clearing timeouts, such as delayed events and transitions.
|
|
136
|
-
| <a id="property-currentroute"></a> `currentRoute` | `public` | [`Computed`](../../play-signals/namespaces/Signal/classes/Computed.md)\<`string` \| `null`\> | A TC39 `Signal.Computed` that derives the current URL path from the active machine state's `meta.route` template and the actor's context. Returns `null` when the current state has no `meta.route`, or when the route template cannot be fully resolved
|
|
137
|
-
| <a id="property-currentview"></a> `currentView` | `
|
|
138
|
-
| <a id="property-id"></a> `id` | `public` | `string` | The unique identifier for this actor relative to its parent.
|
|
139
|
-
| <a id="property-initialroute"></a> `initialRoute` | `readonly` | `string` \| `null` | The route derived from the machine's initial state — fixed at construction, never changes even when the actor is restored from a snapshot. Router bridges compare this against the browser URL to distinguish a deep-link (non-initial URL → router wins) from a restore (initial URL + actor at a different restored route → actor wins). Derived statically from the machine definition via `deriveInitialRoute` (XState's pure `initialTransition` helper): the initial state chain and its `meta.route` templates are fixed at machine definition time, while `:param` substitution uses the machine's real initial context for this actor's `input`. No extra actor is ever created, and a restored snapshot never influences the value — it is always the machine's **default** initial route.
|
|
140
|
-
| <a id="property-logic"></a> `logic` | `public` | [`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic) | -
|
|
141
|
-
| <a id="property-options"></a> `options` | `public` | `Readonly`\<[`ActorOptions`](https://www.jsdocs.io/package/xstate#ActorOptions)\<`TLogic`\>\> | -
|
|
142
|
-
| <a id="property-ref"></a> `ref` | `public` | [`ActorRef`](https://www.jsdocs.io/package/xstate#ActorRef)\<`any`, `any`, `any`\> | -
|
|
143
|
-
| <a id="property-sessionid"></a> `sessionId` | `public` | `string` | The globally unique process ID for this invocation.
|
|
144
|
-
| <a id="property-src"></a> `src` | `public` | \| `string` \| [`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic) | -
|
|
145
|
-
| <a id="property-state"></a> `state` | `public` | [`State`](../../play-signals/namespaces/Signal/classes/State.md)\<`ReturnType`\<`TMachine`\[`"transition"`\]\>\> | 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.
|
|
146
|
-
| <a id="property-system"></a> `system` | `public` | [`AnyActorSystem`](https://www.jsdocs.io/package/xstate#AnyActorSystem) | The system to which this actor belongs.
|
|
147
|
-
| <a id="property-systemid"></a> `systemId` | `public` | `string` \| `undefined` | -
|
|
141
|
+
| Property | Modifier | Type | Description | Overrides | Inherited from | Defined in |
|
|
142
|
+
| ------------------------------------------------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
143
|
+
| <a id="property-_parent"></a> `_parent?` | `public` | [`AnyActorRef`](https://www.jsdocs.io/package/xstate#AnyActorRef) | - | - | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`_parent`](../../play-actor/classes/AbstractActor.md#property-_parent) | - |
|
|
144
|
+
| <a id="property-clock"></a> `clock` | `public` | [`Clock`](https://www.jsdocs.io/package/xstate#Clock) | The clock that is responsible for setting and clearing timeouts, such as delayed events and transitions. | - | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`clock`](../../play-actor/classes/AbstractActor.md#property-clock) | - |
|
|
145
|
+
| <a id="property-currentroute"></a> `currentRoute` | `public` | [`Computed`](../../play-signals/namespaces/Signal/classes/Computed.md)\<`string` \| `null`\> | A TC39 `Signal.Computed` that derives the current URL path from the active machine state's `meta.route` template and the actor's context. Returns `null` when the current state has no `meta.route`, or when the route template cannot be fully resolved — a required `:param` absent from context is caught internally (`MissingRouteParamError` never escapes `get()`): the condition is transient mid-transition and the signal recomputes on the next snapshot. **Example** `// Returns "/profile/alice" when context.params.userId === "alice", // and null while the param is still missing. const route = actor.currentRoute.get();` | - | - | [packages/play-xstate/src/player-actor.ts:292](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.1.0/packages/play-xstate/src/player-actor.ts#L292) |
|
|
146
|
+
| <a id="property-currentview"></a> `currentView` | `readonly` | [`State`](../../play-signals/namespaces/Signal/classes/State.md)\<[`PlaySpec`](../../play-actor/interfaces/PlaySpec.md) \| `null`\> | Reactive signal containing the current view spec derived from the active state's `meta.view` metadata. Emits a **fresh object reference** whenever the rendered view actually changes — a different state's view, or a param/context change that alters the resolved spec (including `reenter: true` re-entries with new params). Snapshots that do not change the rendered view (e.g. context-only assigns) keep the previous reference so downstream providers do not remount the UI on every event. The emitted `PlaySpec` has its element `props` enriched with `context.params` before emission — URL path parameters (e.g. `:section?`) flow into component props automatically. See `mergeRouteParamsIntoProps` for the merge priority rules. Returns `null` when the current state has no `meta.view` metadata. Two states declaring separate but structurally identical `meta.view` literals emit distinct references on a transition between them (a provider remount); hoist the shared literal into one `typedSpec` constant to deduplicate by identity. **Example** `const view = actor.currentView.get(); if (view) { console.log(view.root); // e.g. "root" console.log(view.elements); // @xmachines/json-render-core Spec elements }` | - | - | [packages/play-xstate/src/player-actor.ts:341](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.1.0/packages/play-xstate/src/player-actor.ts#L341) |
|
|
147
|
+
| <a id="property-id"></a> `id` | `public` | `string` | The unique identifier for this actor relative to its parent. | - | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`id`](../../play-actor/classes/AbstractActor.md#property-id) | - |
|
|
148
|
+
| <a id="property-initialroute"></a> `initialRoute` | `readonly` | `string` \| `null` | The route derived from the machine's initial state — fixed at construction, never changes even when the actor is restored from a snapshot. Router bridges compare this against the browser URL to distinguish a deep-link (non-initial URL → router wins) from a restore (initial URL + actor at a different restored route → actor wins). Derived statically from the machine definition via `deriveInitialRoute` (XState's pure `initialTransition` helper): the initial state chain and its `meta.route` templates are fixed at machine definition time, while `:param` substitution uses the machine's real initial context for this actor's `input`. No extra actor is ever created, and a restored snapshot never influences the value — it is always the machine's **default** initial route. | - | - | [packages/play-xstate/src/player-actor.ts:309](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.1.0/packages/play-xstate/src/player-actor.ts#L309) |
|
|
149
|
+
| <a id="property-logic"></a> `logic` | `public` | [`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic) | - | - | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`logic`](../../play-actor/classes/AbstractActor.md#property-logic) | - |
|
|
150
|
+
| <a id="property-options"></a> `options` | `public` | `Readonly`\<[`ActorOptions`](https://www.jsdocs.io/package/xstate#ActorOptions)\<`TLogic`\>\> | - | - | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`options`](../../play-actor/classes/AbstractActor.md#property-options) | - |
|
|
151
|
+
| <a id="property-ref"></a> `ref` | `public` | [`ActorRef`](https://www.jsdocs.io/package/xstate#ActorRef)\<`any`, `any`, `any`\> | - | - | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`ref`](../../play-actor/classes/AbstractActor.md#property-ref) | - |
|
|
152
|
+
| <a id="property-sessionid"></a> `sessionId` | `public` | `string` | The globally unique process ID for this invocation. | - | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`sessionId`](../../play-actor/classes/AbstractActor.md#property-sessionid) | - |
|
|
153
|
+
| <a id="property-src"></a> `src` | `public` | \| `string` \| [`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic) | - | - | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`src`](../../play-actor/classes/AbstractActor.md#property-src) | - |
|
|
154
|
+
| <a id="property-state"></a> `state` | `public` | [`State`](../../play-signals/namespaces/Signal/classes/State.md)\<`ReturnType`\<`TMachine`\[`"transition"`\]\>\> | 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. | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`state`](../../play-actor/classes/AbstractActor.md#property-state) | - | [packages/play-xstate/src/player-actor.ts:252](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.1.0/packages/play-xstate/src/player-actor.ts#L252) |
|
|
155
|
+
| <a id="property-system"></a> `system` | `public` | [`AnyActorSystem`](https://www.jsdocs.io/package/xstate#AnyActorSystem) | The system to which this actor belongs. | - | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`system`](../../play-actor/classes/AbstractActor.md#property-system) | - |
|
|
156
|
+
| <a id="property-systemid"></a> `systemId` | `public` | `string` \| `undefined` | - | - | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`systemId`](../../play-actor/classes/AbstractActor.md#property-systemid) | - |
|
|
148
157
|
|
|
149
158
|
## Methods
|
|
150
159
|
|
|
@@ -172,12 +181,12 @@ Defined in: `xstate`
|
|
|
172
181
|
can(event): boolean;
|
|
173
182
|
```
|
|
174
183
|
|
|
175
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:
|
|
184
|
+
Defined in: [packages/play-xstate/src/player-actor.ts:265](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.1.0/packages/play-xstate/src/player-actor.ts#L265)
|
|
176
185
|
|
|
177
186
|
Returns whether the actor's current state can accept the given event.
|
|
178
187
|
|
|
179
188
|
Typed to the machine's event union — passing an unknown event type is a
|
|
180
|
-
compile error.
|
|
189
|
+
compile error. Evaluated against the current snapshot signal.
|
|
181
190
|
|
|
182
191
|
#### Parameters
|
|
183
192
|
|
|
@@ -203,11 +212,9 @@ if (actor.can({ type: "auth.logout" })) { ... }
|
|
|
203
212
|
dispose(): void;
|
|
204
213
|
```
|
|
205
214
|
|
|
206
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:
|
|
215
|
+
Defined in: [packages/play-xstate/src/player-actor.ts:719](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.1.0/packages/play-xstate/src/player-actor.ts#L719)
|
|
207
216
|
|
|
208
|
-
Convenience dispose method for cleanup
|
|
209
|
-
|
|
210
|
-
Per CONTEXT.md: "Both .dispose() convenience method and manual machine.stop()"
|
|
217
|
+
Convenience dispose method for cleanup — an alias for [stop](#stop).
|
|
211
218
|
|
|
212
219
|
#### Returns
|
|
213
220
|
|
|
@@ -218,16 +225,22 @@ Per CONTEXT.md: "Both .dispose() convenience method and manual machine.stop()"
|
|
|
218
225
|
### getPersistedSnapshot()
|
|
219
226
|
|
|
220
227
|
```ts
|
|
221
|
-
getPersistedSnapshot(): Snapshot<unknown>;
|
|
228
|
+
getPersistedSnapshot(options?): Snapshot<unknown>;
|
|
222
229
|
```
|
|
223
230
|
|
|
224
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:
|
|
231
|
+
Defined in: [packages/play-xstate/src/player-actor.ts:672](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.1.0/packages/play-xstate/src/player-actor.ts#L672)
|
|
225
232
|
|
|
226
|
-
Get
|
|
233
|
+
Get this actor's persisted snapshot.
|
|
227
234
|
|
|
228
235
|
Suitable for serialization and later restoration via the factory's
|
|
229
236
|
`restore.snapshot` option.
|
|
230
237
|
|
|
238
|
+
#### Parameters
|
|
239
|
+
|
|
240
|
+
| Parameter | Type |
|
|
241
|
+
| ---------- | --------- |
|
|
242
|
+
| `options?` | `unknown` |
|
|
243
|
+
|
|
231
244
|
#### Returns
|
|
232
245
|
|
|
233
246
|
[`Snapshot`](https://www.jsdocs.io/package/xstate#Snapshot)\<`unknown`\>
|
|
@@ -244,7 +257,7 @@ Suitable for serialization and later restoration via the factory's
|
|
|
244
257
|
getSnapshot(): SnapshotFrom<TMachine>;
|
|
245
258
|
```
|
|
246
259
|
|
|
247
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:
|
|
260
|
+
Defined in: [packages/play-xstate/src/player-actor.ts:570](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.1.0/packages/play-xstate/src/player-actor.ts#L570)
|
|
248
261
|
|
|
249
262
|
Get current snapshot
|
|
250
263
|
|
|
@@ -264,9 +277,9 @@ Get current snapshot
|
|
|
264
277
|
on<TType>(type, handler): Subscription;
|
|
265
278
|
```
|
|
266
279
|
|
|
267
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:
|
|
280
|
+
Defined in: [packages/play-xstate/src/player-actor.ts:657](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.1.0/packages/play-xstate/src/player-actor.ts#L657)
|
|
268
281
|
|
|
269
|
-
Listen for events
|
|
282
|
+
Listen for events this actor emits via the `emit` action.
|
|
270
283
|
|
|
271
284
|
#### Type Parameters
|
|
272
285
|
|
|
@@ -330,9 +343,9 @@ Defined in: `xstate`
|
|
|
330
343
|
send(event): void;
|
|
331
344
|
```
|
|
332
345
|
|
|
333
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:
|
|
346
|
+
Defined in: [packages/play-xstate/src/player-actor.ts:532](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.1.0/packages/play-xstate/src/player-actor.ts#L532)
|
|
334
347
|
|
|
335
|
-
Send an event to
|
|
348
|
+
Send an event to this actor.
|
|
336
349
|
|
|
337
350
|
The actor's state machine guards decide whether the event causes a transition.
|
|
338
351
|
Pass any event from the machine's event union — domain events, routing events, etc.
|
|
@@ -374,11 +387,15 @@ actor.send({ type: "play.route", to: "#home" });
|
|
|
374
387
|
start(): this;
|
|
375
388
|
```
|
|
376
389
|
|
|
377
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:
|
|
390
|
+
Defined in: [packages/play-xstate/src/player-actor.ts:460](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.1.0/packages/play-xstate/src/player-actor.ts#L460)
|
|
378
391
|
|
|
379
|
-
Start the actor
|
|
392
|
+
Start the actor.
|
|
380
393
|
|
|
381
|
-
|
|
394
|
+
Fires `onStart` on each real start — every transition from not-running to
|
|
395
|
+
running, including a start after a stop, which XState allows (its own
|
|
396
|
+
`start()` bails only while the actor is already RUNNING). A repeated call
|
|
397
|
+
while running does not re-fire it, so a defensive double mount does not
|
|
398
|
+
re-run `onStart` side effects for one actual start.
|
|
382
399
|
|
|
383
400
|
#### Returns
|
|
384
401
|
|
|
@@ -396,9 +413,16 @@ Per RESEARCH.md Pitfall 1: Always call start() after creation
|
|
|
396
413
|
stop(): this;
|
|
397
414
|
```
|
|
398
415
|
|
|
399
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:
|
|
416
|
+
Defined in: [packages/play-xstate/src/player-actor.ts:490](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.1.0/packages/play-xstate/src/player-actor.ts#L490)
|
|
417
|
+
|
|
418
|
+
Stop the actor and clean up.
|
|
400
419
|
|
|
401
|
-
|
|
420
|
+
Fires `onStop` only when the actor was actually running — mirroring
|
|
421
|
+
XState, where stopping a never-started or already-stopped actor is a
|
|
422
|
+
no-op with zero teardown — so paired cleanup never runs twice, nor
|
|
423
|
+
against resources `onStart` never acquired. Stopping does not close the
|
|
424
|
+
actor for good: a later `start()` is a fresh lifecycle and fires
|
|
425
|
+
`onStart` again.
|
|
402
426
|
|
|
403
427
|
#### Returns
|
|
404
428
|
|
|
@@ -418,9 +442,9 @@ Stop the actor and cleanup
|
|
|
418
442
|
subscribe(observer): Subscription;
|
|
419
443
|
```
|
|
420
444
|
|
|
421
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:
|
|
445
|
+
Defined in: [packages/play-xstate/src/player-actor.ts:594](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.1.0/packages/play-xstate/src/player-actor.ts#L594)
|
|
422
446
|
|
|
423
|
-
Subscribe to snapshot updates
|
|
447
|
+
Subscribe to this actor's snapshot updates.
|
|
424
448
|
|
|
425
449
|
Accepts an observer object, exactly like XState's `Actor.subscribe`.
|
|
426
450
|
|
|
@@ -449,9 +473,9 @@ subscribe(
|
|
|
449
473
|
completeListener?): Subscription;
|
|
450
474
|
```
|
|
451
475
|
|
|
452
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:
|
|
476
|
+
Defined in: [packages/play-xstate/src/player-actor.ts:605](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.1.0/packages/play-xstate/src/player-actor.ts#L605)
|
|
453
477
|
|
|
454
|
-
Subscribe to snapshot updates
|
|
478
|
+
Subscribe to this actor's snapshot updates.
|
|
455
479
|
|
|
456
480
|
Accepts listener functions, exactly like XState's `Actor.subscribe`.
|
|
457
481
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function buildRouteUrl(routeTemplate, context?): string;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-xstate/src/routing/build-url.ts:
|
|
9
|
+
Defined in: [packages/play-xstate/src/routing/build-url.ts:35](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.1.0/packages/play-xstate/src/routing/build-url.ts#L35)
|
|
10
10
|
|
|
11
11
|
Build a full URL from a route template and the actor's context.
|
|
12
12
|
|
|
@@ -19,10 +19,10 @@ error rather than silently resolving to `undefined`.
|
|
|
19
19
|
|
|
20
20
|
## Parameters
|
|
21
21
|
|
|
22
|
-
| Parameter | Type | Description
|
|
23
|
-
| --------------- | ----------------------------------------------- |
|
|
24
|
-
| `routeTemplate` | `string` | Route path template, e.g. `"/profile/:userId"` or `"/settings/:section?"`.
|
|
25
|
-
| `context` | [`RouteContext`](../interfaces/RouteContext.md) | Actor context object. Route parameters must be in `context.params`; flat context fields are not inspected.
|
|
22
|
+
| Parameter | Type | Description |
|
|
23
|
+
| --------------- | ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
24
|
+
| `routeTemplate` | `string` | Route path template, e.g. `"/profile/:userId"` or `"/settings/:section?"`. |
|
|
25
|
+
| `context` | [`RouteContext`](../interfaces/RouteContext.md) | Actor context object. Route parameters must be in `context.params`; flat context fields are not inspected. A missing `query` field builds a query-less URL, exactly like `query: {}`. |
|
|
26
26
|
|
|
27
27
|
## Returns
|
|
28
28
|
|
|
@@ -36,13 +36,6 @@ When a **required** `:param` placeholder has no
|
|
|
36
36
|
matching value in context. Optional parameters (`:param?`) are silently omitted
|
|
37
37
|
when missing. Import the class from `@xmachines/play-xstate/errors`.
|
|
38
38
|
|
|
39
|
-
## Throws
|
|
40
|
-
|
|
41
|
-
When the context has a `params` field but no
|
|
42
|
-
`query` field. This indicates a routing-aware machine context that was not set up
|
|
43
|
-
to receive query parameters, which would silently drop query params from
|
|
44
|
-
`play.route` events. Import the class from `@xmachines/play-xstate/errors`.
|
|
45
|
-
|
|
46
39
|
## Example
|
|
47
40
|
|
|
48
41
|
```typescript
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
[API](../../../README.md) / [@xmachines/play-xstate](../README.md) / composeGuards
|
|
2
2
|
|
|
3
|
-
# Function: composeGuards()
|
|
3
|
+
# ~~Function: composeGuards()~~
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
6
|
function composeGuards<TContext, TEvent>(guards): ComposedGuard;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-xstate/src/guards/compose.ts:
|
|
9
|
+
Defined in: [packages/play-xstate/src/guards/compose.ts:82](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.1.0/packages/play-xstate/src/guards/compose.ts#L82)
|
|
10
10
|
|
|
11
11
|
Compose guards with AND logic using XState's and() helper
|
|
12
12
|
|
|
@@ -77,3 +77,8 @@ guard: composeGuards([({ context }) => context.age >= 18, ({ context }) => conte
|
|
|
77
77
|
|
|
78
78
|
- [composeGuardsOr](composeGuardsOr.md) for OR composition
|
|
79
79
|
- [negateGuard](negateGuard.md) for NOT logic
|
|
80
|
+
|
|
81
|
+
## Deprecated
|
|
82
|
+
|
|
83
|
+
Use XState's own `and()`/`or()`/`not()` directly — this helper does not
|
|
84
|
+
compose with `setup()`-typed guard slots and will be removed in the next major.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
[API](../../../README.md) / [@xmachines/play-xstate](../README.md) / composeGuardsOr
|
|
2
2
|
|
|
3
|
-
# Function: composeGuardsOr()
|
|
3
|
+
# ~~Function: composeGuardsOr()~~
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
6
|
function composeGuardsOr<TContext, TEvent>(guards): ComposedGuard;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-xstate/src/guards/compose.ts:
|
|
9
|
+
Defined in: [packages/play-xstate/src/guards/compose.ts:149](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.1.0/packages/play-xstate/src/guards/compose.ts#L149)
|
|
10
10
|
|
|
11
11
|
Compose guards with OR logic using XState's or() helper
|
|
12
12
|
|
|
@@ -65,3 +65,8 @@ const machine = setup({
|
|
|
65
65
|
|
|
66
66
|
- [composeGuards](composeGuards.md) for AND composition
|
|
67
67
|
- [negateGuard](negateGuard.md) for NOT logic
|
|
68
|
+
|
|
69
|
+
## Deprecated
|
|
70
|
+
|
|
71
|
+
Use XState's own `and()`/`or()`/`not()` directly — this helper does not
|
|
72
|
+
compose with `setup()`-typed guard slots and will be removed in the next major.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
[API](../../../README.md) / [@xmachines/play-xstate](../README.md) / contextFieldMatches
|
|
2
2
|
|
|
3
|
-
# Function: contextFieldMatches()
|
|
3
|
+
# ~~Function: contextFieldMatches()~~
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
6
|
function contextFieldMatches<TContext>(fieldPath, expectedValue): Guard<TContext, PlayEvent>;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-xstate/src/guards/helpers.ts:
|
|
9
|
+
Defined in: [packages/play-xstate/src/guards/helpers.ts:75](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.1.0/packages/play-xstate/src/guards/helpers.ts#L75)
|
|
10
10
|
|
|
11
11
|
Check if a context field matches an expected value.
|
|
12
12
|
|
|
@@ -36,3 +36,8 @@ For XState state-node matching, use the built-in `in:` guard syntax instead.
|
|
|
36
36
|
[`Guard`](../type-aliases/Guard.md)\<`TContext`, [`PlayEvent`](../../play/type-aliases/PlayEvent.md)\>
|
|
37
37
|
|
|
38
38
|
Guard predicate checking if context field matches
|
|
39
|
+
|
|
40
|
+
## Deprecated
|
|
41
|
+
|
|
42
|
+
Part of the guard utilities slated for removal in the next major —
|
|
43
|
+
write a plain typed predicate instead.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function definePlayer<TMachine>(config): PlayerFactory<TMachine>;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-xstate/src/define-player.ts:61](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.
|
|
9
|
+
Defined in: [packages/play-xstate/src/define-player.ts:61](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.1.0/packages/play-xstate/src/define-player.ts#L61)
|
|
10
10
|
|
|
11
11
|
Create a player factory from an XState machine
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function deriveRoute(stateMeta): string | null;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-xstate/src/routing/derive-route.ts:91](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.
|
|
9
|
+
Defined in: [packages/play-xstate/src/routing/derive-route.ts:91](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.1.0/packages/play-xstate/src/routing/derive-route.ts#L91)
|
|
10
10
|
|
|
11
11
|
Derive route from XState state metadata
|
|
12
12
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
[API](../../../README.md) / [@xmachines/play-xstate](../README.md) / eventMatches
|
|
2
2
|
|
|
3
|
-
# Function: eventMatches()
|
|
3
|
+
# ~~Function: eventMatches()~~
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
6
|
function eventMatches<TEvent>(eventType): Guard<unknown, TEvent>;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-xstate/src/guards/helpers.ts:
|
|
9
|
+
Defined in: [packages/play-xstate/src/guards/helpers.ts:52](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.1.0/packages/play-xstate/src/guards/helpers.ts#L52)
|
|
10
10
|
|
|
11
11
|
Check if event type matches expected type
|
|
12
12
|
|
|
@@ -38,3 +38,8 @@ const machine = setup({
|
|
|
38
38
|
},
|
|
39
39
|
});
|
|
40
40
|
```
|
|
41
|
+
|
|
42
|
+
## Deprecated
|
|
43
|
+
|
|
44
|
+
Part of the guard utilities slated for removal in the next major —
|
|
45
|
+
write a plain typed predicate instead.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function formatPlayRouteTransitions<T>(machineConfig): T;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:89](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.
|
|
9
|
+
Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:89](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.1.0/packages/play-xstate/src/routing/format-play-route-transitions.ts#L89)
|
|
10
10
|
|
|
11
11
|
Formats play.route transitions from declarative route configs
|
|
12
12
|
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
[API](../../../README.md) / [@xmachines/play-xstate](../README.md) / hasContext
|
|
2
2
|
|
|
3
|
-
# Function: hasContext()
|
|
3
|
+
# ~~Function: hasContext()~~
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
6
|
function hasContext<TContext>(path): Guard<TContext, PlayEvent>;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-xstate/src/guards/helpers.ts:24](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.
|
|
9
|
+
Defined in: [packages/play-xstate/src/guards/helpers.ts:24](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.1.0/packages/play-xstate/src/guards/helpers.ts#L24)
|
|
10
10
|
|
|
11
11
|
Check if context has a truthy value at path
|
|
12
12
|
|
|
13
|
-
Per CONTEXT.md: Convenience helper for common guard pattern
|
|
14
|
-
|
|
15
13
|
## Type Parameters
|
|
16
14
|
|
|
17
15
|
| Type Parameter | Default type |
|
|
@@ -40,3 +38,8 @@ const machine = setup({
|
|
|
40
38
|
},
|
|
41
39
|
});
|
|
42
40
|
```
|
|
41
|
+
|
|
42
|
+
## Deprecated
|
|
43
|
+
|
|
44
|
+
Part of the guard utilities slated for removal in the next major —
|
|
45
|
+
write a plain typed predicate instead.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function isAbsoluteRoute(path): boolean;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-xstate/src/routing/derive-route.ts:160](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.
|
|
9
|
+
Defined in: [packages/play-xstate/src/routing/derive-route.ts:160](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.1.0/packages/play-xstate/src/routing/derive-route.ts#L160)
|
|
10
10
|
|
|
11
11
|
Check if route path is absolute
|
|
12
12
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
[API](../../../README.md) / [@xmachines/play-xstate](../README.md) / negateGuard
|
|
2
2
|
|
|
3
|
-
# Function: negateGuard()
|
|
3
|
+
# ~~Function: negateGuard()~~
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
6
|
function negateGuard<TContext, TEvent>(guard): ComposedGuard;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-xstate/src/guards/compose.ts:
|
|
9
|
+
Defined in: [packages/play-xstate/src/guards/compose.ts:211](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.1.0/packages/play-xstate/src/guards/compose.ts#L211)
|
|
10
10
|
|
|
11
11
|
Negate a guard using XState's not() helper
|
|
12
12
|
|
|
@@ -59,3 +59,8 @@ const machine = setup({
|
|
|
59
59
|
|
|
60
60
|
- [composeGuards](composeGuards.md) for AND composition
|
|
61
61
|
- [composeGuardsOr](composeGuardsOr.md) for OR composition
|
|
62
|
+
|
|
63
|
+
## Deprecated
|
|
64
|
+
|
|
65
|
+
Use XState's own `and()`/`or()`/`not()` directly — this helper does not
|
|
66
|
+
compose with `setup()`-typed guard slots and will be removed in the next major.
|