@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
@@ -6,35 +6,38 @@
6
6
  function buildRouteUrl(routeTemplate, context?): string;
7
7
  ```
8
8
 
9
- Defined in: [packages/play-xstate/src/routing/build-url.ts:35](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-xstate/src/routing/build-url.ts#L35)
9
+ Defined in: [packages/play-xstate/src/routing/build-url.ts:38](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-xstate/src/routing/build-url.ts#L38)
10
10
 
11
- Build a full URL from a route template and the actor's context.
11
+ Builds a complete URL from a route template and the context of the actor.
12
12
 
13
- Substitutes `:param` and `:param?` placeholders from `context.params`,
14
- then appends query params and hash fragments.
13
+ The function replaces each `:param` placeholder and each `:param?` placeholder
14
+ with a value of `context.params`. It then appends the query params and the hash
15
+ fragment.
15
16
 
16
- All parameter values must be in `context.params`. Flat context fields are not
17
- inspected this is intentional so misspelled placeholders produce a compile-time
18
- error rather than silently resolving to `undefined`.
17
+ Every parameter value must be in `context.params`. The function reads no flat
18
+ context field, and this is deliberate: a placeholder with a spelling error
19
+ therefore gives a compile-time error, and it does not resolve to `undefined` in
20
+ silence.
19
21
 
20
22
  ## Parameters
21
23
 
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: {}`. |
24
+ | Parameter | Type | Description |
25
+ | --------------- | ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
26
+ | `routeTemplate` | `string` | The template of the route path, for example `"/profile/:userId"` or `"/settings/:section?"`. |
27
+ | `context` | [`RouteContext`](../interfaces/RouteContext.md) | The context object of the actor. Each route parameter must be in `context.params`, because the function reads no flat context field. An absent `query` field builds a URL without a query, exactly like `query: {}`. |
26
28
 
27
29
  ## Returns
28
30
 
29
31
  `string`
30
32
 
31
- The fully resolved URL string.
33
+ The complete URL string.
32
34
 
33
35
  ## Throws
34
36
 
35
- When a **required** `:param` placeholder has no
36
- matching value in context. Optional parameters (`:param?`) are silently omitted
37
- when missing. Import the class from `@xmachines/play-xstate/errors`.
37
+ When a **necessary** `:param` placeholder has no
38
+ value in the context. The function omits an optional parameter (`:param?`) in
39
+ silence when its value is absent. Import the class from
40
+ `@xmachines/play-xstate/errors`.
38
41
 
39
42
  ## Example
40
43
 
@@ -43,5 +46,5 @@ buildRouteUrl("/user/:id", { params: { id: "123" }, query: { tab: "profile" }, h
43
46
  // → "/user/123?tab=profile#top"
44
47
 
45
48
  buildRouteUrl("/settings/:section?", { params: {}, query: {} });
46
- // → "/settings" (optional param omitted, no query string)
49
+ // → "/settings" (the optional param is absent, and there is no query string)
47
50
  ```
@@ -6,44 +6,46 @@
6
6
  function composeGuards<TContext, TEvent>(guards): ComposedGuard;
7
7
  ```
8
8
 
9
- Defined in: [packages/play-xstate/src/guards/compose.ts:97](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-xstate/src/guards/compose.ts#L97)
9
+ Defined in: [packages/play-xstate/src/guards/compose.ts:100](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-xstate/src/guards/compose.ts#L100)
10
10
 
11
- Compose guards with AND logic using XState's and() helper
11
+ Composes the guards with the AND logic, through the and() helper of XState
12
12
 
13
- Combines multiple guard predicates using AND semantics—all guards must pass for
14
- the composition to succeed. Uses XState's built-in `and()` helper to ensure proper
15
- type inference and machine serialization.
13
+ The function joins more than one guard predicate with the AND semantics: every
14
+ guard must pass, and the composition then succeeds. It uses the built-in `and()`
15
+ helper of XState. The type inference and the serialization of the machine are
16
+ therefore correct.
16
17
 
17
- **Architectural Context:** Supports **Actor Authority (INV-01)** by enabling
18
- declarative guard composition in state machine transitions. Guards enforce business
19
- logic rules that determine whether navigation or actions are valid.
18
+ **Architectural context:** the function supports **Actor Authority (INV-01)**,
19
+ because it composes the guards of a state machine transition declaratively. A
20
+ guard enforces a rule of the business logic, and that rule decides if a
21
+ navigation or an action is valid.
20
22
 
21
23
  ## Type Parameters
22
24
 
23
- | Type Parameter | Default type | Description |
24
- | -------------- | ------------ | -------------------------- |
25
- | `TContext` | `any` | State machine context type |
26
- | `TEvent` | `any` | Event type |
25
+ | Type Parameter | Default type | Description |
26
+ | -------------- | ------------ | ------------------------------------- |
27
+ | `TContext` | `any` | The context type of the state machine |
28
+ | `TEvent` | `any` | The event type |
27
29
 
28
30
  ## Parameters
29
31
 
30
- | Parameter | Type | Description |
31
- | --------- | --------------------------------------------------------------------- | ------------------------------------------------------------ |
32
- | `guards` | [`GuardArray`](../type-aliases/GuardArray.md)\<`TContext`, `TEvent`\> | Array of guard predicates or guard names (string references) |
32
+ | Parameter | Type | Description |
33
+ | --------- | --------------------------------------------------------------------- | ------------------------------------------------------------------- |
34
+ | `guards` | [`GuardArray`](../type-aliases/GuardArray.md)\<`TContext`, `TEvent`\> | The array of the guard predicates, or of the guard names as strings |
33
35
 
34
36
  ## Returns
35
37
 
36
38
  [`ComposedGuard`](../type-aliases/ComposedGuard.md)
37
39
 
38
- XState and() guard composition
40
+ The and() guard composition of XState
39
41
 
40
42
  ## Throws
41
43
 
42
- If guards array is empty
44
+ When the array of the guards is empty
43
45
 
44
46
  ## Examples
45
47
 
46
- AND composition with named guards
48
+ An AND composition with named guards
47
49
 
48
50
  ```typescript
49
51
  import { setup } from "xstate";
@@ -65,7 +67,7 @@ const machine = setup({
65
67
  });
66
68
  ```
67
69
 
68
- AND composition with inline predicates
70
+ An AND composition with inline predicates
69
71
 
70
72
  ```typescript
71
73
  import { composeGuards } from "@xmachines/play-xstate";
@@ -75,10 +77,10 @@ guard: composeGuards([({ context }) => context.age >= 18, ({ context }) => conte
75
77
 
76
78
  ## See
77
79
 
78
- - [composeGuardsOr](composeGuardsOr.md) for OR composition
79
- - [negateGuard](negateGuard.md) for NOT logic
80
+ - [composeGuardsOr](composeGuardsOr.md) for the OR composition
81
+ - [negateGuard](negateGuard.md) for the NOT logic
80
82
 
81
83
  ## Deprecated
82
84
 
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.
85
+ Use the `and()`, `or()`, and `not()` combinators of XState directly. This helper
86
+ does not compose with a guard slot that `setup()` types, and the next major version removes it.
@@ -6,40 +6,40 @@
6
6
  function composeGuardsOr<TContext, TEvent>(guards): ComposedGuard;
7
7
  ```
8
8
 
9
- Defined in: [packages/play-xstate/src/guards/compose.ts:156](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-xstate/src/guards/compose.ts#L156)
9
+ Defined in: [packages/play-xstate/src/guards/compose.ts:159](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-xstate/src/guards/compose.ts#L159)
10
10
 
11
- Compose guards with OR logic using XState's or() helper
11
+ Composes the guards with the OR logic, through the or() helper of XState
12
12
 
13
- Combines multiple guard predicates using OR semantics—at least one guard must pass
14
- for the composition to succeed. Uses XState's built-in `or()` helper for proper
15
- type inference.
13
+ The function joins more than one guard predicate with the OR semantics: one guard
14
+ must pass at least, and the composition then succeeds. It uses the built-in `or()`
15
+ helper of XState, and the type inference is therefore correct.
16
16
 
17
17
  ## Type Parameters
18
18
 
19
- | Type Parameter | Default type | Description |
20
- | -------------- | ------------ | -------------------------- |
21
- | `TContext` | `any` | State machine context type |
22
- | `TEvent` | `any` | Event type |
19
+ | Type Parameter | Default type | Description |
20
+ | -------------- | ------------ | ------------------------------------- |
21
+ | `TContext` | `any` | The context type of the state machine |
22
+ | `TEvent` | `any` | The event type |
23
23
 
24
24
  ## Parameters
25
25
 
26
- | Parameter | Type | Description |
27
- | --------- | --------------------------------------------------------------------- | ---------------------------------------- |
28
- | `guards` | [`GuardArray`](../type-aliases/GuardArray.md)\<`TContext`, `TEvent`\> | Array of guard predicates or guard names |
26
+ | Parameter | Type | Description |
27
+ | --------- | --------------------------------------------------------------------- | -------------------------------------------------------- |
28
+ | `guards` | [`GuardArray`](../type-aliases/GuardArray.md)\<`TContext`, `TEvent`\> | The array of the guard predicates, or of the guard names |
29
29
 
30
30
  ## Returns
31
31
 
32
32
  [`ComposedGuard`](../type-aliases/ComposedGuard.md)
33
33
 
34
- XState or() guard composition
34
+ The or() guard composition of XState
35
35
 
36
36
  ## Throws
37
37
 
38
- If guards array is empty
38
+ When the array of the guards is empty
39
39
 
40
40
  ## Example
41
41
 
42
- OR composition with named guards
42
+ An OR composition with named guards
43
43
 
44
44
  ```typescript
45
45
  import { setup } from "xstate";
@@ -53,7 +53,7 @@ const machine = setup({
53
53
  }).createMachine({
54
54
  on: {
55
55
  deleteResource: {
56
- // Either guard can pass
56
+ // One guard is sufficient
57
57
  guard: composeGuardsOr(["isOwner", "isAdmin"]),
58
58
  actions: "delete",
59
59
  },
@@ -63,10 +63,10 @@ const machine = setup({
63
63
 
64
64
  ## See
65
65
 
66
- - [composeGuards](composeGuards.md) for AND composition
67
- - [negateGuard](negateGuard.md) for NOT logic
66
+ - [composeGuards](composeGuards.md) for the AND composition
67
+ - [negateGuard](negateGuard.md) for the NOT logic
68
68
 
69
69
  ## Deprecated
70
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.
71
+ Use the `and()`, `or()`, and `not()` combinators of XState directly. This helper
72
+ does not compose with a guard slot that `setup()` types, and the next major version removes it.
@@ -6,17 +6,17 @@
6
6
  function contextFieldMatches<TContext>(fieldPath, expectedValue): Guard<TContext, PlayEvent>;
7
7
  ```
8
8
 
9
- Defined in: [packages/play-xstate/src/guards/helpers.ts:75](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-xstate/src/guards/helpers.ts#L75)
9
+ Defined in: [packages/play-xstate/src/guards/helpers.ts:75](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-xstate/src/guards/helpers.ts#L75)
10
10
 
11
- Check if a context field matches an expected value.
11
+ Tells you if a context field holds the expected value.
12
12
 
13
- - Accepts an explicit dot-separated field path (e.g. `"user.role"`)
14
- - Uses strict equality for primitives, deep structural equality for objects
15
- - Object comparison is key-order-insensitive: `{a:1,b:2}` equals `{b:2,a:1}`
16
- - Supports Date, RegExp, class instances, nested objects and arrays via `dequal/lite`
17
- - Does NOT use substring matching — `"a"` will not match `"active"`
13
+ - The function accepts an explicit field path, with a dot between two segments, for example `"user.role"`
14
+ - It compares a primitive with a strict equality, and an object with a deep structural equality
15
+ - The order of the keys has no effect on the comparison of an object: `{a:1,b:2}` equals `{b:2,a:1}`
16
+ - It supports a Date, a RegExp, an instance of a class, a nested object, and an array, through `dequal/lite`
17
+ - It does NOT match a substring: `"a"` does not match `"active"`
18
18
 
19
- For XState state-node matching, use the built-in `in:` guard syntax instead.
19
+ For a match of an XState state node, use the built-in `in:` guard syntax instead.
20
20
 
21
21
  ## Type Parameters
22
22
 
@@ -26,18 +26,18 @@ For XState state-node matching, use the built-in `in:` guard syntax instead.
26
26
 
27
27
  ## Parameters
28
28
 
29
- | Parameter | Type | Description |
30
- | --------------- | --------- | -------------------------------------------------------------------- |
31
- | `fieldPath` | `string` | Dot-separated path to context property (e.g., "status", "user.role") |
32
- | `expectedValue` | `unknown` | Value to compare against (string, object, Date, etc.) |
29
+ | Parameter | Type | Description |
30
+ | --------------- | --------- | ------------------------------------------------------------------------------------------------------ |
31
+ | `fieldPath` | `string` | The path to the context property, with a dot between two segments, for example "status" or "user.role" |
32
+ | `expectedValue` | `unknown` | The value for the comparison: a string, an object, a Date, and so on |
33
33
 
34
34
  ## Returns
35
35
 
36
36
  [`Guard`](../type-aliases/Guard.md)\<`TContext`, [`PlayEvent`](../../play/type-aliases/PlayEvent.md)\>
37
37
 
38
- Guard predicate checking if context field matches
38
+ The guard predicate. It tests the context field for the value
39
39
 
40
40
  ## Deprecated
41
41
 
42
- Part of the guard utilities slated for removal in the next major
43
- write a plain typed predicate instead.
42
+ This function is part of the guard utilities, and the next major version removes
43
+ them. Write a plain typed predicate instead.
@@ -6,36 +6,36 @@
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/v2.0.0/packages/play-xstate/src/define-player.ts#L61)
9
+ Defined in: [packages/play-xstate/src/define-player.ts:61](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-xstate/src/define-player.ts#L61)
10
10
 
11
- Create a player factory from an XState machine
11
+ Creates a player factory from an XState machine
12
12
 
13
- Factory pattern that accepts an XState v5 machine,
14
- returning a function that creates [PlayerActor](../classes/PlayerActor.md) instances. This enables
15
- creating multiple actor instances from a single configuration, useful for
16
- testing, multi-instance scenarios, or server-side rendering.
13
+ This factory function accepts an XState v5 machine. It returns a function that
14
+ makes [PlayerActor](../classes/PlayerActor.md) instances. One configuration can therefore make more
15
+ than one actor instance, and this helps with a test, with an application of
16
+ several instances, and with a render on the server.
17
17
 
18
18
  ## Type Parameters
19
19
 
20
- | Type Parameter | Description |
21
- | ---------------------------------------------------------------------------------------------- | ---------------------------- |
22
- | `TMachine` _extends_ [`AnyStateMachine`](https://www.jsdocs.io/package/xstate#AnyStateMachine) | XState v5 state machine type |
20
+ | Type Parameter | Description |
21
+ | ---------------------------------------------------------------------------------------------- | --------------------------------------- |
22
+ | `TMachine` _extends_ [`AnyStateMachine`](https://www.jsdocs.io/package/xstate#AnyStateMachine) | The type of the XState v5 state machine |
23
23
 
24
24
  ## Parameters
25
25
 
26
- | Parameter | Type | Description |
27
- | --------- | ------------------------------------------------------------- | --------------------------- |
28
- | `config` | [`PlayerConfig`](../interfaces/PlayerConfig.md)\<`TMachine`\> | Player configuration object |
26
+ | Parameter | Type | Description |
27
+ | --------- | ------------------------------------------------------------- | -------------------------------------- |
28
+ | `config` | [`PlayerConfig`](../interfaces/PlayerConfig.md)\<`TMachine`\> | The configuration object of the player |
29
29
 
30
30
  ## Returns
31
31
 
32
32
  [`PlayerFactory`](../type-aliases/PlayerFactory.md)\<`TMachine`\>
33
33
 
34
- Factory function that creates actor instances with optional input context
34
+ The factory function. It makes an actor instance, with an optional input context
35
35
 
36
36
  ## Examples
37
37
 
38
- Basic player factory
38
+ A basic player factory
39
39
 
40
40
  ```typescript
41
41
  import { setup } from "xstate";
@@ -54,19 +54,19 @@ const actor = createPlayer();
54
54
  actor.start();
55
55
  ```
56
56
 
57
- Multiple actor instances from single factory
57
+ More than one actor instance from one factory
58
58
 
59
59
  ```typescript
60
60
  const createPlayer = definePlayer({ machine });
61
61
 
62
- // Create actors for different users
62
+ // Create an actor for each user
63
63
  const alice = createPlayer({ userId: "alice" });
64
64
  const bob = createPlayer({ userId: "bob" });
65
65
 
66
66
  alice.start();
67
67
  bob.start();
68
68
 
69
- // Independent state machines
69
+ // The two state machines are independent
70
70
  console.log(alice.state.get() !== bob.state.get());
71
71
  ```
72
72
 
@@ -74,5 +74,5 @@ console.log(alice.state.get() !== bob.state.get());
74
74
 
75
75
  - [Play RFC](../../../../rfc/play.md)
76
76
  - [PlayerActor](../classes/PlayerActor.md) for the concrete actor implementation
77
- - [PlayerConfig](../interfaces/PlayerConfig.md) for configuration options
78
- - [PlayerFactory](../type-aliases/PlayerFactory.md) for factory function signature
77
+ - [PlayerConfig](../interfaces/PlayerConfig.md) for the configuration options
78
+ - [PlayerFactory](../type-aliases/PlayerFactory.md) for the signature of the factory function
@@ -6,34 +6,35 @@
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/v2.0.0/packages/play-xstate/src/routing/derive-route.ts#L91)
9
+ Defined in: [packages/play-xstate/src/routing/derive-route.ts:92](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-xstate/src/routing/derive-route.ts#L92)
10
10
 
11
- Derive route from XState state metadata
11
+ Derives the route from the metadata of an XState state
12
12
 
13
- Extracts route URL template from `meta.route` in the active state's metadata.
14
- Supports both string routes (`"/about"`) and object routes with path property
15
- (`{ path: "/about" }`). Returns null for states without route metadata (not
16
- all states need to be routable).
13
+ The function reads the URL template of the route from the `meta.route` field in
14
+ the metadata of the active state. It supports a string route (`"/about"`) and also
15
+ an object route with a path property (`{ path: "/about" }`). It returns null for a
16
+ state without route metadata, because not every state needs a route.
17
17
 
18
- **Architectural Context:** Implements **Actor Authority (INV-01)** by extracting
19
- routing information from state machine definitions rather than external configuration.
20
- The route is determined by the Actor's current state, not by infrastructure decisions.
18
+ **Architectural context:** the function implements **Actor Authority (INV-01)**,
19
+ because it reads the routing information from the state machine definition, and
20
+ not from an external configuration. The current state of the Actor decides the
21
+ route, and no decision of the infrastructure decides it.
21
22
 
22
23
  ## Parameters
23
24
 
24
- | Parameter | Type | Description |
25
- | ----------- | ------------------------------- | -------------------------------------- |
26
- | `stateMeta` | `Record`\<`string`, `unknown`\> | State metadata from snapshot.getMeta() |
25
+ | Parameter | Type | Description |
26
+ | ----------- | ------------------------------- | ------------------------------------------ |
27
+ | `stateMeta` | `Record`\<`string`, `unknown`\> | The state metadata from snapshot.getMeta() |
27
28
 
28
29
  ## Returns
29
30
 
30
31
  `string` \| `null`
31
32
 
32
- Route path template (may include :params) or null if no route found
33
+ The template of the route path, which can hold a :param, or null when the function finds no route
33
34
 
34
35
  ## Examples
35
36
 
36
- Basic route extraction
37
+ The basic read of a route
37
38
 
38
39
  ```typescript
39
40
  import { deriveRoute } from "@xmachines/play-xstate";
@@ -56,7 +57,7 @@ const route = deriveRoute(meta);
56
57
  console.log(route); // "/about"
57
58
  ```
58
59
 
59
- Route with parameters
60
+ A route with a parameter
60
61
 
61
62
  ```typescript
62
63
  const machine = setup({}).createMachine({
@@ -71,10 +72,10 @@ const machine = setup({}).createMachine({
71
72
  });
72
73
 
73
74
  const route = deriveRoute(snapshot.getMeta());
74
- console.log(route); // "/profile/:userId" (template, before substitution)
75
+ console.log(route); // "/profile/:userId" — the template, before the substitution
75
76
  ```
76
77
 
77
- Route object format
78
+ The object form of a route
78
79
 
79
80
  ```typescript
80
81
  const machine = setup({}).createMachine({
@@ -95,15 +96,15 @@ console.log(route); // "/dashboard"
95
96
  ## See
96
97
 
97
98
  - [Play RFC](../../../../rfc/play.md)
98
- - [buildRouteUrl](buildRouteUrl.md) for URL construction with parameter substitution
99
- - [isAbsoluteRoute](isAbsoluteRoute.md) for checking path absoluteness
99
+ - [buildRouteUrl](buildRouteUrl.md) for the construction of a URL, with the substitution of each parameter
100
+ - [isAbsoluteRoute](isAbsoluteRoute.md) for the test of an absolute path
100
101
 
101
102
  ## Remarks
102
103
 
103
- This function checks `meta.route` for route definitions. States with `route: {}` config
104
- are routable. Parameter substitution happens via [buildRouteUrl](buildRouteUrl.md), not in this
105
- function (deriveRoute returns templates).
104
+ This function reads the route definition from `meta.route`. A state with a
105
+ `route: {}` config has a route. [buildRouteUrl](buildRouteUrl.md) substitutes each parameter,
106
+ and this function does not: deriveRoute returns a template.
106
107
 
107
- **Non-routable States:** States without `meta.route` return `null`. This is intentional—
108
- not all states need routes. For example, intermediate loading states or substates may
109
- not correspond to distinct URLs.
108
+ **A state without a route:** a state without a `meta.route` field gives `null`.
109
+ This is deliberate, because not every state needs a route. An intermediate loading
110
+ state and a substate, for example, often have no URL of their own.
@@ -6,9 +6,9 @@
6
6
  function eventMatches<TEvent>(eventType): Guard<unknown, TEvent>;
7
7
  ```
8
8
 
9
- Defined in: [packages/play-xstate/src/guards/helpers.ts:52](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-xstate/src/guards/helpers.ts#L52)
9
+ Defined in: [packages/play-xstate/src/guards/helpers.ts:52](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-xstate/src/guards/helpers.ts#L52)
10
10
 
11
- Check if event type matches expected type
11
+ Tells you if the type of the event is the expected type
12
12
 
13
13
  ## Type Parameters
14
14
 
@@ -18,15 +18,15 @@ Check if event type matches expected type
18
18
 
19
19
  ## Parameters
20
20
 
21
- | Parameter | Type | Description |
22
- | ----------- | -------- | ------------------- |
23
- | `eventType` | `string` | Expected event type |
21
+ | Parameter | Type | Description |
22
+ | ----------- | -------- | ----------------------- |
23
+ | `eventType` | `string` | The expected event type |
24
24
 
25
25
  ## Returns
26
26
 
27
27
  [`Guard`](../type-aliases/Guard.md)\<`unknown`, `TEvent`\>
28
28
 
29
- Guard predicate checking event type
29
+ The guard predicate. It tests the event type
30
30
 
31
31
  ## Example
32
32
 
@@ -41,5 +41,5 @@ const machine = setup({
41
41
 
42
42
  ## Deprecated
43
43
 
44
- Part of the guard utilities slated for removal in the next major
45
- write a plain typed predicate instead.
44
+ This function is part of the guard utilities, and the next major version removes
45
+ them. Write a plain typed predicate instead.
@@ -6,14 +6,16 @@
6
6
  function formatPlayRouteTransitions<T>(machineConfig): T;
7
7
  ```
8
8
 
9
- Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:106](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-xstate/src/routing/format-play-route-transitions.ts#L106)
9
+ Defined in: [packages/play-xstate/src/routing/format-play-route-transitions.ts:112](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-xstate/src/routing/format-play-route-transitions.ts#L112)
10
10
 
11
- Formats play.route transitions from declarative route configs
11
+ Makes the play.route transitions from the declarative route configs
12
12
 
13
- Crawls machine states looking for states with meta.route and generates
14
- transitions that handle `play.route` events by matching event.to to state IDs.
13
+ The function walks the machine states. It looks for each state with a `meta.route`
14
+ field, and it generates the transitions that handle a `play.route` event: each
15
+ transition matches event.to against a state ID.
15
16
 
16
- Inspired by XState's internal formatRouteTransitions (stateUtils.ts line 391).
17
+ The internal formatRouteTransitions function of XState was the model for this
18
+ function (stateUtils.ts, line 391).
17
19
 
18
20
  ## Type Parameters
19
21
 
@@ -23,15 +25,15 @@ Inspired by XState's internal formatRouteTransitions (stateUtils.ts line 391).
23
25
 
24
26
  ## Parameters
25
27
 
26
- | Parameter | Type | Description |
27
- | --------------- | ---- | ------------------------------------------------------------------------------- |
28
- | `machineConfig` | `T` | XState machine config (before createMachine). Must extend `RouteMachineConfig`. |
28
+ | Parameter | Type | Description |
29
+ | --------------- | ---- | --------------------------------------------------------------------------------------- |
30
+ | `machineConfig` | `T` | The XState machine config, before `createMachine`. It must extend `RouteMachineConfig`. |
29
31
 
30
32
  ## Returns
31
33
 
32
34
  `T`
33
35
 
34
- The same machine config with auto-generated `play.route` handlers merged in, preserving the original type `T`.
36
+ The same machine config, with the generated `play.route` handlers in it. The original type `T` stays.
35
37
 
36
38
  ## Example
37
39
 
@@ -47,8 +49,9 @@ const machineConfig = {
47
49
  const machine = createMachine(formatPlayRouteTransitions(machineConfig));
48
50
  ```
49
51
 
50
- This automatically generates play.route handlers at the root level that:
52
+ The function generates the `play.route` handlers at the root level. Those
53
+ handlers:
51
54
 
52
- - Match event.to against state IDs (e.g., event.to === "#home")
53
- - Target the appropriate state
54
- - Assign params and query from the event to context
55
+ - match event.to against a state ID, for example event.to === "#home"
56
+ - target the correct state
57
+ - assign the params and the query of the event to the context
@@ -6,9 +6,9 @@
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/v2.0.0/packages/play-xstate/src/guards/helpers.ts#L24)
9
+ Defined in: [packages/play-xstate/src/guards/helpers.ts:24](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-xstate/src/guards/helpers.ts#L24)
10
10
 
11
- Check if context has a truthy value at path
11
+ Tells you if the context holds a value at the path, and that the value is truthy
12
12
 
13
13
  ## Type Parameters
14
14
 
@@ -18,15 +18,15 @@ Check if context has a truthy value at path
18
18
 
19
19
  ## Parameters
20
20
 
21
- | Parameter | Type | Description |
22
- | --------- | -------- | -------------------------------------- |
23
- | `path` | `string` | Dot-separated path to context property |
21
+ | Parameter | Type | Description |
22
+ | --------- | -------- | ----------------------------------------------------------------- |
23
+ | `path` | `string` | The path to the context property, with a dot between two segments |
24
24
 
25
25
  ## Returns
26
26
 
27
27
  [`Guard`](../type-aliases/Guard.md)\<`TContext`, [`PlayEvent`](../../play/type-aliases/PlayEvent.md)\>
28
28
 
29
- Guard predicate checking if property is truthy
29
+ The guard predicate. It tests the property for a truthy value
30
30
 
31
31
  ## Example
32
32
 
@@ -41,5 +41,5 @@ const machine = setup({
41
41
 
42
42
  ## Deprecated
43
43
 
44
- Part of the guard utilities slated for removal in the next major
45
- write a plain typed predicate instead.
44
+ This function is part of the guard utilities, and the next major version removes
45
+ them. Write a plain typed predicate instead.