@xmachines/docs 2.0.0 → 2.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.
Files changed (299) hide show
  1. package/README.md +11 -13
  2. package/api/@xmachines/play/README.md +58 -63
  3. package/api/@xmachines/play/classes/NonNullableError.md +7 -7
  4. package/api/@xmachines/play/classes/PlayError.md +25 -27
  5. package/api/@xmachines/play/functions/assertNonNullable.md +17 -17
  6. package/api/@xmachines/play/type-aliases/PlayEvent.md +26 -25
  7. package/api/@xmachines/play-actor/README.md +72 -63
  8. package/api/@xmachines/play-actor/classes/AbstractActor.md +39 -39
  9. package/api/@xmachines/play-actor/functions/attachRenderErrorHandler.md +19 -18
  10. package/api/@xmachines/play-actor/functions/composePlayState.md +9 -8
  11. package/api/@xmachines/play-actor/functions/createViewStoreLifecycle.md +5 -5
  12. package/api/@xmachines/play-actor/functions/guardContextWrites.md +27 -25
  13. package/api/@xmachines/play-actor/functions/refreshContextSubtree.md +12 -11
  14. package/api/@xmachines/play-actor/functions/reuseComposedState.md +23 -22
  15. package/api/@xmachines/play-actor/functions/shallowEqualExcept.md +6 -5
  16. package/api/@xmachines/play-actor/functions/toAtomState.md +16 -14
  17. package/api/@xmachines/play-actor/functions/typedSpec.md +12 -11
  18. package/api/@xmachines/play-actor/interfaces/BaseActorProviderProps.md +17 -15
  19. package/api/@xmachines/play-actor/interfaces/BaseViewContextValue.md +15 -14
  20. package/api/@xmachines/play-actor/interfaces/PlaySpec.md +13 -13
  21. package/api/@xmachines/play-actor/interfaces/ResolveViewStoreOptions.md +4 -4
  22. package/api/@xmachines/play-actor/interfaces/Routable.md +4 -4
  23. package/api/@xmachines/play-actor/interfaces/ViewStoreLifecycle.md +11 -11
  24. package/api/@xmachines/play-actor/interfaces/ViewStoreResolution.md +7 -7
  25. package/api/@xmachines/play-actor/interfaces/Viewable.md +9 -9
  26. package/api/@xmachines/play-actor/variables/CONTEXT_STATE_KEY.md +5 -5
  27. package/api/@xmachines/play-dom/README.md +119 -85
  28. package/api/@xmachines/play-dom/classes/PlayRenderer.md +34 -32
  29. package/api/@xmachines/play-dom/functions/createPlayUI.md +10 -10
  30. package/api/@xmachines/play-dom/functions/createRenderer.md +21 -17
  31. package/api/@xmachines/play-dom/interfaces/CreatePlayUIOptions.md +8 -8
  32. package/api/@xmachines/play-dom/interfaces/MountOptions.md +9 -9
  33. package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +9 -9
  34. package/api/@xmachines/play-dom/type-aliases/MountFn.md +5 -5
  35. package/api/@xmachines/play-dom-router/README.md +66 -49
  36. package/api/@xmachines/play-dom-router/classes/DomRouterBridge.md +116 -0
  37. package/api/@xmachines/play-dom-router/functions/connectRouter.md +4 -3
  38. package/api/@xmachines/play-dom-router/functions/createBrowserHistory.md +16 -14
  39. package/api/@xmachines/play-dom-router/functions/createRouteMap.md +12 -11
  40. package/api/@xmachines/play-dom-router/functions/createRouter.md +14 -14
  41. package/api/@xmachines/play-dom-router/interfaces/BrowserHistory.md +25 -26
  42. package/api/@xmachines/play-dom-router/interfaces/BrowserWindow.md +19 -18
  43. package/api/@xmachines/play-dom-router/interfaces/ConnectRouterOptions.md +7 -7
  44. package/api/@xmachines/play-dom-router/interfaces/PlayRouteEvent.md +39 -33
  45. package/api/@xmachines/play-dom-router/interfaces/RoutableActor.md +18 -17
  46. package/api/@xmachines/play-dom-router/interfaces/RouteLookupContract.md +9 -9
  47. package/api/@xmachines/play-dom-router/interfaces/RouteMap.md +39 -38
  48. package/api/@xmachines/play-dom-router/interfaces/RouteMapOptions.md +5 -5
  49. package/api/@xmachines/play-dom-router/interfaces/RouteMapping.md +11 -10
  50. package/api/@xmachines/play-dom-router/interfaces/RouterBridge.md +27 -24
  51. package/api/@xmachines/play-dom-router/interfaces/VanillaRouter.md +7 -7
  52. package/api/@xmachines/play-react/README.md +63 -54
  53. package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +14 -13
  54. package/api/@xmachines/play-react/functions/useActor.md +1 -1
  55. package/api/@xmachines/play-react/functions/usePlayView.md +4 -4
  56. package/api/@xmachines/play-react/functions/useSignalEffect.md +39 -39
  57. package/api/@xmachines/play-react/interfaces/ActorProviderProps.md +11 -11
  58. package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryProps.md +7 -7
  59. package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryState.md +4 -4
  60. package/api/@xmachines/play-react/interfaces/PlayUIProviderProps.md +14 -14
  61. package/api/@xmachines/play-react/interfaces/ViewContextValue.md +8 -8
  62. package/api/@xmachines/play-react/type-aliases/AnyPlayActor.md +2 -2
  63. package/api/@xmachines/play-react/type-aliases/PlayRendererProps.md +13 -0
  64. package/api/@xmachines/play-react/variables/ActorProvider.md +9 -8
  65. package/api/@xmachines/play-react/variables/PlayRenderer.md +5 -4
  66. package/api/@xmachines/play-react/variables/PlayUIProvider.md +6 -6
  67. package/api/@xmachines/play-react-router/README.md +37 -28
  68. package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +22 -19
  69. package/api/@xmachines/play-react-router/classes/RouteMap.md +50 -48
  70. package/api/@xmachines/play-react-router/functions/createPlayRouterProvider.md +16 -14
  71. package/api/@xmachines/play-react-router/functions/createRouteMap.md +12 -11
  72. package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +18 -18
  73. package/api/@xmachines/play-react-router/interfaces/PlayActor.md +22 -20
  74. package/api/@xmachines/play-react-router/interfaces/PlayRouteEvent.md +39 -33
  75. package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderBaseProps.md +12 -12
  76. package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +11 -11
  77. package/api/@xmachines/play-react-router/interfaces/RouteMapOptions.md +5 -5
  78. package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +11 -10
  79. package/api/@xmachines/play-react-router/interfaces/RouterBridge.md +27 -24
  80. package/api/@xmachines/play-react-router/type-aliases/PlayRouterBridgeConstructor.md +2 -2
  81. package/api/@xmachines/play-react-router/variables/PlayRouterProvider.md +7 -6
  82. package/api/@xmachines/play-router/README.md +94 -82
  83. package/api/@xmachines/play-router/classes/RouteMap.md +50 -48
  84. package/api/@xmachines/play-router/classes/RouterBridgeBase.md +29 -23
  85. package/api/@xmachines/play-router/functions/buildPlayRouteEvent.md +6 -5
  86. package/api/@xmachines/play-router/functions/buildRouteTree.md +16 -15
  87. package/api/@xmachines/play-router/functions/createRouteMap.md +12 -11
  88. package/api/@xmachines/play-router/functions/createRouteMapFromTree.md +18 -18
  89. package/api/@xmachines/play-router/functions/detectDuplicateRoutes.md +18 -17
  90. package/api/@xmachines/play-router/functions/extractMachineRoutes.md +11 -10
  91. package/api/@xmachines/play-router/functions/extractQuery.md +3 -3
  92. package/api/@xmachines/play-router/functions/extractRouteParams.md +22 -19
  93. package/api/@xmachines/play-router/functions/findRouteById.md +10 -9
  94. package/api/@xmachines/play-router/functions/findRouteByPath.md +14 -12
  95. package/api/@xmachines/play-router/functions/getNavigableRoutes.md +9 -9
  96. package/api/@xmachines/play-router/functions/getRoutableRoutes.md +9 -9
  97. package/api/@xmachines/play-router/functions/getTransitionReachableRoutes.md +16 -15
  98. package/api/@xmachines/play-router/functions/isRouteReachable.md +12 -11
  99. package/api/@xmachines/play-router/functions/machineToGraph.md +1 -1
  100. package/api/@xmachines/play-router/functions/routeExists.md +8 -8
  101. package/api/@xmachines/play-router/functions/sanitizePathname.md +15 -13
  102. package/api/@xmachines/play-router/functions/validateRouteFormat.md +10 -10
  103. package/api/@xmachines/play-router/functions/validateStateExists.md +9 -9
  104. package/api/@xmachines/play-router/interfaces/BuildPlayRouteEventOptions.md +4 -4
  105. package/api/@xmachines/play-router/interfaces/LocationLike.md +9 -9
  106. package/api/@xmachines/play-router/interfaces/MachineEdgeData.md +7 -7
  107. package/api/@xmachines/play-router/interfaces/MachineNodeData.md +9 -9
  108. package/api/@xmachines/play-router/interfaces/PlayActor.md +22 -20
  109. package/api/@xmachines/play-router/interfaces/PlayRouteEvent.md +39 -33
  110. package/api/@xmachines/play-router/interfaces/ResolvedRoutePath.md +7 -7
  111. package/api/@xmachines/play-router/interfaces/RoutableActor.md +18 -17
  112. package/api/@xmachines/play-router/interfaces/RouteInfo.md +11 -11
  113. package/api/@xmachines/play-router/interfaces/RouteMapOptions.md +5 -5
  114. package/api/@xmachines/play-router/interfaces/RouteMapping.md +11 -10
  115. package/api/@xmachines/play-router/interfaces/RouteMatch.md +3 -3
  116. package/api/@xmachines/play-router/interfaces/RouteNode.md +13 -13
  117. package/api/@xmachines/play-router/interfaces/RouteObject.md +6 -6
  118. package/api/@xmachines/play-router/interfaces/RouteTree.md +11 -11
  119. package/api/@xmachines/play-router/interfaces/RouteWatcherHandle.md +13 -13
  120. package/api/@xmachines/play-router/interfaces/RouterBridge.md +27 -24
  121. package/api/@xmachines/play-router/interfaces/WindowLike.md +10 -10
  122. package/api/@xmachines/play-router/type-aliases/BaseRouteMapping.md +13 -0
  123. package/api/@xmachines/play-router/type-aliases/MachineGraph.md +4 -3
  124. package/api/@xmachines/play-router/type-aliases/RouteMetadata.md +2 -2
  125. package/api/@xmachines/play-signals/README.md +38 -36
  126. package/api/@xmachines/play-signals/functions/watchSignal.md +15 -15
  127. package/api/@xmachines/play-signals/interfaces/ComputedOptions.md +6 -6
  128. package/api/@xmachines/play-signals/interfaces/SignalComputed.md +10 -10
  129. package/api/@xmachines/play-signals/interfaces/SignalOptions.md +6 -6
  130. package/api/@xmachines/play-signals/interfaces/SignalState.md +13 -13
  131. package/api/@xmachines/play-signals/interfaces/SignalWatcher.md +18 -18
  132. package/api/@xmachines/play-signals/type-aliases/WatcherNotify.md +6 -5
  133. package/api/@xmachines/play-solid/README.md +46 -42
  134. package/api/@xmachines/play-solid/functions/useActor.md +1 -1
  135. package/api/@xmachines/play-solid/functions/usePlayView.md +3 -3
  136. package/api/@xmachines/play-solid/interfaces/ActorProviderProps.md +13 -13
  137. package/api/@xmachines/play-solid/interfaces/PlayUIProviderProps.md +14 -14
  138. package/api/@xmachines/play-solid/interfaces/ViewContextValue.md +9 -9
  139. package/api/@xmachines/play-solid/type-aliases/AnyPlayActor.md +2 -2
  140. package/api/@xmachines/play-solid/variables/ActorContext.md +5 -4
  141. package/api/@xmachines/play-solid/variables/ActorProvider.md +8 -7
  142. package/api/@xmachines/play-solid/variables/PlayRenderer.md +6 -4
  143. package/api/@xmachines/play-solid/variables/PlayUIProvider.md +7 -7
  144. package/api/@xmachines/play-solid-router/README.md +34 -29
  145. package/api/@xmachines/play-solid-router/classes/RouteMap.md +50 -48
  146. package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +43 -34
  147. package/api/@xmachines/play-solid-router/functions/createPlayRouterProvider.md +15 -13
  148. package/api/@xmachines/play-solid-router/functions/createRouteMap.md +12 -11
  149. package/api/@xmachines/play-solid-router/interfaces/AbstractActor.md +39 -39
  150. package/api/@xmachines/play-solid-router/interfaces/PlayActor.md +22 -20
  151. package/api/@xmachines/play-solid-router/interfaces/PlayRouteEvent.md +39 -33
  152. package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderBaseProps.md +10 -10
  153. package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +11 -11
  154. package/api/@xmachines/play-solid-router/interfaces/RouteMapOptions.md +5 -5
  155. package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +11 -10
  156. package/api/@xmachines/play-solid-router/interfaces/RouterBridge.md +27 -24
  157. package/api/@xmachines/play-solid-router/type-aliases/PlayRouterBridgeConstructor.md +5 -5
  158. package/api/@xmachines/play-solid-router/type-aliases/RoutableActor.md +2 -2
  159. package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +11 -11
  160. package/api/@xmachines/play-solid-router/variables/PlayRouterProvider.md +9 -8
  161. package/api/@xmachines/play-svelte/README.md +40 -31
  162. package/api/@xmachines/play-svelte/functions/defineRegistry.md +9 -8
  163. package/api/@xmachines/play-svelte/functions/getActorContext.md +5 -4
  164. package/api/@xmachines/play-svelte/functions/getPlayViewContext.md +3 -3
  165. package/api/@xmachines/play-svelte/functions/setActorContext.md +1 -1
  166. package/api/@xmachines/play-svelte/interfaces/ActorProviderProps.md +17 -15
  167. package/api/@xmachines/play-svelte/interfaces/DefineRegistryOptions.md +9 -9
  168. package/api/@xmachines/play-svelte/interfaces/PlayUIProviderProps.md +20 -18
  169. package/api/@xmachines/play-svelte/interfaces/ViewContextValue.md +12 -11
  170. package/api/@xmachines/play-svelte/type-aliases/AnyPlayActor.md +2 -2
  171. package/api/@xmachines/play-svelte-spa-router/README.md +25 -25
  172. package/api/@xmachines/play-svelte-spa-router/classes/RouteMap.md +50 -48
  173. package/api/@xmachines/play-svelte-spa-router/classes/SvelteSpaRouterBridge.md +133 -0
  174. package/api/@xmachines/play-svelte-spa-router/functions/connectRouter.md +3 -3
  175. package/api/@xmachines/play-svelte-spa-router/functions/createRouteMap.md +12 -11
  176. package/api/@xmachines/play-svelte-spa-router/interfaces/ConnectRouterOptions.md +7 -7
  177. package/api/@xmachines/play-svelte-spa-router/interfaces/PlayRouteEvent.md +39 -33
  178. package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapOptions.md +5 -5
  179. package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapping.md +11 -10
  180. package/api/@xmachines/play-svelte-spa-router/interfaces/RouterBridge.md +27 -24
  181. package/api/@xmachines/play-svelte-spa-router/interfaces/WindowLike.md +10 -10
  182. package/api/@xmachines/play-svelte-spa-router/type-aliases/RoutableActor.md +1 -1
  183. package/api/@xmachines/play-sveltekit-router/README.md +38 -34
  184. package/api/@xmachines/play-sveltekit-router/classes/RouteMap.md +50 -48
  185. package/api/@xmachines/play-sveltekit-router/classes/SvelteKitRouterBridge.md +132 -0
  186. package/api/@xmachines/play-sveltekit-router/functions/connectRouter.md +3 -3
  187. package/api/@xmachines/play-sveltekit-router/functions/createRouteMap.md +12 -11
  188. package/api/@xmachines/play-sveltekit-router/interfaces/ConnectRouterOptions.md +6 -6
  189. package/api/@xmachines/play-sveltekit-router/interfaces/LocationLike.md +9 -9
  190. package/api/@xmachines/play-sveltekit-router/interfaces/PlayRouteEvent.md +39 -33
  191. package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapOptions.md +5 -5
  192. package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapping.md +11 -10
  193. package/api/@xmachines/play-sveltekit-router/interfaces/RouterBridge.md +27 -24
  194. package/api/@xmachines/play-sveltekit-router/type-aliases/RoutableActor.md +1 -1
  195. package/api/@xmachines/play-tanstack-react-router/README.md +66 -48
  196. package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +50 -48
  197. package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +43 -38
  198. package/api/@xmachines/play-tanstack-react-router/functions/createPlayRouterProvider.md +16 -14
  199. package/api/@xmachines/play-tanstack-react-router/functions/createRouteMap.md +12 -11
  200. package/api/@xmachines/play-tanstack-react-router/functions/createRouteMapFromTree.md +18 -18
  201. package/api/@xmachines/play-tanstack-react-router/functions/extractMachineRoutes.md +11 -10
  202. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayActor.md +22 -20
  203. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouteEvent.md +39 -33
  204. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderBaseProps.md +12 -12
  205. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +11 -11
  206. package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapOptions.md +5 -5
  207. package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapping.md +11 -10
  208. package/api/@xmachines/play-tanstack-react-router/interfaces/RouteNavigateEvent.md +16 -11
  209. package/api/@xmachines/play-tanstack-react-router/interfaces/RouterBridge.md +27 -24
  210. package/api/@xmachines/play-tanstack-react-router/type-aliases/PlayRouterBridgeConstructor.md +2 -2
  211. package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterInstance.md +1 -1
  212. package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterLike.md +15 -13
  213. package/api/@xmachines/play-tanstack-react-router/variables/PlayRouterProvider.md +9 -8
  214. package/api/@xmachines/play-tanstack-router/README.md +37 -17
  215. package/api/@xmachines/play-tanstack-router/classes/TanStackRouterBridgeBase.md +43 -38
  216. package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouteMapLike.md +9 -9
  217. package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouterLike.md +15 -13
  218. package/api/@xmachines/play-tanstack-solid-router/README.md +71 -45
  219. package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +50 -48
  220. package/api/@xmachines/play-tanstack-solid-router/classes/TanStackSolidRouterBridge.md +38 -30
  221. package/api/@xmachines/play-tanstack-solid-router/functions/createPlayRouterProvider.md +15 -13
  222. package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +12 -11
  223. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayActor.md +22 -20
  224. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouteEvent.md +39 -33
  225. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderBaseProps.md +11 -11
  226. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +9 -9
  227. package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapOptions.md +5 -5
  228. package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +11 -10
  229. package/api/@xmachines/play-tanstack-solid-router/interfaces/RouterBridge.md +27 -24
  230. package/api/@xmachines/play-tanstack-solid-router/type-aliases/PlayRouterBridgeConstructor.md +2 -2
  231. package/api/@xmachines/play-tanstack-solid-router/type-aliases/RoutableActor.md +2 -2
  232. package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterInstance.md +1 -1
  233. package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterLike.md +15 -13
  234. package/api/@xmachines/play-tanstack-solid-router/variables/PlayRouterProvider.md +7 -7
  235. package/api/@xmachines/play-vue/README.md +37 -35
  236. package/api/@xmachines/play-vue/functions/defineRegistry.md +10 -9
  237. package/api/@xmachines/play-vue/functions/useActor.md +1 -1
  238. package/api/@xmachines/play-vue/functions/usePlayView.md +28 -0
  239. package/api/@xmachines/play-vue/interfaces/ActorProviderProps.md +10 -9
  240. package/api/@xmachines/play-vue/interfaces/PlayUIProviderProps.md +13 -12
  241. package/api/@xmachines/play-vue/interfaces/ViewContextValue.md +10 -9
  242. package/api/@xmachines/play-vue/interfaces/VisibilityProviderProps.md +6 -2
  243. package/api/@xmachines/play-vue/type-aliases/AnyPlayActor.md +2 -2
  244. package/api/@xmachines/play-vue/type-aliases/ComponentEntry.md +1 -1
  245. package/api/@xmachines/play-vue/type-aliases/ComponentsMap.md +1 -1
  246. package/api/@xmachines/play-vue/type-aliases/DefineRegistryOptions.md +2 -2
  247. package/api/@xmachines/play-vue/variables/PlayRenderer.md +1 -1
  248. package/api/@xmachines/play-vue/variables/getPlayViewContext.md +34 -0
  249. package/api/@xmachines/play-vue-router/README.md +65 -56
  250. package/api/@xmachines/play-vue-router/classes/RouteMap.md +50 -48
  251. package/api/@xmachines/play-vue-router/classes/VueRouterBridge.md +26 -19
  252. package/api/@xmachines/play-vue-router/functions/createRouteMap.md +12 -11
  253. package/api/@xmachines/play-vue-router/interfaces/PlayActor.md +22 -20
  254. package/api/@xmachines/play-vue-router/interfaces/PlayRouteEvent.md +39 -33
  255. package/api/@xmachines/play-vue-router/interfaces/RouteMapOptions.md +5 -5
  256. package/api/@xmachines/play-vue-router/interfaces/RouteMapping.md +11 -10
  257. package/api/@xmachines/play-vue-router/interfaces/RouterBridge.md +27 -24
  258. package/api/@xmachines/play-vue-router/type-aliases/RoutableActor.md +2 -2
  259. package/api/@xmachines/play-vue-router/type-aliases/VueRouteMap.md +13 -0
  260. package/api/@xmachines/play-vue-router/variables/PlayRouterProvider.md +5 -5
  261. package/api/@xmachines/play-vue-router/variables/VueRouteMap.md +13 -0
  262. package/api/@xmachines/play-xstate/README.md +72 -70
  263. package/api/@xmachines/play-xstate/classes/PlayerActor.md +123 -112
  264. package/api/@xmachines/play-xstate/functions/buildRouteUrl.md +19 -16
  265. package/api/@xmachines/play-xstate/functions/composeGuards.md +25 -23
  266. package/api/@xmachines/play-xstate/functions/composeGuardsOr.md +20 -20
  267. package/api/@xmachines/play-xstate/functions/contextFieldMatches.md +15 -15
  268. package/api/@xmachines/play-xstate/functions/definePlayer.md +19 -19
  269. package/api/@xmachines/play-xstate/functions/deriveRoute.md +26 -25
  270. package/api/@xmachines/play-xstate/functions/eventMatches.md +8 -8
  271. package/api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md +16 -13
  272. package/api/@xmachines/play-xstate/functions/hasContext.md +8 -8
  273. package/api/@xmachines/play-xstate/functions/isAbsoluteRoute.md +10 -10
  274. package/api/@xmachines/play-xstate/functions/negateGuard.md +19 -18
  275. package/api/@xmachines/play-xstate/interfaces/PlayerConfig.md +6 -6
  276. package/api/@xmachines/play-xstate/interfaces/PlayerFactoryResumeOptions.md +7 -7
  277. package/api/@xmachines/play-xstate/interfaces/PlayerOptions.md +10 -10
  278. package/api/@xmachines/play-xstate/interfaces/RouteContext.md +15 -14
  279. package/api/@xmachines/play-xstate/interfaces/RouteObject.md +2 -2
  280. package/api/@xmachines/play-xstate/type-aliases/ComposedGuard.md +5 -5
  281. package/api/@xmachines/play-xstate/type-aliases/Guard.md +9 -9
  282. package/api/@xmachines/play-xstate/type-aliases/GuardArray.md +4 -3
  283. package/api/@xmachines/play-xstate/type-aliases/PlayerFactory.md +7 -7
  284. package/api/@xmachines/play-xstate/type-aliases/RouteMachineConfig.md +12 -12
  285. package/api/@xmachines/play-xstate/type-aliases/RouteMetadata.md +1 -1
  286. package/api/@xmachines/play-xstate/type-aliases/RouteStateNode.md +15 -14
  287. package/api/@xmachines/shared/README.md +11 -13
  288. package/api/@xmachines/shared/vite-aliases/functions/xmAliases.md +1 -1
  289. package/api/@xmachines/shared/vite-aliases/functions/xmCacheDir.md +1 -1
  290. package/api/@xmachines/shared/vite-aliases/functions/xmOptimizeDeps.md +1 -1
  291. package/api/@xmachines/shared/vite-aliases/functions/xmResolve.md +1 -1
  292. package/api/@xmachines/shared/vite-aliases/functions/xmSvelteRunes.md +2 -2
  293. package/api/@xmachines/shared/vitest/functions/defineXmBrowserConfig.md +1 -1
  294. package/api/@xmachines/shared/vitest/functions/defineXmVitestConfig.md +1 -1
  295. package/api/@xmachines/shared/vitest/interfaces/XmBrowserConfigOptions.md +4 -4
  296. package/contributing/development.md +28 -0
  297. package/guides/inspector.md +1 -1
  298. package/package.json +1 -1
  299. package/api/@xmachines/play-vue/functions/getPlayViewContext.md +0 -28
@@ -2,29 +2,32 @@
2
2
 
3
3
  # Class: PlayerActor\<TMachine\>
4
4
 
5
- Defined in: [packages/play-xstate/src/player-actor.ts:190](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-xstate/src/player-actor.ts#L190)
5
+ Defined in: [packages/play-xstate/src/player-actor.ts:202](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-xstate/src/player-actor.ts#L202)
6
6
 
7
- Concrete XState actor implementing Play Architecture signal protocol
7
+ The concrete XState actor. It implements the signal protocol of the Play Architecture
8
8
 
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.
9
+ The class extends [@xmachines/play-actor!AbstractActor](../../play-actor/classes/AbstractActor.md), and therefore the
10
+ `Actor` class of XState. It gives you the XState v5 integration, and it keeps the
11
+ compatibility with the ecosystem, such as the XState inspection and the devtools.
12
+ The constructor of the base class receives the machine. Therefore a `PlayerActor`
13
+ **is** the XState actor, and it is no wrapper around one: every member of the
14
+ XState `Actor` class works on the state of this instance, and this class adds the
15
+ reactive state on the TC39 Signals for the observation by the infrastructure.
15
16
 
16
- **Capabilities:** Implements both [@xmachines/play-actor!Routable](../../play-actor/interfaces/Routable.md) and
17
- [@xmachines/play-actor!Viewable](../../play-actor/interfaces/Viewable.md) interfaces, providing routing and view
18
- rendering support.
17
+ **Capabilities:** the class implements both the
18
+ [@xmachines/play-actor!Routable](../../play-actor/interfaces/Routable.md) interface and the
19
+ [@xmachines/play-actor!Viewable](../../play-actor/interfaces/Viewable.md) interface. It therefore supports the
20
+ routing and the view rendering.
19
21
 
20
- **Architectural Context:** Implements **Actor Authority (INV-01)** by ensuring the
21
- XState machine's guards control all navigation decisions. Infrastructure observes
22
- the actor's signals (`state`, `currentRoute`, `currentView`) but cannot directly
23
- manipulate state—all mutations flow through the state machine's event handlers.
22
+ **Architectural context:** the class implements **Actor Authority (INV-01)**,
23
+ because the guards of the XState machine control every decision of the
24
+ navigation. The infrastructure observes the signals of the actor (`state`,
25
+ `currentRoute`, and `currentView`), but it changes no state directly: every
26
+ change goes through the event handlers of the state machine.
24
27
 
25
28
  ## Examples
26
29
 
27
- Basic actor creation and lifecycle
30
+ The creation of an actor, and its lifecycle
28
31
 
29
32
  ```typescript
30
33
  import { setup } from "xstate";
@@ -36,7 +39,7 @@ const machine = setup({}).createMachine({
36
39
  idle: {
37
40
  meta: {
38
41
  route: "/",
39
- // A view spec needs `root` and `elements` other shapes derive null.
42
+ // A view spec needs `root` and `elements`. Every other shape derives null.
40
43
  view: {
41
44
  root: "home",
42
45
  elements: { home: { type: "HomePage", props: {}, children: [] } },
@@ -50,12 +53,12 @@ const createPlayer = definePlayer({ machine });
50
53
  const actor = createPlayer();
51
54
  actor.start();
52
55
 
53
- // Observe signals
56
+ // Observe the signals
54
57
  console.log(actor.currentRoute.get()); // '/'
55
58
  console.log(actor.currentView.get()?.root); // 'home'
56
59
  ```
57
60
 
58
- Signal lifecycle with watchers
61
+ The signal lifecycle with a watcher
59
62
 
60
63
  ```typescript
61
64
  import { Signal } from "@xmachines/play-signals";
@@ -69,26 +72,28 @@ const watcher = new Signal.subtle.Watcher(() => {
69
72
 
70
73
  watcher.watch(actor.state);
71
74
  actor.send({ type: "play.route", to: "#about" });
72
- // Watcher notification scheduled via microtask by the watcher itself
75
+ // The watcher schedules its own notification in a microtask
73
76
  ```
74
77
 
75
78
  ## See
76
79
 
77
80
  - [Play RFC](../../../../rfc/play.md)
78
- - [definePlayer](../functions/definePlayer.md) for factory creation
79
- - [@xmachines/play-actor!AbstractActor](../../play-actor/classes/AbstractActor.md) for signal protocol
80
- - [@xmachines/play-actor!Routable](../../play-actor/interfaces/Routable.md) for routing capability
81
- - [@xmachines/play-actor!Viewable](../../play-actor/interfaces/Viewable.md) for view rendering capability
81
+ - [definePlayer](../functions/definePlayer.md) for the creation through a factory
82
+ - [@xmachines/play-actor!AbstractActor](../../play-actor/classes/AbstractActor.md) for the signal protocol
83
+ - [@xmachines/play-actor!Routable](../../play-actor/interfaces/Routable.md) for the routing capability
84
+ - [@xmachines/play-actor!Viewable](../../play-actor/interfaces/Viewable.md) for the view rendering capability
82
85
 
83
86
  ## Remarks
84
87
 
85
- **Routing:** This actor supports both XState's `route: {}` config pattern
86
- and `play.route` events with parameters. The `deriveRoute()` function checks
87
- `meta.route` (Stately pattern) for URL templates with parameter substitution support.
88
+ **The routing:** this actor supports the `route: {}` config pattern of XState and
89
+ also a `play.route` event with parameters. The `deriveRoute()` function reads
90
+ `meta.route`, which is the Stately pattern, for a URL template, and it substitutes
91
+ each parameter.
88
92
 
89
- **View Signal Pattern:** The `currentView` signal is a direct `Signal.State` (not
90
- `Signal.Computed`) to ensure proper watcher propagation in PlayRenderer. Views are
91
- cached and updated at state entry, not computed on every read.
93
+ **The pattern of the view signal:** the `currentView` signal is a direct
94
+ `Signal.State`, and not a `Signal.Computed`. The propagation to a watcher in
95
+ PlayRenderer is therefore correct. The class derives each view at the entry of a
96
+ state and keeps it, and it computes no view on a read.
92
97
 
93
98
  ## Extends
94
99
 
@@ -96,9 +101,9 @@ cached and updated at state entry, not computed on every read.
96
101
 
97
102
  ## Type Parameters
98
103
 
99
- | Type Parameter | Description |
100
- | ---------------------------------------------------------------------------------------------- | ---------------------------- |
101
- | `TMachine` _extends_ [`AnyStateMachine`](https://www.jsdocs.io/package/xstate#AnyStateMachine) | XState v5 state machine type |
104
+ | Type Parameter | Description |
105
+ | ---------------------------------------------------------------------------------------------- | --------------------------------------- |
106
+ | `TMachine` _extends_ [`AnyStateMachine`](https://www.jsdocs.io/package/xstate#AnyStateMachine) | The type of the XState v5 state machine |
102
107
 
103
108
  ## Implements
104
109
 
@@ -117,7 +122,7 @@ new PlayerActor<TMachine>(
117
122
  restoredSnapshot?): PlayerActor<TMachine>;
118
123
  ```
119
124
 
120
- Defined in: [packages/play-xstate/src/player-actor.ts:342](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-xstate/src/player-actor.ts#L342)
125
+ Defined in: [packages/play-xstate/src/player-actor.ts:360](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-xstate/src/player-actor.ts#L360)
121
126
 
122
127
  #### Parameters
123
128
 
@@ -138,22 +143,22 @@ Defined in: [packages/play-xstate/src/player-actor.ts:342](https://gitlab.com/xm
138
143
 
139
144
  ## Properties
140
145
 
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:289](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-xstate/src/player-actor.ts#L289) |
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` carries the machine's context in its composed `state` under the read-only `/context` subtree, so specs read context URL params included through the ordinary state grammar (`{ $state: "/context/params/section" }`). See `@xmachines/play-actor`'s context-projection module for the full contract. 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:340](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-xstate/src/player-actor.ts#L340) |
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:306](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-xstate/src/player-actor.ts#L306) |
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:249](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-xstate/src/player-actor.ts#L249) |
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) | - |
146
+ | Property | Modifier | Type | Description | Overrides | Inherited from | Defined in |
147
+ | ------------------------------------------------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
148
+ | <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) | - |
149
+ | <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) | - |
150
+ | <a id="property-currentroute"></a> `currentRoute` | `public` | [`Computed`](../../play-signals/namespaces/Signal/classes/Computed.md)\<`string` \| `null`\> | A TC39 `Signal.Computed`. It derives the current URL path from the `meta.route` template of the active machine state and from the context of the actor. It returns `null` when the current state has no `meta.route` field, and also when it cannot resolve the complete route template. A necessary `:param` that the context does not hold is caught inside the signal, and a `MissingRouteParamError` therefore never leaves `get()`: that condition is temporary during a transition, and the signal computes the value again on the next snapshot. **Example** `// It returns "/profile/alice" when context.params.userId === "alice", // and null while the param is still absent. const route = actor.currentRoute.get();` | - | - | [packages/play-xstate/src/player-actor.ts:304](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-xstate/src/player-actor.ts#L304) |
151
+ | <a id="property-currentview"></a> `currentView` | `readonly` | [`State`](../../play-signals/namespaces/Signal/classes/State.md)\<[`PlaySpec`](../../play-actor/interfaces/PlaySpec.md) \| `null`\> | The reactive signal of the current view spec. The signal derives the spec from the `meta.view` metadata of the active state. It emits a **new object reference** on each real change of the view on the screen: the view of a different state, or a change of a param or of the context that changes the resolved spec. A re-entry with `reenter: true` and new params also changes the spec. A snapshot that changes no view on the screen, such as an assign of the context alone, keeps the previous reference. A provider below the signal therefore mounts the UI again not on every event. The `PlaySpec` of the emission carries the context of the machine in its composed `state` field, under the read-only `/context` subtree. A spec therefore reads the context, and also each URL param, through the ordinary state grammar (`{ $state: "/context/params/section" }`). The context-projection module of `@xmachines/play-actor` holds the complete contract. The signal returns `null` when the current state has no `meta.view` metadata. Two states can declare two separate `meta.view` literals with an identical structure. A transition between those two states then emits two different references, and a provider mounts the UI again. Move the shared literal into one `typedSpec` constant, and the identity then removes the duplicate. **Example** `const view = actor.currentView.get(); if (view) { console.log(view.root); // for example "root" console.log(view.elements); // the Spec elements of @xmachines/json-render-core }` | - | - | [packages/play-xstate/src/player-actor.ts:358](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-xstate/src/player-actor.ts#L358) |
152
+ | <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) | - |
153
+ | <a id="property-initialroute"></a> `initialRoute` | `readonly` | `string` \| `null` | The route of the initial state of the machine. The constructor fixes it, and it never changes, also when the code restores the actor from a snapshot. A router bridge compares it with the browser URL, and it therefore separates a deep link (a URL that is not the initial one the router wins) from a restore (the initial URL, and the actor at a different route from the restore the actor wins). `deriveInitialRoute` derives the value statically from the machine definition, with the pure `initialTransition` helper of XState: the chain of the initial states and their `meta.route` templates are fixed at the moment of the machine definition, and the substitution of a `:param` uses the real initial context of the machine for the `input` of this actor. The code makes no second actor, and a snapshot of a restore changes the value never: it is always the **default** initial route of the machine. | - | - | [packages/play-xstate/src/player-actor.ts:323](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-xstate/src/player-actor.ts#L323) |
154
+ | <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) | - |
155
+ | <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) | - |
156
+ | <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) | - |
157
+ | <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) | - |
158
+ | <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) | - |
159
+ | <a id="property-state"></a> `state` | `public` | [`State`](../../play-signals/namespaces/Signal/classes/State.md)\<`ReturnType`\<`TMachine`\[`"transition"`\]\>\> | The reactive snapshot of the current actor state. The infrastructure observes this signal, and it reacts to each state change. It therefore holds no coupling to the internal state machine of the actor. | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`state`](../../play-actor/classes/AbstractActor.md#property-state) | - | [packages/play-xstate/src/player-actor.ts:263](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-xstate/src/player-actor.ts#L263) |
160
+ | <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) | - |
161
+ | <a id="property-systemid"></a> `systemId` | `public` | `string` \| `undefined` | - | - | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`systemId`](../../play-actor/classes/AbstractActor.md#property-systemid) | - |
157
162
 
158
163
  ## Methods
159
164
 
@@ -181,12 +186,12 @@ Defined in: `xstate`
181
186
  can(event): boolean;
182
187
  ```
183
188
 
184
- Defined in: [packages/play-xstate/src/player-actor.ts:262](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-xstate/src/player-actor.ts#L262)
189
+ Defined in: [packages/play-xstate/src/player-actor.ts:276](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-xstate/src/player-actor.ts#L276)
185
190
 
186
- Returns whether the actor's current state can accept the given event.
191
+ Tells you if the current state of the actor accepts the given event.
187
192
 
188
- Typed to the machine's event union passing an unknown event type is a
189
- compile error. Evaluated against the current snapshot signal.
193
+ The type is the event union of the machine. An unknown event type is therefore a
194
+ compile error. The method evaluates the event against the snapshot signal.
190
195
 
191
196
  #### Parameters
192
197
 
@@ -206,20 +211,24 @@ if (actor.can({ type: "auth.logout" })) { ... }
206
211
 
207
212
  ---
208
213
 
209
- ### dispose()
214
+ ### ~~dispose()~~
210
215
 
211
216
  ```ts
212
217
  dispose(): void;
213
218
  ```
214
219
 
215
- Defined in: [packages/play-xstate/src/player-actor.ts:722](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-xstate/src/player-actor.ts#L722)
220
+ Defined in: [packages/play-xstate/src/player-actor.ts:751](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-xstate/src/player-actor.ts#L751)
216
221
 
217
- Convenience dispose method for cleanup an alias for [stop](#stop).
222
+ The dispose method, for the cleanup. It is the alias of [stop](#stop).
218
223
 
219
224
  #### Returns
220
225
 
221
226
  `void`
222
227
 
228
+ #### Deprecated
229
+
230
+ Use [stop](#stop). Will be removed in the next major.
231
+
223
232
  ---
224
233
 
225
234
  ### getPersistedSnapshot()
@@ -228,12 +237,12 @@ Convenience dispose method for cleanup — an alias for [stop](#stop).
228
237
  getPersistedSnapshot(options?): Snapshot<unknown>;
229
238
  ```
230
239
 
231
- Defined in: [packages/play-xstate/src/player-actor.ts:671](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-xstate/src/player-actor.ts#L671)
240
+ Defined in: [packages/play-xstate/src/player-actor.ts:696](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-xstate/src/player-actor.ts#L696)
232
241
 
233
- Get this actor's persisted snapshot.
242
+ Returns the persisted snapshot of this actor.
234
243
 
235
- Suitable for serialization and later restoration via the factory's
236
- `restore.snapshot` option.
244
+ Use it to serialize the state, and to restore it later with the
245
+ `restore.snapshot` option of the factory.
237
246
 
238
247
  #### Parameters
239
248
 
@@ -257,9 +266,9 @@ Suitable for serialization and later restoration via the factory's
257
266
  getSnapshot(): SnapshotFrom<TMachine>;
258
267
  ```
259
268
 
260
- Defined in: [packages/play-xstate/src/player-actor.ts:569](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-xstate/src/player-actor.ts#L569)
269
+ Defined in: [packages/play-xstate/src/player-actor.ts:595](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-xstate/src/player-actor.ts#L595)
261
270
 
262
- Get current snapshot
271
+ Returns the current snapshot
263
272
 
264
273
  #### Returns
265
274
 
@@ -277,9 +286,9 @@ Get current snapshot
277
286
  on<TType>(type, handler): Subscription;
278
287
  ```
279
288
 
280
- Defined in: [packages/play-xstate/src/player-actor.ts:656](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-xstate/src/player-actor.ts#L656)
289
+ Defined in: [packages/play-xstate/src/player-actor.ts:681](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-xstate/src/player-actor.ts#L681)
281
290
 
282
- Listen for events this actor emits via the `emit` action.
291
+ Listens for the events that this actor emits with the `emit` action.
283
292
 
284
293
  #### Type Parameters
285
294
 
@@ -289,16 +298,16 @@ Listen for events this actor emits via the `emit` action.
289
298
 
290
299
  #### Parameters
291
300
 
292
- | Parameter | Type | Description |
293
- | --------- | --------------------- | --------------------------------------------------- |
294
- | `type` | `TType` | Emitted event type to listen for, or `"*"` for all. |
295
- | `handler` | (`emitted`) => `void` | Called with each matching emitted event. |
301
+ | Parameter | Type | Description |
302
+ | --------- | --------------------- | ---------------------------------------------------------------------- |
303
+ | `type` | `TType` | The type of the emitted event to listen for, or `"*"` for every event. |
304
+ | `handler` | (`emitted`) => `void` | The actor calls it with each emitted event that matches. |
296
305
 
297
306
  #### Returns
298
307
 
299
308
  [`Subscription`](https://www.jsdocs.io/package/xstate#Subscription)
300
309
 
301
- Subscription with an `unsubscribe()` method.
310
+ The subscription, with an `unsubscribe()` method.
302
311
 
303
312
  #### Overrides
304
313
 
@@ -343,18 +352,19 @@ Defined in: `xstate`
343
352
  send(event): void;
344
353
  ```
345
354
 
346
- Defined in: [packages/play-xstate/src/player-actor.ts:531](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-xstate/src/player-actor.ts#L531)
355
+ Defined in: [packages/play-xstate/src/player-actor.ts:556](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-xstate/src/player-actor.ts#L556)
347
356
 
348
- Send an event to this actor.
357
+ Sends an event to this actor.
349
358
 
350
- The actor's state machine guards decide whether the event causes a transition.
351
- Pass any event from the machine's event union domain events, routing events, etc.
359
+ The guards of the state machine of the actor decide if the event causes a
360
+ transition. Give any event of the event union of the machine: a domain event, a
361
+ routing event, and so on.
352
362
 
353
363
  #### Parameters
354
364
 
355
- | Parameter | Type | Description |
356
- | --------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
357
- | `event` | [`EventFromLogic`](https://www.jsdocs.io/package/xstate#EventFromLogic)\<`TMachine`\> | An event from the machine's `EventFromLogic<TMachine>` union. |
365
+ | Parameter | Type | Description |
366
+ | --------- | ------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |
367
+ | `event` | [`EventFromLogic`](https://www.jsdocs.io/package/xstate#EventFromLogic)\<`TMachine`\> | An event of the `EventFromLogic<TMachine>` union of the machine. |
358
368
 
359
369
  #### Returns
360
370
 
@@ -362,16 +372,17 @@ Pass any event from the machine's event union — domain events, routing events,
362
372
 
363
373
  #### Throws
364
374
 
365
- When `event` is not a plain object (`null`, `undefined`,
366
- a string, number, etc.). Import the class from `@xmachines/play-xstate/errors`.
375
+ When `event` is not a plain object, for example
376
+ `null`, `undefined`, a string, or a number. Import the class from
377
+ `@xmachines/play-xstate/errors`.
367
378
 
368
379
  #### Example
369
380
 
370
381
  ```typescript
371
- // Domain event (typed to machine's event union)
382
+ // A domain event, with the type of the event union of the machine
372
383
  actor.send({ type: "auth.login", userId: "123" });
373
384
 
374
- // Routing event
385
+ // A routing event
375
386
  actor.send({ type: "play.route", to: "#home" });
376
387
  ```
377
388
 
@@ -387,15 +398,15 @@ actor.send({ type: "play.route", to: "#home" });
387
398
  start(): this;
388
399
  ```
389
400
 
390
- Defined in: [packages/play-xstate/src/player-actor.ts:459](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-xstate/src/player-actor.ts#L459)
401
+ Defined in: [packages/play-xstate/src/player-actor.ts:482](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-xstate/src/player-actor.ts#L482)
391
402
 
392
- Start the actor.
403
+ Starts the actor.
393
404
 
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.
405
+ The method fires `onStart` on each real start, which is every transition from
406
+ "not running" to "running". A start after a stop is such a transition, and XState
407
+ permits it: its own `start()` stops only while the actor RUNS already. A second
408
+ call while the actor runs fires no hook. Therefore a defensive double mount runs
409
+ the side effects of `onStart` one time for one real start.
399
410
 
400
411
  #### Returns
401
412
 
@@ -413,16 +424,16 @@ re-run `onStart` side effects for one actual start.
413
424
  stop(): this;
414
425
  ```
415
426
 
416
- Defined in: [packages/play-xstate/src/player-actor.ts:489](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-xstate/src/player-actor.ts#L489)
427
+ Defined in: [packages/play-xstate/src/player-actor.ts:512](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-xstate/src/player-actor.ts#L512)
417
428
 
418
- Stop the actor and clean up.
429
+ Stops the actor and cleans up.
419
430
 
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.
431
+ The method fires `onStop` only when the actor ran. This matches XState, where a
432
+ stop of an actor that never started, or of an actor that stopped already, does
433
+ nothing and tears nothing down. Therefore the paired cleanup runs never two
434
+ times, and it runs never against a resource that `onStart` did not take. A stop
435
+ does not close the actor for ever: a later `start()` is a new lifecycle, and it
436
+ fires `onStart` again.
426
437
 
427
438
  #### Returns
428
439
 
@@ -442,23 +453,23 @@ actor for good: a later `start()` is a fresh lifecycle and fires
442
453
  subscribe(observer): Subscription;
443
454
  ```
444
455
 
445
- Defined in: [packages/play-xstate/src/player-actor.ts:593](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-xstate/src/player-actor.ts#L593)
456
+ Defined in: [packages/play-xstate/src/player-actor.ts:618](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-xstate/src/player-actor.ts#L618)
446
457
 
447
- Subscribe to this actor's snapshot updates.
458
+ Subscribes to the snapshot updates of this actor.
448
459
 
449
- Accepts an observer object, exactly like XState's `Actor.subscribe`.
460
+ The method accepts an observer object, exactly like `Actor.subscribe` of XState.
450
461
 
451
462
  ##### Parameters
452
463
 
453
- | Parameter | Type | Description |
454
- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- |
455
- | `observer` | [`Observer`](https://www.jsdocs.io/package/xstate#Observer)\<[`SnapshotFrom`](https://www.jsdocs.io/package/xstate#SnapshotFrom)\<`TMachine`\>\> | Observer with `next`/`error`/`complete` handlers. |
464
+ | Parameter | Type | Description |
465
+ | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------ |
466
+ | `observer` | [`Observer`](https://www.jsdocs.io/package/xstate#Observer)\<[`SnapshotFrom`](https://www.jsdocs.io/package/xstate#SnapshotFrom)\<`TMachine`\>\> | The observer, with a `next`, an `error`, and a `complete` handler. |
456
467
 
457
468
  ##### Returns
458
469
 
459
470
  [`Subscription`](https://www.jsdocs.io/package/xstate#Subscription)
460
471
 
461
- Subscription with an `unsubscribe()` method.
472
+ The subscription, with an `unsubscribe()` method.
462
473
 
463
474
  ##### Overrides
464
475
 
@@ -473,25 +484,25 @@ subscribe(
473
484
  completeListener?): Subscription;
474
485
  ```
475
486
 
476
- Defined in: [packages/play-xstate/src/player-actor.ts:604](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-xstate/src/player-actor.ts#L604)
487
+ Defined in: [packages/play-xstate/src/player-actor.ts:629](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-xstate/src/player-actor.ts#L629)
477
488
 
478
- Subscribe to this actor's snapshot updates.
489
+ Subscribes to the snapshot updates of this actor.
479
490
 
480
- Accepts listener functions, exactly like XState's `Actor.subscribe`.
491
+ The method accepts listener functions, exactly like `Actor.subscribe` of XState.
481
492
 
482
493
  ##### Parameters
483
494
 
484
- | Parameter | Type | Description |
485
- | ------------------- | ---------------------- | -------------------------------------------------------- |
486
- | `nextListener?` | (`snapshot`) => `void` | Snapshot listener function. |
487
- | `errorListener?` | (`error`) => `void` | Called when the actor errors. |
488
- | `completeListener?` | () => `void` | Called when the actor completes (reaches a final state). |
495
+ | Parameter | Type | Description |
496
+ | ------------------- | ---------------------- | -------------------------------------------------------------------------------- |
497
+ | `nextListener?` | (`snapshot`) => `void` | The listener function of each snapshot. |
498
+ | `errorListener?` | (`error`) => `void` | The actor calls it on an error. |
499
+ | `completeListener?` | () => `void` | The actor calls it when it completes, which means that it reaches a final state. |
489
500
 
490
501
  ##### Returns
491
502
 
492
503
  [`Subscription`](https://www.jsdocs.io/package/xstate#Subscription)
493
504
 
494
- Subscription with an `unsubscribe()` method.
505
+ The subscription, with an `unsubscribe()` method.
495
506
 
496
507
  ##### Overrides
497
508