@xmachines/docs 1.0.0-beta.9 → 2.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +137 -7
- package/api/@xmachines/play/README.md +160 -38
- package/api/@xmachines/play/classes/NonNullableError.md +189 -0
- package/api/@xmachines/play/classes/PlayError.md +251 -0
- package/api/@xmachines/play/functions/assertNonNullable.md +56 -0
- package/api/@xmachines/play/type-aliases/PlayEvent.md +6 -6
- package/api/@xmachines/play-actor/README.md +141 -160
- package/api/@xmachines/play-actor/classes/AbstractActor.md +96 -126
- package/api/@xmachines/play-actor/functions/attachRenderErrorHandler.md +40 -0
- package/api/@xmachines/play-actor/functions/toAtomState.md +33 -0
- package/api/@xmachines/play-actor/functions/typedSpec.md +54 -0
- package/api/@xmachines/play-actor/interfaces/BaseActorProviderProps.md +46 -0
- package/api/@xmachines/play-actor/interfaces/BaseViewContextValue.md +33 -0
- package/api/@xmachines/play-actor/interfaces/PlaySpec.md +28 -0
- package/api/@xmachines/play-actor/interfaces/Routable.md +6 -21
- package/api/@xmachines/play-actor/interfaces/Viewable.md +12 -6
- package/api/@xmachines/play-dom/README.md +384 -0
- package/api/@xmachines/play-dom/classes/PlayRenderer.md +115 -0
- package/api/@xmachines/play-dom/functions/createPlayUI.md +28 -0
- package/api/@xmachines/play-dom/functions/createRenderer.md +44 -0
- package/api/@xmachines/play-dom/functions/defineRegistry.md +26 -0
- package/api/@xmachines/play-dom/functions/renderSpec.md +67 -0
- package/api/@xmachines/play-dom/interfaces/ComponentContext.md +23 -0
- package/api/@xmachines/play-dom/interfaces/CreatePlayUIOptions.md +34 -0
- package/api/@xmachines/play-dom/interfaces/DefineRegistryResult.md +17 -0
- package/api/@xmachines/play-dom/interfaces/DomRenderContext.md +28 -0
- package/api/@xmachines/play-dom/interfaces/EventHandle.md +15 -0
- package/api/@xmachines/play-dom/interfaces/MountOptions.md +18 -0
- package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +30 -0
- package/api/@xmachines/play-dom/interfaces/RenderSpecOptions.md +26 -0
- package/api/@xmachines/play-dom/interfaces/UIProviderOptions.md +32 -0
- package/api/@xmachines/play-dom/type-aliases/ActionFn.md +46 -0
- package/api/@xmachines/play-dom/type-aliases/Actions.md +18 -0
- package/api/@xmachines/play-dom/type-aliases/BaseComponentProps.md +114 -0
- package/api/@xmachines/play-dom/type-aliases/CatalogHasActions.md +25 -0
- package/api/@xmachines/play-dom/type-aliases/ComponentFn.md +26 -0
- package/api/@xmachines/play-dom/type-aliases/ComponentRegistry.md +15 -0
- package/api/@xmachines/play-dom/type-aliases/ConfirmHandler.md +44 -0
- package/api/@xmachines/play-dom/type-aliases/DefineRegistryOptions.md +39 -0
- package/api/@xmachines/play-dom/type-aliases/DomComponentRenderer.md +20 -0
- package/api/@xmachines/play-dom/type-aliases/DomRegistry.md +9 -0
- package/api/@xmachines/play-dom/type-aliases/DomSchema.md +9 -0
- package/api/@xmachines/play-dom/type-aliases/MountFn.md +27 -0
- package/api/@xmachines/play-dom/type-aliases/RenderErrorHandler.md +23 -0
- package/api/@xmachines/play-dom/type-aliases/SetState.md +30 -0
- package/api/@xmachines/play-dom/variables/schema.md +62 -0
- package/api/@xmachines/play-dom-router/README.md +271 -0
- package/api/@xmachines/play-dom-router/functions/connectRouter.md +43 -0
- package/api/@xmachines/{play-router → play-dom-router}/functions/createBrowserHistory.md +10 -2
- package/api/@xmachines/play-dom-router/functions/createRouteMap.md +39 -0
- package/api/@xmachines/play-dom-router/functions/createRouter.md +54 -0
- package/api/@xmachines/play-dom-router/interfaces/BrowserHistory.md +176 -0
- package/api/@xmachines/play-dom-router/interfaces/BrowserWindow.md +69 -0
- package/api/@xmachines/play-dom-router/interfaces/ConnectRouterOptions.md +15 -0
- package/api/@xmachines/play-dom-router/interfaces/PlayRouteEvent.md +129 -0
- package/api/@xmachines/play-dom-router/interfaces/RoutableActor.md +68 -0
- package/api/@xmachines/play-dom-router/interfaces/RouteLookupContract.md +54 -0
- package/api/@xmachines/play-dom-router/interfaces/RouteMap.md +121 -0
- package/api/@xmachines/play-dom-router/interfaces/RouteMapOptions.md +13 -0
- package/api/@xmachines/play-dom-router/interfaces/RouteMapping.md +27 -0
- package/api/@xmachines/play-dom-router/interfaces/RouterBridge.md +104 -0
- package/api/@xmachines/play-dom-router/interfaces/VanillaRouter.md +28 -0
- package/api/@xmachines/play-react/README.md +185 -334
- package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +46 -42
- package/api/@xmachines/play-react/functions/ActionProvider.md +21 -0
- package/api/@xmachines/play-react/functions/JSONUIProvider.md +21 -0
- package/api/@xmachines/play-react/functions/Renderer.md +21 -0
- package/api/@xmachines/play-react/functions/StateProvider.md +27 -0
- package/api/@xmachines/play-react/functions/ValidationProvider.md +21 -0
- package/api/@xmachines/play-react/functions/VisibilityProvider.md +21 -0
- package/api/@xmachines/play-react/functions/defineRegistry.md +49 -0
- package/api/@xmachines/play-react/functions/useActor.md +13 -0
- package/api/@xmachines/play-react/functions/useBoundProp.md +45 -0
- package/api/@xmachines/play-react/functions/usePlayView.md +32 -0
- package/api/@xmachines/play-react/functions/useSignalEffect.md +29 -20
- package/api/@xmachines/play-react/interfaces/ActionProviderProps.md +15 -0
- package/api/@xmachines/play-react/interfaces/ActorProviderProps.md +27 -0
- package/api/@xmachines/play-react/interfaces/ComponentContext.md +37 -0
- package/api/@xmachines/play-react/interfaces/JSONUIProviderProps.md +22 -0
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryProps.md +7 -7
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryState.md +6 -6
- package/api/@xmachines/play-react/interfaces/PlayUIProviderProps.md +26 -0
- package/api/@xmachines/play-react/interfaces/RendererProps.md +17 -0
- package/api/@xmachines/play-react/interfaces/StateProviderProps.md +16 -0
- package/api/@xmachines/play-react/interfaces/ValidationProviderProps.md +14 -0
- package/api/@xmachines/play-react/interfaces/ViewContextValue.md +20 -0
- package/api/@xmachines/play-react/interfaces/VisibilityProviderProps.md +13 -0
- package/api/@xmachines/play-react/type-aliases/AnyPlayActor.md +11 -0
- package/api/@xmachines/play-react/type-aliases/ComponentFn.md +36 -0
- package/api/@xmachines/play-react/type-aliases/RenderErrorHandler.md +23 -0
- package/api/@xmachines/play-react/variables/ActorProvider.md +33 -0
- package/api/@xmachines/play-react/variables/PlayRenderer.md +6 -56
- package/api/@xmachines/play-react/variables/PlayUIProvider.md +43 -0
- package/api/@xmachines/play-react-router/README.md +130 -114
- package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +19 -242
- package/api/@xmachines/play-react-router/classes/RouteMap.md +48 -36
- package/api/@xmachines/play-react-router/functions/createPlayRouterProvider.md +45 -0
- package/api/@xmachines/play-react-router/functions/createRouteMap.md +39 -0
- package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +23 -12
- package/api/@xmachines/play-react-router/interfaces/PlayActor.md +68 -0
- package/api/@xmachines/play-react-router/interfaces/PlayRouteEvent.md +22 -12
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderBaseProps.md +32 -0
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +25 -9
- package/api/@xmachines/play-react-router/interfaces/RouteMapOptions.md +13 -0
- package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +19 -9
- package/api/@xmachines/play-react-router/interfaces/RouterBridge.md +8 -8
- package/api/@xmachines/play-react-router/type-aliases/PlayRouterBridgeConstructor.md +30 -0
- package/api/@xmachines/play-react-router/variables/PlayRouterProvider.md +32 -0
- package/api/@xmachines/play-router/README.md +285 -355
- package/api/@xmachines/play-router/classes/RouteMap.md +149 -0
- package/api/@xmachines/play-router/classes/RouterBridgeBase.md +21 -221
- package/api/@xmachines/play-router/functions/buildPlayRouteEvent.md +32 -0
- package/api/@xmachines/play-router/functions/buildRouteTree.md +12 -2
- package/api/@xmachines/play-router/functions/createRouteMap.md +22 -36
- package/api/@xmachines/play-router/functions/createRouteMapFromTree.md +46 -0
- package/api/@xmachines/play-router/functions/detectDuplicateRoutes.md +14 -7
- package/api/@xmachines/play-router/functions/extractMachineRoutes.md +10 -46
- package/api/@xmachines/play-router/functions/extractQuery.md +22 -0
- package/api/@xmachines/play-router/functions/extractRouteParams.md +54 -0
- package/api/@xmachines/play-router/functions/findRouteById.md +2 -2
- package/api/@xmachines/play-router/functions/findRouteByPath.md +2 -2
- package/api/@xmachines/play-router/functions/getNavigableRoutes.md +2 -2
- package/api/@xmachines/play-router/functions/getRoutableRoutes.md +2 -2
- package/api/@xmachines/play-router/functions/getTransitionReachableRoutes.md +43 -0
- package/api/@xmachines/play-router/functions/isRouteReachable.md +38 -0
- package/api/@xmachines/play-router/functions/machineToGraph.md +19 -0
- package/api/@xmachines/play-router/functions/routeExists.md +2 -2
- package/api/@xmachines/play-router/functions/sanitizePathname.md +40 -0
- package/api/@xmachines/play-router/functions/validateRouteFormat.md +10 -9
- package/api/@xmachines/play-router/functions/validateStateExists.md +9 -9
- package/api/@xmachines/play-router/interfaces/BuildPlayRouteEventOptions.md +13 -0
- package/api/@xmachines/play-router/interfaces/LocationLike.md +27 -0
- package/api/@xmachines/play-router/interfaces/MachineEdgeData.md +17 -0
- package/api/@xmachines/play-router/interfaces/MachineNodeData.md +17 -0
- package/api/@xmachines/play-router/interfaces/PlayActor.md +68 -0
- package/api/@xmachines/play-router/interfaces/PlayRouteEvent.md +22 -12
- package/api/@xmachines/play-router/interfaces/ResolvedRoutePath.md +17 -0
- package/api/@xmachines/play-router/interfaces/RoutableActor.md +64 -0
- package/api/@xmachines/play-router/interfaces/RouteInfo.md +11 -11
- package/api/@xmachines/play-router/interfaces/RouteMapOptions.md +13 -0
- package/api/@xmachines/play-router/interfaces/RouteMapping.md +27 -0
- package/api/@xmachines/play-router/interfaces/RouteMatch.md +12 -0
- package/api/@xmachines/play-router/interfaces/RouteNode.md +13 -13
- package/api/@xmachines/play-router/interfaces/RouteObject.md +5 -5
- package/api/@xmachines/play-router/interfaces/RouteTree.md +8 -7
- package/api/@xmachines/play-router/interfaces/RouteWatcherHandle.md +55 -0
- package/api/@xmachines/play-router/interfaces/RouterBridge.md +8 -8
- package/api/@xmachines/play-router/interfaces/WindowLike.md +65 -0
- package/api/@xmachines/play-router/type-aliases/MachineGraph.md +20 -0
- package/api/@xmachines/play-router/type-aliases/RouteMetadata.md +2 -2
- package/api/@xmachines/play-signals/README.md +116 -65
- package/api/@xmachines/play-signals/functions/watchSignal.md +42 -0
- package/api/@xmachines/play-signals/interfaces/ComputedOptions.md +7 -5
- package/api/@xmachines/play-signals/interfaces/SignalComputed.md +3 -3
- package/api/@xmachines/play-signals/interfaces/SignalOptions.md +7 -5
- package/api/@xmachines/play-signals/interfaces/SignalState.md +4 -4
- package/api/@xmachines/play-signals/interfaces/SignalWatcher.md +5 -5
- package/api/@xmachines/play-signals/namespaces/Signal/README.md +1 -1
- package/api/@xmachines/play-signals/namespaces/Signal/classes/Computed.md +7 -7
- package/api/@xmachines/play-signals/namespaces/Signal/classes/State.md +8 -8
- package/api/@xmachines/play-signals/namespaces/Signal/interfaces/Options.md +7 -7
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/README.md +1 -1
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/classes/Watcher.md +9 -9
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/currentComputed.md +2 -2
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/hasSinks.md +2 -2
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/hasSources.md +2 -2
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/introspectSinks.md +2 -2
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/introspectSources.md +2 -2
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/untrack.md +2 -2
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/variables/unwatched.md +2 -2
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/variables/watched.md +2 -2
- package/api/@xmachines/play-signals/namespaces/Signal/variables/isComputed.md +2 -2
- package/api/@xmachines/play-signals/namespaces/Signal/variables/isState.md +2 -2
- package/api/@xmachines/play-signals/namespaces/Signal/variables/isWatcher.md +2 -2
- package/api/@xmachines/play-signals/type-aliases/WatcherNotify.md +2 -2
- package/api/@xmachines/play-solid/README.md +196 -234
- package/api/@xmachines/play-solid/functions/ActionProvider.md +19 -0
- package/api/@xmachines/play-solid/functions/JSONUIProvider.md +21 -0
- package/api/@xmachines/play-solid/functions/Renderer.md +21 -0
- package/api/@xmachines/play-solid/functions/StateProvider.md +19 -0
- package/api/@xmachines/play-solid/functions/ValidationProvider.md +19 -0
- package/api/@xmachines/play-solid/functions/VisibilityProvider.md +20 -0
- package/api/@xmachines/play-solid/functions/defineRegistry.md +49 -0
- package/api/@xmachines/play-solid/functions/useAction.md +24 -0
- package/api/@xmachines/play-solid/functions/useActions.md +13 -0
- package/api/@xmachines/play-solid/functions/useActor.md +13 -0
- package/api/@xmachines/play-solid/functions/useBoundProp.md +45 -0
- package/api/@xmachines/play-solid/functions/useFieldValidation.md +29 -0
- package/api/@xmachines/play-solid/functions/useIsVisible.md +19 -0
- package/api/@xmachines/play-solid/functions/useOptionalValidation.md +13 -0
- package/api/@xmachines/play-solid/functions/usePlayView.md +30 -0
- package/api/@xmachines/play-solid/functions/useStateBinding.md +25 -0
- package/api/@xmachines/play-solid/functions/useStateStore.md +13 -0
- package/api/@xmachines/play-solid/functions/useStateValue.md +25 -0
- package/api/@xmachines/play-solid/functions/useVisibility.md +13 -0
- package/api/@xmachines/play-solid/interfaces/ActionProviderProps.md +12 -0
- package/api/@xmachines/play-solid/interfaces/ActorProviderProps.md +30 -0
- package/api/@xmachines/play-solid/interfaces/ComponentContext.md +37 -0
- package/api/@xmachines/play-solid/interfaces/DefineRegistryResult.md +15 -0
- package/api/@xmachines/play-solid/interfaces/JSONUIProviderProps.md +22 -0
- package/api/@xmachines/play-solid/interfaces/PlayUIProviderProps.md +26 -0
- package/api/@xmachines/play-solid/interfaces/RendererProps.md +17 -0
- package/api/@xmachines/play-solid/interfaces/StateProviderProps.md +13 -0
- package/api/@xmachines/play-solid/interfaces/ValidationProviderProps.md +11 -0
- package/api/@xmachines/play-solid/interfaces/ViewContextValue.md +21 -0
- package/api/@xmachines/play-solid/type-aliases/AnyPlayActor.md +11 -0
- package/api/@xmachines/play-solid/type-aliases/ComponentFn.md +36 -0
- package/api/@xmachines/play-solid/type-aliases/ComponentRegistry.md +11 -0
- package/api/@xmachines/play-solid/type-aliases/RenderErrorHandler.md +23 -0
- package/api/@xmachines/play-solid/type-aliases/SetState.md +21 -0
- package/api/@xmachines/play-solid/type-aliases/VisibilityProviderProps.md +9 -0
- package/api/@xmachines/play-solid/variables/ActorContext.md +13 -0
- package/api/@xmachines/play-solid/variables/ActorProvider.md +27 -0
- package/api/@xmachines/play-solid/variables/PlayRenderer.md +6 -62
- package/api/@xmachines/play-solid/variables/PlayUIProvider.md +26 -0
- package/api/@xmachines/play-solid-router/README.md +153 -562
- package/api/@xmachines/play-solid-router/classes/RouteMap.md +31 -32
- package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +27 -242
- package/api/@xmachines/play-solid-router/functions/createPlayRouterProvider.md +44 -0
- package/api/@xmachines/play-solid-router/functions/createRouteMap.md +18 -11
- package/api/@xmachines/play-solid-router/interfaces/AbstractActor.md +89 -119
- package/api/@xmachines/play-solid-router/interfaces/PlayActor.md +68 -0
- package/api/@xmachines/play-solid-router/interfaces/PlayRouteEvent.md +22 -12
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderBaseProps.md +30 -0
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +25 -9
- package/api/@xmachines/play-solid-router/interfaces/RouteMapOptions.md +13 -0
- package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +20 -7
- package/api/@xmachines/play-solid-router/interfaces/RouterBridge.md +8 -8
- package/api/@xmachines/play-solid-router/type-aliases/PlayRouterBridgeConstructor.md +34 -0
- package/api/@xmachines/play-solid-router/type-aliases/RoutableActor.md +8 -4
- package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +22 -19
- package/api/@xmachines/play-solid-router/variables/PlayRouterProvider.md +52 -0
- package/api/@xmachines/play-svelte/README.md +269 -0
- package/api/@xmachines/play-svelte/functions/defineRegistry.md +31 -0
- package/api/@xmachines/play-svelte/functions/getActorContext.md +21 -0
- package/api/@xmachines/play-svelte/functions/getPlayViewContext.md +19 -0
- package/api/@xmachines/play-svelte/functions/setActorContext.md +19 -0
- package/api/@xmachines/play-svelte/interfaces/ActorProviderProps.md +44 -0
- package/api/@xmachines/play-svelte/interfaces/BaseComponentProps.md +29 -0
- package/api/@xmachines/play-svelte/interfaces/ComponentContext.md +29 -0
- package/api/@xmachines/play-svelte/interfaces/DefineRegistryOptions.md +24 -0
- package/api/@xmachines/play-svelte/interfaces/PlayUIProviderProps.md +43 -0
- package/api/@xmachines/play-svelte/interfaces/ViewContextValue.md +24 -0
- package/api/@xmachines/play-svelte/type-aliases/ActionFn.md +30 -0
- package/api/@xmachines/play-svelte/type-aliases/Actions.md +17 -0
- package/api/@xmachines/play-svelte/type-aliases/AnyPlayActor.md +11 -0
- package/api/@xmachines/play-svelte/type-aliases/ComponentFn.md +18 -0
- package/api/@xmachines/play-svelte/type-aliases/JSONUIProviderProps.md +7 -0
- package/api/@xmachines/play-svelte/type-aliases/PlayRenderer.md +9 -0
- package/api/@xmachines/play-svelte/type-aliases/RenderErrorHandler.md +23 -0
- package/api/@xmachines/play-svelte/type-aliases/SetState.md +21 -0
- package/api/@xmachines/play-svelte/variables/PlayRenderer.md +9 -0
- package/api/@xmachines/play-svelte-spa-router/README.md +205 -0
- package/api/@xmachines/play-svelte-spa-router/classes/RouteMap.md +149 -0
- package/api/@xmachines/play-svelte-spa-router/functions/connectRouter.md +32 -0
- package/api/@xmachines/play-svelte-spa-router/functions/createRouteMap.md +39 -0
- package/api/@xmachines/play-svelte-spa-router/interfaces/ConnectRouterOptions.md +17 -0
- package/api/@xmachines/play-svelte-spa-router/interfaces/PlayRouteEvent.md +129 -0
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapOptions.md +13 -0
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapping.md +27 -0
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouterBridge.md +104 -0
- package/api/@xmachines/play-svelte-spa-router/interfaces/WindowLike.md +65 -0
- package/api/@xmachines/play-svelte-spa-router/type-aliases/RoutableActor.md +9 -0
- package/api/@xmachines/play-sveltekit-router/README.md +211 -0
- package/api/@xmachines/play-sveltekit-router/classes/RouteMap.md +149 -0
- package/api/@xmachines/play-sveltekit-router/functions/connectRouter.md +32 -0
- package/api/@xmachines/play-sveltekit-router/functions/createRouteMap.md +39 -0
- package/api/@xmachines/play-sveltekit-router/interfaces/ConnectRouterOptions.md +13 -0
- package/api/@xmachines/play-sveltekit-router/interfaces/LocationLike.md +27 -0
- package/api/@xmachines/play-sveltekit-router/interfaces/PlayRouteEvent.md +129 -0
- package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapOptions.md +13 -0
- package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapping.md +27 -0
- package/api/@xmachines/play-sveltekit-router/interfaces/RouterBridge.md +104 -0
- package/api/@xmachines/play-sveltekit-router/type-aliases/RoutableActor.md +9 -0
- package/api/@xmachines/play-tanstack-react-router/README.md +155 -126
- package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +48 -36
- package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +31 -252
- package/api/@xmachines/play-tanstack-react-router/functions/createPlayRouterProvider.md +45 -0
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMap.md +22 -36
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMapFromTree.md +23 -12
- package/api/@xmachines/play-tanstack-react-router/functions/extractMachineRoutes.md +28 -0
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayActor.md +68 -0
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouteEvent.md +22 -12
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderBaseProps.md +32 -0
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +25 -9
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapOptions.md +13 -0
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapping.md +19 -9
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteNavigateEvent.md +6 -6
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouterBridge.md +8 -8
- package/api/@xmachines/play-tanstack-react-router/type-aliases/PlayRouterBridgeConstructor.md +30 -0
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterInstance.md +2 -2
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterLike.md +40 -18
- package/api/@xmachines/play-tanstack-react-router/variables/PlayRouterProvider.md +34 -0
- package/api/@xmachines/play-tanstack-router/README.md +58 -0
- package/api/@xmachines/play-tanstack-router/classes/TanStackRouterBridgeBase.md +131 -0
- package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouteMapLike.md +57 -0
- package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouterLike.md +100 -0
- package/api/@xmachines/play-tanstack-solid-router/README.md +215 -175
- package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +31 -32
- package/api/@xmachines/play-tanstack-solid-router/classes/TanStackSolidRouterBridge.md +121 -0
- package/api/@xmachines/play-tanstack-solid-router/functions/createPlayRouterProvider.md +44 -0
- package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +18 -11
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayActor.md +68 -0
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouteEvent.md +22 -12
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderBaseProps.md +31 -0
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +23 -9
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapOptions.md +13 -0
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +14 -10
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouterBridge.md +8 -8
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/PlayRouterBridgeConstructor.md +30 -0
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/RoutableActor.md +8 -4
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterInstance.md +3 -3
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterLike.md +40 -18
- package/api/@xmachines/play-tanstack-solid-router/variables/PlayRouterProvider.md +33 -0
- package/api/@xmachines/play-vue/README.md +192 -210
- package/api/@xmachines/play-vue/functions/defineRegistry.md +32 -0
- package/api/@xmachines/play-vue/functions/getPlayViewContext.md +28 -0
- package/api/@xmachines/play-vue/functions/useActor.md +13 -0
- package/api/@xmachines/play-vue/functions/useBoundProp.md +45 -0
- package/api/@xmachines/play-vue/interfaces/ActionProviderProps.md +12 -0
- package/api/@xmachines/play-vue/interfaces/ActorProviderProps.md +25 -0
- package/api/@xmachines/play-vue/interfaces/ComponentContext.md +37 -0
- package/api/@xmachines/play-vue/interfaces/DefineRegistryResult.md +15 -0
- package/api/@xmachines/play-vue/interfaces/JSONUIProviderProps.md +21 -0
- package/api/@xmachines/play-vue/interfaces/PlayUIProviderProps.md +24 -0
- package/api/@xmachines/play-vue/interfaces/RendererProps.md +17 -0
- package/api/@xmachines/play-vue/interfaces/StateProviderProps.md +15 -0
- package/api/@xmachines/play-vue/interfaces/ValidationProviderProps.md +11 -0
- package/api/@xmachines/play-vue/interfaces/ViewContextValue.md +21 -0
- package/api/@xmachines/play-vue/interfaces/VisibilityProviderProps.md +5 -0
- package/api/@xmachines/play-vue/type-aliases/AnyPlayActor.md +11 -0
- package/api/@xmachines/play-vue/type-aliases/ComponentEntry.md +16 -0
- package/api/@xmachines/play-vue/type-aliases/ComponentFn.md +35 -0
- package/api/@xmachines/play-vue/type-aliases/ComponentsMap.md +15 -0
- package/api/@xmachines/play-vue/type-aliases/DefineRegistryOptions.md +22 -0
- package/api/@xmachines/play-vue/type-aliases/RenderErrorHandler.md +23 -0
- package/api/@xmachines/play-vue/variables/ActionProvider.md +64 -0
- package/api/@xmachines/play-vue/variables/JSONUIProvider.md +105 -0
- package/api/@xmachines/play-vue/variables/PlayRenderer.md +2 -2
- package/api/@xmachines/play-vue/variables/Renderer.md +88 -0
- package/api/@xmachines/play-vue/variables/StateProvider.md +79 -0
- package/api/@xmachines/play-vue/variables/ValidationProvider.md +55 -0
- package/api/@xmachines/play-vue/variables/VisibilityProvider.md +40 -0
- package/api/@xmachines/play-vue-router/README.md +173 -487
- package/api/@xmachines/play-vue-router/classes/RouteMap.md +56 -116
- package/api/@xmachines/play-vue-router/classes/VueRouterBridge.md +23 -271
- package/api/@xmachines/play-vue-router/functions/createRouteMap.md +26 -6
- package/api/@xmachines/play-vue-router/interfaces/PlayActor.md +68 -0
- package/api/@xmachines/play-vue-router/interfaces/PlayRouteEvent.md +22 -12
- package/api/@xmachines/play-vue-router/interfaces/RouteMapOptions.md +13 -0
- package/api/@xmachines/play-vue-router/interfaces/RouteMapping.md +20 -8
- package/api/@xmachines/play-vue-router/interfaces/RouterBridge.md +8 -8
- package/api/@xmachines/play-vue-router/type-aliases/RoutableActor.md +8 -4
- package/api/@xmachines/play-vue-router/variables/PlayRouterProvider.md +12 -6
- package/api/@xmachines/play-xstate/README.md +234 -340
- package/api/@xmachines/play-xstate/classes/PlayerActor.md +166 -195
- package/api/@xmachines/play-xstate/functions/buildRouteUrl.md +31 -20
- package/api/@xmachines/play-xstate/functions/composeGuards.md +24 -18
- package/api/@xmachines/play-xstate/functions/composeGuardsOr.md +17 -17
- package/api/@xmachines/play-xstate/functions/contextFieldMatches.md +38 -0
- package/api/@xmachines/play-xstate/functions/createRoutedMachine.md +87 -0
- package/api/@xmachines/play-xstate/functions/definePlayer.md +14 -63
- package/api/@xmachines/play-xstate/functions/deriveRoute.md +3 -3
- package/api/@xmachines/play-xstate/functions/eventMatches.md +2 -2
- package/api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md +46 -12
- package/api/@xmachines/play-xstate/functions/hasContext.md +2 -2
- package/api/@xmachines/play-xstate/functions/isAbsoluteRoute.md +2 -2
- package/api/@xmachines/play-xstate/functions/negateGuard.md +16 -16
- package/api/@xmachines/play-xstate/interfaces/PlayerConfig.md +10 -14
- package/api/@xmachines/play-xstate/interfaces/PlayerFactoryResumeOptions.md +22 -0
- package/api/@xmachines/play-xstate/interfaces/PlayerOptions.md +12 -13
- package/api/@xmachines/play-xstate/interfaces/RouteContext.md +15 -13
- package/api/@xmachines/play-xstate/interfaces/RouteObject.md +17 -0
- package/api/@xmachines/play-xstate/type-aliases/ComposedGuard.md +27 -6
- package/api/@xmachines/play-xstate/type-aliases/Guard.md +2 -2
- package/api/@xmachines/play-xstate/type-aliases/GuardArray.md +3 -3
- package/api/@xmachines/play-xstate/type-aliases/PlayRoutePayload.md +30 -0
- package/api/@xmachines/play-xstate/type-aliases/PlayerFactory.md +10 -9
- package/api/@xmachines/play-xstate/type-aliases/RouteMachineConfig.md +22 -5
- package/api/@xmachines/play-xstate/type-aliases/RouteMetadata.md +9 -0
- package/api/@xmachines/play-xstate/type-aliases/RouteStateNode.md +34 -6
- package/api/@xmachines/play-xstate/type-aliases/SetupLike.md +33 -0
- package/api/@xmachines/play-xstate/type-aliases/WithOptional.md +31 -0
- package/api/@xmachines/play-xstate/variables/emptyEventSchema.md +37 -0
- package/api/@xmachines/play-xstate/variables/playMetaSchema.md +40 -0
- package/api/@xmachines/play-xstate/variables/playRouteEventSchema.md +9 -0
- package/api/@xmachines/shared/README.md +95 -295
- package/api/@xmachines/shared/vite-aliases/README.md +11 -0
- package/api/@xmachines/shared/vite-aliases/functions/xmAliases.md +38 -0
- package/api/@xmachines/shared/vite-aliases/functions/xmCacheDir.md +27 -0
- package/api/@xmachines/shared/vite-aliases/functions/xmOptimizeDeps.md +30 -0
- package/api/@xmachines/shared/vite-aliases/functions/xmResolve.md +42 -0
- package/api/@xmachines/shared/vite-aliases/functions/xmSvelteRunes.md +33 -0
- package/api/@xmachines/shared/vitest/README.md +12 -0
- package/api/@xmachines/shared/vitest/functions/defineXmBrowserConfig.md +42 -0
- package/api/@xmachines/shared/vitest/functions/defineXmVitestConfig.md +34 -0
- package/api/@xmachines/shared/vitest/interfaces/XmBrowserConfigOptions.md +16 -0
- package/api/README.md +6 -7
- package/api/llms.txt +72 -23
- package/contributing/README.md +10 -0
- package/contributing/architecture.md +602 -0
- package/contributing/configuration.md +368 -0
- package/contributing/deployment.md +312 -0
- package/contributing/development.md +464 -0
- package/contributing/testing.md +453 -0
- package/examples/@xmachines/play-dom-demo/README.md +181 -0
- package/examples/@xmachines/play-dom-demo/functions/createNavBar.md +24 -0
- package/examples/@xmachines/play-dom-demo/functions/initShell.md +24 -0
- package/examples/@xmachines/play-dom-demo/type-aliases/AuthCatalog.md +9 -0
- package/examples/@xmachines/play-dom-demo/variables/About.md +12 -0
- package/examples/@xmachines/play-dom-demo/variables/Contact.md +12 -0
- package/examples/@xmachines/play-dom-demo/variables/Dashboard.md +13 -0
- package/examples/@xmachines/play-dom-demo/variables/Home.md +13 -0
- package/examples/@xmachines/play-dom-demo/variables/Login.md +13 -0
- package/examples/@xmachines/play-dom-demo/variables/NavBarView.md +16 -0
- package/examples/@xmachines/play-dom-demo/variables/Navigation.md +13 -0
- package/examples/@xmachines/play-dom-demo/variables/Overview.md +13 -0
- package/examples/@xmachines/play-dom-demo/variables/Profile.md +13 -0
- package/examples/@xmachines/play-dom-demo/variables/Settings.md +13 -0
- package/examples/@xmachines/play-dom-demo/variables/Stats.md +13 -0
- package/examples/@xmachines/play-dom-demo/variables/authCatalog.md +172 -0
- package/examples/@xmachines/play-dom-router-demo/README.md +145 -0
- package/examples/@xmachines/play-react-demo/README.md +187 -0
- package/examples/@xmachines/play-react-demo/functions/App.md +13 -0
- package/examples/@xmachines/play-react-demo/functions/DebugPanel.md +20 -0
- package/examples/@xmachines/play-react-demo/functions/HeaderNav.md +20 -0
- package/examples/@xmachines/play-react-demo/functions/Shell.md +22 -0
- package/examples/@xmachines/play-react-demo/type-aliases/AuthCatalog.md +9 -0
- package/examples/@xmachines/play-react-demo/variables/About.md +14 -0
- package/examples/@xmachines/play-react-demo/variables/Contact.md +14 -0
- package/examples/@xmachines/play-react-demo/variables/Dashboard.md +15 -0
- package/examples/@xmachines/play-react-demo/variables/DebugPanel.md +15 -0
- package/examples/@xmachines/play-react-demo/variables/Home.md +14 -0
- package/examples/@xmachines/play-react-demo/variables/Login.md +16 -0
- package/examples/@xmachines/play-react-demo/variables/NavBar.md +16 -0
- package/examples/@xmachines/play-react-demo/variables/NavBarView.md +15 -0
- package/examples/@xmachines/play-react-demo/variables/Navigation.md +14 -0
- package/examples/@xmachines/play-react-demo/variables/Overview.md +14 -0
- package/examples/@xmachines/play-react-demo/variables/Profile.md +14 -0
- package/examples/@xmachines/play-react-demo/variables/Settings.md +14 -0
- package/examples/@xmachines/play-react-demo/variables/Shell.md +18 -0
- package/examples/@xmachines/play-react-demo/variables/Stats.md +14 -0
- package/examples/@xmachines/play-react-demo/variables/authCatalog.md +172 -0
- package/examples/@xmachines/play-react-router-demo/README.md +151 -0
- package/examples/@xmachines/play-solid-demo/README.md +187 -0
- package/examples/@xmachines/play-solid-demo/functions/App.md +13 -0
- package/examples/@xmachines/play-solid-demo/functions/DebugPanel.md +20 -0
- package/examples/@xmachines/play-solid-demo/functions/HeaderNav.md +20 -0
- package/examples/@xmachines/play-solid-demo/functions/Shell.md +22 -0
- package/examples/@xmachines/play-solid-demo/type-aliases/AuthCatalog.md +9 -0
- package/examples/@xmachines/play-solid-demo/variables/About.md +9 -0
- package/examples/@xmachines/play-solid-demo/variables/Contact.md +9 -0
- package/examples/@xmachines/play-solid-demo/variables/Dashboard.md +9 -0
- package/examples/@xmachines/play-solid-demo/variables/DebugPanel.md +15 -0
- package/examples/@xmachines/play-solid-demo/variables/Home.md +9 -0
- package/examples/@xmachines/play-solid-demo/variables/Login.md +9 -0
- package/examples/@xmachines/play-solid-demo/variables/NavBar.md +11 -0
- package/examples/@xmachines/play-solid-demo/variables/NavBarView.md +15 -0
- package/examples/@xmachines/play-solid-demo/variables/Navigation.md +9 -0
- package/examples/@xmachines/play-solid-demo/variables/Overview.md +9 -0
- package/examples/@xmachines/play-solid-demo/variables/Profile.md +9 -0
- package/examples/@xmachines/play-solid-demo/variables/Settings.md +9 -0
- package/examples/@xmachines/play-solid-demo/variables/Shell.md +17 -0
- package/examples/@xmachines/play-solid-demo/variables/Stats.md +9 -0
- package/examples/@xmachines/play-solid-demo/variables/authCatalog.md +172 -0
- package/examples/@xmachines/play-solid-router-demo/README.md +137 -0
- package/examples/@xmachines/play-svelte-demo/README.md +143 -0
- package/examples/@xmachines/play-svelte-demo/type-aliases/App.md +9 -0
- package/examples/@xmachines/play-svelte-demo/type-aliases/AuthCatalog.md +9 -0
- package/examples/@xmachines/play-svelte-demo/variables/App.md +9 -0
- package/examples/@xmachines/play-svelte-demo/variables/authCatalog.md +172 -0
- package/examples/@xmachines/play-svelte-spa-router-demo/README.md +129 -0
- package/examples/@xmachines/play-sveltekit-router-demo/README.md +133 -0
- package/examples/@xmachines/play-tanstack-react-router-demo/README.md +156 -0
- package/examples/@xmachines/play-tanstack-solid-router-demo/README.md +139 -0
- package/examples/@xmachines/play-vue-demo/README.md +183 -0
- package/examples/@xmachines/play-vue-demo/type-aliases/AuthCatalog.md +9 -0
- package/examples/@xmachines/play-vue-demo/variables/App.md +9 -0
- package/examples/@xmachines/play-vue-demo/variables/authCatalog.md +172 -0
- package/examples/@xmachines/play-vue-router-demo/README.md +139 -0
- package/examples/README.md +78 -30
- package/examples/basic-state-machine.md +73 -31
- package/examples/form-validation.md +267 -115
- package/examples/multi-router-integration.md +314 -194
- package/examples/routing-patterns.md +260 -187
- package/examples/traffic-light.md +96 -58
- package/guides/README.md +9 -21
- package/guides/actor-model.md +180 -0
- package/guides/getting-started.md +630 -137
- package/guides/signals.md +166 -0
- package/guides/state-machines.md +300 -0
- package/package.json +18 -7
- package/rfc/broker.md +100 -0
- package/rfc/browser.md +44 -0
- package/rfc/cli.md +118 -0
- package/rfc/git.md +61 -0
- package/rfc/mcp.md +43 -0
- package/rfc/node.md +36 -0
- package/rfc/play.md +472 -0
- package/rfc/rest.md +102 -0
- package/rfc/run.md +159 -0
- package/rfc/streams.md +168 -0
- package/api/@xmachines/play-actor/interfaces/ViewMetadata.md +0 -17
- package/api/@xmachines/play-catalog/README.md +0 -331
- package/api/@xmachines/play-catalog/functions/defineCatalog.md +0 -98
- package/api/@xmachines/play-catalog/functions/defineComponents.md +0 -134
- package/api/@xmachines/play-catalog/type-aliases/Catalog.md +0 -48
- package/api/@xmachines/play-catalog/type-aliases/ComponentsFor.md +0 -20
- package/api/@xmachines/play-catalog/type-aliases/InferComponentProps.md +0 -65
- package/api/@xmachines/play-catalog/type-aliases/NoExtraKeys.md +0 -17
- package/api/@xmachines/play-react/interfaces/PlayRendererProps.md +0 -15
- package/api/@xmachines/play-react-router/functions/PlayRouterProvider.md +0 -19
- package/api/@xmachines/play-react-router-demo/README.md +0 -137
- package/api/@xmachines/play-router/classes/BaseRouteMap.md +0 -142
- package/api/@xmachines/play-router/functions/connectRouter.md +0 -67
- package/api/@xmachines/play-router/functions/crawlMachine.md +0 -92
- package/api/@xmachines/play-router/functions/createRouter.md +0 -76
- package/api/@xmachines/play-router/functions/extractRoute.md +0 -45
- package/api/@xmachines/play-router/interfaces/BaseRouteMapping.md +0 -27
- package/api/@xmachines/play-router/interfaces/BrowserHistory.md +0 -172
- package/api/@xmachines/play-router/interfaces/BrowserWindow.md +0 -69
- package/api/@xmachines/play-router/interfaces/ConnectRouterOptions.md +0 -13
- package/api/@xmachines/play-router/interfaces/RouteMap.md +0 -56
- package/api/@xmachines/play-router/interfaces/StateVisit.md +0 -15
- package/api/@xmachines/play-router/interfaces/VanillaRouter.md +0 -28
- package/api/@xmachines/play-router-demo/README.md +0 -137
- package/api/@xmachines/play-solid/interfaces/PlayRendererProps.md +0 -15
- package/api/@xmachines/play-solid-router/functions/PlayRouterProvider.md +0 -19
- package/api/@xmachines/play-solid-router-demo/README.md +0 -127
- package/api/@xmachines/play-tanstack-react-router/functions/PlayRouterProvider.md +0 -19
- package/api/@xmachines/play-tanstack-react-router/functions/extractParams.md +0 -38
- package/api/@xmachines/play-tanstack-react-router/functions/extractQueryParams.md +0 -33
- package/api/@xmachines/play-tanstack-react-router/variables/extractMachineRoutes.md +0 -64
- package/api/@xmachines/play-tanstack-react-router-demo/README.md +0 -126
- package/api/@xmachines/play-tanstack-solid-router/classes/SolidRouterBridge.md +0 -343
- package/api/@xmachines/play-tanstack-solid-router/functions/PlayRouterProvider.md +0 -19
- package/api/@xmachines/play-tanstack-solid-router-demo/README.md +0 -126
- package/api/@xmachines/play-vue/interfaces/PlayRendererProps.md +0 -14
- package/api/@xmachines/play-vue-router/classes/VueBaseRouteMap.md +0 -201
- package/api/@xmachines/play-vue-router-demo/README.md +0 -133
- package/api/@xmachines/play-xstate/functions/mergeViewProps.md +0 -26
- package/api/@xmachines/play-xstate/functions/stateMatches.md +0 -25
- package/api/@xmachines/play-xstate/functions/validateComponentBinding.md +0 -39
- package/api/@xmachines/play-xstate/functions/validateViewProps.md +0 -80
- package/api/@xmachines/play-xstate/interfaces/CatalogEntry.md +0 -16
- package/api/@xmachines/play-xstate/type-aliases/Catalog.md +0 -21
- package/api/@xmachines/play-xstate/type-aliases/ValidationResult.md +0 -17
- package/api/@xmachines/play-xstate/type-aliases/ViewMergeContext.md +0 -35
- package/api/@xmachines/shared/functions/defineXmVitestConfig.md +0 -29
- package/api/@xmachines/shared/functions/xmAliases.md +0 -24
- package/guides/installation.md +0 -323
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[
|
|
1
|
+
[API](../../../README.md) / [@xmachines/play-router](../README.md) / detectDuplicateRoutes
|
|
2
2
|
|
|
3
3
|
# Function: detectDuplicateRoutes()
|
|
4
4
|
|
|
@@ -6,11 +6,18 @@
|
|
|
6
6
|
function detectDuplicateRoutes(routes): void;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [validate-routes.ts:
|
|
9
|
+
Defined in: [validate-routes.ts:69](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-router/src/validate-routes.ts#L69)
|
|
10
10
|
|
|
11
11
|
Detect duplicate route paths
|
|
12
12
|
|
|
13
|
-
THROWS ERROR when multiple states share the same
|
|
13
|
+
THROWS ERROR when multiple states share the same RESOLVED full path.
|
|
14
|
+
|
|
15
|
+
Detection operates on resolved full paths (after relative routes have been
|
|
16
|
+
prefixed with their parent's path in `buildRouteTree`), not on raw route
|
|
17
|
+
strings: two relative `"settings"` routes under different parents resolve to
|
|
18
|
+
distinct full paths and are valid, while a relative route and an absolute
|
|
19
|
+
route resolving to the same URL genuinely collide and must be rejected.
|
|
20
|
+
Called from `buildRouteTree` once full paths are known.
|
|
14
21
|
|
|
15
22
|
Rationale: URL-based routing requires one-to-one mapping between URLs and states.
|
|
16
23
|
Multiple states at the same path creates ambiguity for browser navigation (back button,
|
|
@@ -19,9 +26,9 @@ conditional rendering.
|
|
|
19
26
|
|
|
20
27
|
## Parameters
|
|
21
28
|
|
|
22
|
-
| Parameter | Type
|
|
23
|
-
| --------- |
|
|
24
|
-
| `routes` | [`
|
|
29
|
+
| Parameter | Type | Description |
|
|
30
|
+
| --------- | ----------------------------------------------------------- | ------------------------------------------------------------------- |
|
|
31
|
+
| `routes` | [`ResolvedRoutePath`](../interfaces/ResolvedRoutePath.md)[] | Array of route entries with resolved full paths (e.g. `RouteNode`s) |
|
|
25
32
|
|
|
26
33
|
## Returns
|
|
27
34
|
|
|
@@ -29,4 +36,4 @@ conditional rendering.
|
|
|
29
36
|
|
|
30
37
|
## Throws
|
|
31
38
|
|
|
32
|
-
If duplicate route paths are detected
|
|
39
|
+
If duplicate resolved route paths are detected
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[
|
|
1
|
+
[API](../../../README.md) / [@xmachines/play-router](../README.md) / extractMachineRoutes
|
|
2
2
|
|
|
3
3
|
# Function: extractMachineRoutes()
|
|
4
4
|
|
|
@@ -6,59 +6,23 @@
|
|
|
6
6
|
function extractMachineRoutes(machine): RouteTree;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [extract-routes.ts:
|
|
9
|
+
Defined in: [extract-routes.ts:89](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-router/src/extract-routes.ts#L89)
|
|
10
10
|
|
|
11
11
|
Extract complete route tree from state machine graph
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
and
|
|
13
|
+
Converts the XState machine to a @statelyai/graph Graph via machineToGraph(),
|
|
14
|
+
then walks graph nodes to extract route metadata, validate route references,
|
|
15
|
+
and build a hierarchical RouteTree. The graph is attached to the returned
|
|
16
|
+
RouteTree for downstream transition-aware queries.
|
|
16
17
|
|
|
17
18
|
## Parameters
|
|
18
19
|
|
|
19
|
-
| Parameter | Type
|
|
20
|
-
| --------- |
|
|
21
|
-
| `machine` | `AnyStateMachine` | XState
|
|
20
|
+
| Parameter | Type | Description |
|
|
21
|
+
| --------- | ------------------------------------------------------------------------- | ----------------------- |
|
|
22
|
+
| `machine` | [`AnyStateMachine`](https://www.jsdocs.io/package/xstate#AnyStateMachine) | XState v6 state machine |
|
|
22
23
|
|
|
23
24
|
## Returns
|
|
24
25
|
|
|
25
26
|
[`RouteTree`](../interfaces/RouteTree.md)
|
|
26
27
|
|
|
27
|
-
Route tree with root, byStateId map,
|
|
28
|
-
|
|
29
|
-
## Throws
|
|
30
|
-
|
|
31
|
-
If route references non-existent state
|
|
32
|
-
|
|
33
|
-
## Throws
|
|
34
|
-
|
|
35
|
-
If route path is malformed (doesn't start with /)
|
|
36
|
-
|
|
37
|
-
## Throws
|
|
38
|
-
|
|
39
|
-
If parallel states define conflicting routes
|
|
40
|
-
|
|
41
|
-
## Example
|
|
42
|
-
|
|
43
|
-
```typescript
|
|
44
|
-
import { createMachine } from "xstate";
|
|
45
|
-
import { extractMachineRoutes } from "@xmachines/play-router";
|
|
46
|
-
|
|
47
|
-
const machine = createMachine({
|
|
48
|
-
initial: "home",
|
|
49
|
-
states: {
|
|
50
|
-
home: { id: "home", meta: { route: "/" } },
|
|
51
|
-
dashboard: {
|
|
52
|
-
id: "dashboard",
|
|
53
|
-
meta: { route: "/dashboard" },
|
|
54
|
-
initial: "overview",
|
|
55
|
-
states: {
|
|
56
|
-
overview: { id: "overview", meta: { route: "/overview" } },
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
const tree = extractMachineRoutes(machine);
|
|
63
|
-
console.log(tree.byPath.get("/dashboard/overview"));
|
|
64
|
-
```
|
|
28
|
+
Route tree with root, byStateId map, byPath map, and graph
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
[API](../../../README.md) / [@xmachines/play-router](../README.md) / extractQuery
|
|
2
|
+
|
|
3
|
+
# Function: extractQuery()
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
function extractQuery(search): Record<string, string>;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [router-sync.ts:149](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-router/src/router-sync.ts#L149)
|
|
10
|
+
|
|
11
|
+
Parse a URL search string into the plain object shape expected by
|
|
12
|
+
`play.route` events.
|
|
13
|
+
|
|
14
|
+
## Parameters
|
|
15
|
+
|
|
16
|
+
| Parameter | Type |
|
|
17
|
+
| --------- | -------- |
|
|
18
|
+
| `search` | `string` |
|
|
19
|
+
|
|
20
|
+
## Returns
|
|
21
|
+
|
|
22
|
+
`Record`\<`string`, `string`\>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
[API](../../../README.md) / [@xmachines/play-router](../README.md) / extractRouteParams
|
|
2
|
+
|
|
3
|
+
# Function: extractRouteParams()
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
function extractRouteParams(pathname, pattern): Record<string, string>;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [router-sync.ts:112](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-router/src/router-sync.ts#L112)
|
|
10
|
+
|
|
11
|
+
Extract named path parameters from a URL using the URLPattern API.
|
|
12
|
+
|
|
13
|
+
Takes the pattern string directly — use this when the pattern is already known.
|
|
14
|
+
For extraction via a state ID lookup, see `RouterBridgeBase.extractParams`.
|
|
15
|
+
|
|
16
|
+
Undefined values (unmatched optional segments, e.g. `/settings` against
|
|
17
|
+
`/settings/:section?`) are omitted from the returned object.
|
|
18
|
+
|
|
19
|
+
The pattern is normalized with the same rules `RouteMap` uses for matching
|
|
20
|
+
(hyphenated names like `:cat-id` become `:cat_id` for URLPattern), and the
|
|
21
|
+
extracted group names are mapped back to the original param names, so
|
|
22
|
+
`/docs/123` against `/docs/:cat-id` yields `{ "cat-id": "123" }`.
|
|
23
|
+
|
|
24
|
+
Values are percent-decoded (`john%20doe` → `john doe`), matching framework
|
|
25
|
+
router semantics (e.g. vue-router). Malformed sequences are kept raw.
|
|
26
|
+
|
|
27
|
+
## Parameters
|
|
28
|
+
|
|
29
|
+
| Parameter | Type | Description |
|
|
30
|
+
| ---------- | -------- | ---------------------------------------------------- |
|
|
31
|
+
| `pathname` | `string` | The concrete URL pathname (e.g. `/profile/alice`) |
|
|
32
|
+
| `pattern` | `string` | The URL pattern template (e.g. `/profile/:username`) |
|
|
33
|
+
|
|
34
|
+
## Returns
|
|
35
|
+
|
|
36
|
+
`Record`\<`string`, `string`\>
|
|
37
|
+
|
|
38
|
+
A record of extracted parameter values, or `{}` for static patterns.
|
|
39
|
+
|
|
40
|
+
## Throws
|
|
41
|
+
|
|
42
|
+
When `URLPattern` is absent and the pattern is parameterized.
|
|
43
|
+
|
|
44
|
+
## Example
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
import { extractRouteParams } from "@xmachines/play-router";
|
|
48
|
+
|
|
49
|
+
extractRouteParams("/profile/alice", "/profile/:username");
|
|
50
|
+
// → { username: "alice" }
|
|
51
|
+
|
|
52
|
+
extractRouteParams("/settings", "/settings/:section?");
|
|
53
|
+
// → {} (optional param absent — not included)
|
|
54
|
+
```
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[
|
|
1
|
+
[API](../../../README.md) / [@xmachines/play-router](../README.md) / findRouteById
|
|
2
2
|
|
|
3
3
|
# Function: findRouteById()
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function findRouteById(tree, id): RouteNode | undefined;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [
|
|
9
|
+
Defined in: [find-route.ts:57](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-router/src/find-route.ts#L57)
|
|
10
10
|
|
|
11
11
|
Find route node by state ID
|
|
12
12
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[
|
|
1
|
+
[API](../../../README.md) / [@xmachines/play-router](../README.md) / findRouteByPath
|
|
2
2
|
|
|
3
3
|
# Function: findRouteByPath()
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function findRouteByPath(tree, path): RouteNode | undefined;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [
|
|
9
|
+
Defined in: [find-route.ts:82](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-router/src/find-route.ts#L82)
|
|
10
10
|
|
|
11
11
|
Find route node by URL path
|
|
12
12
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[
|
|
1
|
+
[API](../../../README.md) / [@xmachines/play-router](../README.md) / getNavigableRoutes
|
|
2
2
|
|
|
3
3
|
# Function: getNavigableRoutes()
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function getNavigableRoutes(tree, stateId): RouteNode[];
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [query.ts:
|
|
9
|
+
Defined in: [query.ts:41](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-router/src/query.ts#L41)
|
|
10
10
|
|
|
11
11
|
Get all routes navigable from given state
|
|
12
12
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[
|
|
1
|
+
[API](../../../README.md) / [@xmachines/play-router](../README.md) / getRoutableRoutes
|
|
2
2
|
|
|
3
3
|
# Function: getRoutableRoutes()
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function getRoutableRoutes(tree): RouteNode[];
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [query.ts:
|
|
9
|
+
Defined in: [query.ts:103](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-router/src/query.ts#L103)
|
|
10
10
|
|
|
11
11
|
Get all routable routes from tree as flat array
|
|
12
12
|
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
[API](../../../README.md) / [@xmachines/play-router](../README.md) / getTransitionReachableRoutes
|
|
2
|
+
|
|
3
|
+
# Function: getTransitionReachableRoutes()
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
function getTransitionReachableRoutes(graph, stateId): string[];
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [query.ts:154](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-router/src/query.ts#L154)
|
|
10
|
+
|
|
11
|
+
Get routes reachable via transitions from current state
|
|
12
|
+
|
|
13
|
+
Uses the @statelyai/graph successor algorithm to find all states
|
|
14
|
+
directly reachable via transition edges from the given state,
|
|
15
|
+
then filters to those with defined routes.
|
|
16
|
+
|
|
17
|
+
Returned values are the RAW `meta.route` strings from the machine — relative
|
|
18
|
+
routes (e.g. `"detail"`) are NOT resolved to full paths and cannot be used as
|
|
19
|
+
`tree.byPath` keys. For resolved `RouteNode`s use `getNavigableRoutes`, which
|
|
20
|
+
resolves reachable states through `tree.byStateId`.
|
|
21
|
+
|
|
22
|
+
## Parameters
|
|
23
|
+
|
|
24
|
+
| Parameter | Type | Description |
|
|
25
|
+
| --------- | ----------------------------------------------------------------------------------------------------------------------- | ------------------------------------ |
|
|
26
|
+
| `graph` | `Graph`\<[`MachineNodeData`](../interfaces/MachineNodeData.md), [`MachineEdgeData`](../interfaces/MachineEdgeData.md)\> | Machine graph from RouteTree.graph |
|
|
27
|
+
| `stateId` | `string` | Current state ID (e.g., "test.home") |
|
|
28
|
+
|
|
29
|
+
## Returns
|
|
30
|
+
|
|
31
|
+
`string`[]
|
|
32
|
+
|
|
33
|
+
Array of raw route strings reachable via transitions
|
|
34
|
+
|
|
35
|
+
## Example
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
const tree = extractMachineRoutes(machine);
|
|
39
|
+
if (tree.graph) {
|
|
40
|
+
const reachable = getTransitionReachableRoutes(tree.graph, "auth.loggedIn");
|
|
41
|
+
// ['/dashboard', '/settings'] — routes reachable via transitions
|
|
42
|
+
}
|
|
43
|
+
```
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
[API](../../../README.md) / [@xmachines/play-router](../README.md) / isRouteReachable
|
|
2
|
+
|
|
3
|
+
# Function: isRouteReachable()
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
function isRouteReachable(graph, fromStateId, toStateId): boolean;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [query.ts:181](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-router/src/query.ts#L181)
|
|
10
|
+
|
|
11
|
+
Check if a route is reachable from current state via transitions
|
|
12
|
+
|
|
13
|
+
Uses @statelyai/graph path-finding to determine if there exists
|
|
14
|
+
a chain of transition edges from the source state to the target state.
|
|
15
|
+
|
|
16
|
+
## Parameters
|
|
17
|
+
|
|
18
|
+
| Parameter | Type | Description |
|
|
19
|
+
| ------------- | ----------------------------------------------------------------------------------------------------------------------- | ---------------------------------- |
|
|
20
|
+
| `graph` | `Graph`\<[`MachineNodeData`](../interfaces/MachineNodeData.md), [`MachineEdgeData`](../interfaces/MachineEdgeData.md)\> | Machine graph from RouteTree.graph |
|
|
21
|
+
| `fromStateId` | `string` | Source state ID |
|
|
22
|
+
| `toStateId` | `string` | Target state ID |
|
|
23
|
+
|
|
24
|
+
## Returns
|
|
25
|
+
|
|
26
|
+
`boolean`
|
|
27
|
+
|
|
28
|
+
true if a transition path exists, false otherwise
|
|
29
|
+
|
|
30
|
+
## Example
|
|
31
|
+
|
|
32
|
+
```typescript
|
|
33
|
+
const tree = extractMachineRoutes(machine);
|
|
34
|
+
if (tree.graph) {
|
|
35
|
+
const canReach = isRouteReachable(tree.graph, "auth.login", "auth.dashboard");
|
|
36
|
+
// true if login → dashboard transition path exists
|
|
37
|
+
}
|
|
38
|
+
```
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
[API](../../../README.md) / [@xmachines/play-router](../README.md) / machineToGraph
|
|
2
|
+
|
|
3
|
+
# Function: machineToGraph()
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
function machineToGraph(machine): MachineGraph;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [machine-to-graph.ts:71](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-router/src/machine-to-graph.ts#L71)
|
|
10
|
+
|
|
11
|
+
## Parameters
|
|
12
|
+
|
|
13
|
+
| Parameter | Type |
|
|
14
|
+
| --------- | ------------------------------------------------------------------------- |
|
|
15
|
+
| `machine` | [`AnyStateMachine`](https://www.jsdocs.io/package/xstate#AnyStateMachine) |
|
|
16
|
+
|
|
17
|
+
## Returns
|
|
18
|
+
|
|
19
|
+
[`MachineGraph`](../type-aliases/MachineGraph.md)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[
|
|
1
|
+
[API](../../../README.md) / [@xmachines/play-router](../README.md) / routeExists
|
|
2
2
|
|
|
3
3
|
# Function: routeExists()
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function routeExists(tree, path): boolean;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [query.ts:
|
|
9
|
+
Defined in: [query.ts:125](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-router/src/query.ts#L125)
|
|
10
10
|
|
|
11
11
|
Validate route path exists in tree
|
|
12
12
|
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
[API](../../../README.md) / [@xmachines/play-router](../README.md) / sanitizePathname
|
|
2
|
+
|
|
3
|
+
# Function: sanitizePathname()
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
function sanitizePathname(pathname): string | null;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [router-sync.ts:72](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-router/src/router-sync.ts#L72)
|
|
10
|
+
|
|
11
|
+
Normalize a pathname before route-map lookup.
|
|
12
|
+
|
|
13
|
+
This strips query/hash fragments, collapses duplicate slashes, and rejects
|
|
14
|
+
implausibly long paths that should never enter route resolution.
|
|
15
|
+
|
|
16
|
+
Returns `null` for paths exceeding 2048 characters (malformed/adversarial input).
|
|
17
|
+
Adapters that bypass `RouterBridgeBase.syncActorFromRouter()` (e.g. `VueRouterBridge`)
|
|
18
|
+
must call this function directly and return early on `null` to apply the same
|
|
19
|
+
defense-in-depth security guarantee as the shared base class.
|
|
20
|
+
|
|
21
|
+
## Parameters
|
|
22
|
+
|
|
23
|
+
| Parameter | Type | Description |
|
|
24
|
+
| ---------- | -------- | --------------------------------------------- |
|
|
25
|
+
| `pathname` | `string` | Raw path string from router navigation event. |
|
|
26
|
+
|
|
27
|
+
## Returns
|
|
28
|
+
|
|
29
|
+
`string` \| `null`
|
|
30
|
+
|
|
31
|
+
Normalized path string, or `null` if the path is malformed/too long.
|
|
32
|
+
|
|
33
|
+
## Example
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
import { sanitizePathname } from "@xmachines/play-router";
|
|
37
|
+
|
|
38
|
+
const clean = sanitizePathname(to.path);
|
|
39
|
+
if (clean === null) return; // reject malformed path
|
|
40
|
+
```
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[
|
|
1
|
+
[API](../../../README.md) / [@xmachines/play-router](../README.md) / validateRouteFormat
|
|
2
2
|
|
|
3
3
|
# Function: validateRouteFormat()
|
|
4
4
|
|
|
@@ -6,19 +6,20 @@
|
|
|
6
6
|
function validateRouteFormat(routePath, stateId): void;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [validate-routes.ts:
|
|
9
|
+
Defined in: [validate-routes.ts:27](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-router/src/validate-routes.ts#L27)
|
|
10
10
|
|
|
11
11
|
Validate route path format
|
|
12
12
|
|
|
13
|
-
Ensures route paths
|
|
14
|
-
|
|
13
|
+
Ensures route paths are non-empty strings. Both absolute paths ("/foo")
|
|
14
|
+
and relative paths ("foo", "child/nested") are accepted. Relative routes
|
|
15
|
+
inherit their parent state's path prefix when the tree is built.
|
|
15
16
|
|
|
16
17
|
## Parameters
|
|
17
18
|
|
|
18
|
-
| Parameter | Type | Description
|
|
19
|
-
| ----------- | -------- |
|
|
20
|
-
| `routePath` | `string` | Route path to validate
|
|
21
|
-
| `stateId` | `string` | State identifier for error messages
|
|
19
|
+
| Parameter | Type | Description |
|
|
20
|
+
| ----------- | -------- | --------------------------------------------- |
|
|
21
|
+
| `routePath` | `string` | Route path to validate (absolute or relative) |
|
|
22
|
+
| `stateId` | `string` | State identifier for error messages |
|
|
22
23
|
|
|
23
24
|
## Returns
|
|
24
25
|
|
|
@@ -26,4 +27,4 @@ Per Route Protocol spec, all routes must have explicit path structure.
|
|
|
26
27
|
|
|
27
28
|
## Throws
|
|
28
29
|
|
|
29
|
-
If route path
|
|
30
|
+
If route path is empty
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
[
|
|
1
|
+
[API](../../../README.md) / [@xmachines/play-router](../README.md) / validateStateExists
|
|
2
2
|
|
|
3
3
|
# Function: validateStateExists()
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
|
-
function validateStateExists(stateId,
|
|
6
|
+
function validateStateExists(stateId, stateIds): void;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [validate-routes.ts:
|
|
9
|
+
Defined in: [validate-routes.ts:43](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-router/src/validate-routes.ts#L43)
|
|
10
10
|
|
|
11
|
-
Validate state exists in state
|
|
11
|
+
Validate state exists in state ID set
|
|
12
12
|
|
|
13
13
|
Ensures referenced state IDs exist in the machine graph.
|
|
14
14
|
Build-time validation prevents broken route references.
|
|
15
15
|
|
|
16
16
|
## Parameters
|
|
17
17
|
|
|
18
|
-
| Parameter | Type
|
|
19
|
-
| ---------- |
|
|
20
|
-
| `stateId` | `string`
|
|
21
|
-
| `
|
|
18
|
+
| Parameter | Type | Description |
|
|
19
|
+
| ---------- | ----------------- | ------------------------------------------------- |
|
|
20
|
+
| `stateId` | `string` | State identifier to validate |
|
|
21
|
+
| `stateIds` | `Set`\<`string`\> | Set of all known state IDs from the machine graph |
|
|
22
22
|
|
|
23
23
|
## Returns
|
|
24
24
|
|
|
@@ -26,4 +26,4 @@ Build-time validation prevents broken route references.
|
|
|
26
26
|
|
|
27
27
|
## Throws
|
|
28
28
|
|
|
29
|
-
If state ID doesn't exist in
|
|
29
|
+
If state ID doesn't exist in set
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
[API](../../../README.md) / [@xmachines/play-router](../README.md) / BuildPlayRouteEventOptions
|
|
2
|
+
|
|
3
|
+
# Interface: BuildPlayRouteEventOptions
|
|
4
|
+
|
|
5
|
+
Defined in: [router-sync.ts:17](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-router/src/router-sync.ts#L17)
|
|
6
|
+
|
|
7
|
+
## Properties
|
|
8
|
+
|
|
9
|
+
| Property | Type | Defined in |
|
|
10
|
+
| ----------------------------------------- | ------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
11
|
+
| <a id="property-match"></a> `match` | (`sanitizedPathname`) => [`RouteMatch`](RouteMatch.md) | [router-sync.ts:20](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-router/src/router-sync.ts#L20) |
|
|
12
|
+
| <a id="property-pathname"></a> `pathname` | `string` | [router-sync.ts:18](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-router/src/router-sync.ts#L18) |
|
|
13
|
+
| <a id="property-search"></a> `search?` | `string` | [router-sync.ts:19](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-router/src/router-sync.ts#L19) |
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
[API](../../../README.md) / [@xmachines/play-router](../README.md) / LocationLike
|
|
2
|
+
|
|
3
|
+
# Interface: LocationLike
|
|
4
|
+
|
|
5
|
+
Defined in: [types.ts:433](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-router/src/types.ts#L433)
|
|
6
|
+
|
|
7
|
+
Minimal location interface required by adapters that read the current URL at
|
|
8
|
+
`connect()` time. Injectable for SSR and testing — pass a mock instead of the
|
|
9
|
+
global `location` when the DOM is unavailable.
|
|
10
|
+
|
|
11
|
+
Defined structurally (no `Location` reference) so this package compiles without
|
|
12
|
+
the DOM lib.
|
|
13
|
+
|
|
14
|
+
## Example
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
// SSR / test — injected mock
|
|
18
|
+
const mockLoc: LocationLike = { pathname: "/dashboard", search: "?tab=posts" };
|
|
19
|
+
connectRouter({ actor, routeMap, location: mockLoc });
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Properties
|
|
23
|
+
|
|
24
|
+
| Property | Modifier | Type | Defined in |
|
|
25
|
+
| ----------------------------------------- | ---------- | -------- | ----------------------------------------------------------------------------------------------------------------------- |
|
|
26
|
+
| <a id="property-pathname"></a> `pathname` | `readonly` | `string` | [types.ts:434](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-router/src/types.ts#L434) |
|
|
27
|
+
| <a id="property-search"></a> `search` | `readonly` | `string` | [types.ts:435](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-router/src/types.ts#L435) |
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
[API](../../../README.md) / [@xmachines/play-router](../README.md) / MachineEdgeData
|
|
2
|
+
|
|
3
|
+
# Interface: MachineEdgeData
|
|
4
|
+
|
|
5
|
+
Defined in: [types.ts:24](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-router/src/types.ts#L24)
|
|
6
|
+
|
|
7
|
+
Data attached to each edge in the machine graph representation.
|
|
8
|
+
Captures transition event and guard information.
|
|
9
|
+
|
|
10
|
+
## Properties
|
|
11
|
+
|
|
12
|
+
| Property | Type | Description | Defined in |
|
|
13
|
+
| ------------------------------------------------ | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
|
|
14
|
+
| <a id="property-dynamic"></a> `dynamic?` | `boolean` | True when the transition is an XState v6 function transition: the function acts as its own guard/resolver, so its target and conditionality are dynamic and unknowable statically (the edge's target falls back to the source state). | [types.ts:47](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-router/src/types.ts#L47) |
|
|
15
|
+
| <a id="property-eventtype"></a> `eventType` | `string` | The event type that triggers this transition | [types.ts:26](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-router/src/types.ts#L26) |
|
|
16
|
+
| <a id="property-guarded"></a> `guarded?` | `boolean` | True when a guard function gates this transition. XState v6 compiles all guards to functions (authored predicates, JSON-layer names, and the route-matching guard synthesized on native route transitions), so only the presence of a guard — not its identity — is statically knowable. | [types.ts:40](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-router/src/types.ts#L40) |
|
|
17
|
+
| <a id="property-guardtype"></a> ~~`guardType?`~~ | `string` | **Deprecated** Never populated under XState v6: every guard (including JSON-layer guard names via `createMachineFromConfig`) compiles to a function, so guard identity is unrecoverable statically. Use [MachineEdgeData.guarded](#property-guarded) instead. | [types.ts:33](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-router/src/types.ts#L33) |
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
[API](../../../README.md) / [@xmachines/play-router](../README.md) / MachineNodeData
|
|
2
|
+
|
|
3
|
+
# Interface: MachineNodeData
|
|
4
|
+
|
|
5
|
+
Defined in: [types.ts:9](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-router/src/types.ts#L9)
|
|
6
|
+
|
|
7
|
+
Data attached to each node in the machine graph representation.
|
|
8
|
+
Captures the essential state metadata needed for route extraction and queries.
|
|
9
|
+
|
|
10
|
+
## Properties
|
|
11
|
+
|
|
12
|
+
| Property | Type | Description | Defined in |
|
|
13
|
+
| --------------------------------------- | ---------------------------------------------------------------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
|
|
14
|
+
| <a id="property-meta"></a> `meta?` | `Record`\<`string`, `unknown`\> | Original state meta object | [types.ts:15](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-router/src/types.ts#L15) |
|
|
15
|
+
| <a id="property-route"></a> `route?` | `string` | Extracted route path from meta.route (string form) | [types.ts:17](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-router/src/types.ts#L17) |
|
|
16
|
+
| <a id="property-stateid"></a> `stateId` | `string` | XState state ID (e.g., "test.dashboard.overview") | [types.ts:11](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-router/src/types.ts#L11) |
|
|
17
|
+
| <a id="property-type"></a> `type` | `"history"` \| `"atomic"` \| `"compound"` \| `"parallel"` \| `"final"` | State type from XState | [types.ts:13](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-router/src/types.ts#L13) |
|