@xmachines/docs 3.0.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -16
- package/api/@xmachines/play/README.md +11 -100
- package/api/@xmachines/play/errors/README.md +8 -0
- package/api/@xmachines/play/{classes → errors/classes}/NonNullableError.md +6 -6
- package/api/@xmachines/play/{classes → errors/classes}/PlayError.md +35 -10
- package/api/@xmachines/play/index/README.md +75 -0
- package/api/@xmachines/play/{functions → index/functions}/asCleanup.md +2 -2
- package/api/@xmachines/play/{functions → index/functions}/assertNonNullable.md +2 -2
- package/api/@xmachines/{play-actor → play/index}/functions/shallowEqualExcept.md +3 -3
- package/api/@xmachines/play/{type-aliases → index/type-aliases}/Cleanup.md +3 -3
- package/api/@xmachines/play/{type-aliases → index/type-aliases}/DisposeKey.md +2 -2
- package/api/@xmachines/play/{type-aliases → index/type-aliases}/PlayEvent.md +4 -4
- package/api/@xmachines/play/{variables → index/variables}/DISPOSE.md +2 -2
- package/api/@xmachines/play-actor/README.md +78 -229
- package/api/@xmachines/play-actor/interfaces/ActorEvent.md +18 -0
- package/api/@xmachines/play-actor/interfaces/PlayActor.md +73 -0
- package/api/@xmachines/play-dom/README.md +28 -40
- package/api/@xmachines/play-dom/classes/PlayRenderer.md +12 -11
- package/api/@xmachines/play-dom/functions/asCleanup.md +78 -0
- package/api/@xmachines/play-dom/functions/createPlayUI.md +4 -4
- package/api/@xmachines/play-dom/functions/createRenderer.md +1 -1
- package/api/@xmachines/play-dom/interfaces/CreatePlayUIOptions.md +3 -3
- package/api/@xmachines/play-dom/interfaces/MountOptions.md +3 -3
- package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +6 -6
- package/api/@xmachines/play-dom/type-aliases/Cleanup.md +2 -2
- package/api/@xmachines/play-dom/type-aliases/MountFn.md +29 -12
- package/api/@xmachines/play-dom-router/README.md +70 -70
- package/api/@xmachines/play-dom-router/classes/DomRouterBridge.md +22 -21
- package/api/@xmachines/{play-vue-router → play-dom-router}/classes/RouteMap.md +12 -6
- package/api/@xmachines/play-dom-router/functions/asCleanup.md +78 -0
- package/api/@xmachines/play-dom-router/functions/connectRouter.md +3 -8
- package/api/@xmachines/play-dom-router/functions/createBrowserHistory.md +9 -3
- package/api/@xmachines/play-dom-router/functions/createRouter.md +8 -14
- package/api/@xmachines/play-dom-router/interfaces/BasePathOptions.md +5 -5
- package/api/@xmachines/play-dom-router/interfaces/BrowserHistory.md +70 -26
- package/api/@xmachines/play-dom-router/interfaces/BrowserWindow.md +14 -14
- package/api/@xmachines/play-dom-router/interfaces/ConnectRouterOptions.md +8 -8
- package/api/@xmachines/play-dom-router/interfaces/PlayRouteEvent.md +9 -14
- package/api/@xmachines/play-dom-router/interfaces/RoutableActor.md +24 -21
- package/api/@xmachines/play-dom-router/interfaces/RouteLookupContract.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/RouteMapOptions.md +4 -4
- package/api/@xmachines/play-dom-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/RouterConnection.md +8 -8
- package/api/@xmachines/play-dom-router/interfaces/VanillaRouter.md +36 -23
- package/api/@xmachines/play-dom-router/type-aliases/Cleanup.md +2 -2
- package/api/@xmachines/play-dom-router/variables/DISPOSE.md +2 -2
- package/api/@xmachines/play-react/README.md +17 -39
- package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +14 -10
- package/api/@xmachines/play-react/functions/useActor.md +1 -1
- package/api/@xmachines/play-react/functions/usePlayView.md +1 -1
- package/api/@xmachines/play-react/functions/useSignalEffect.md +1 -1
- package/api/@xmachines/play-react/interfaces/ActorProviderProps.md +11 -11
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryProps.md +6 -6
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryState.md +4 -4
- package/api/@xmachines/play-react/interfaces/PlayUIProviderProps.md +13 -13
- package/api/@xmachines/play-react/interfaces/ViewContextValue.md +8 -8
- package/api/@xmachines/play-react/type-aliases/AnyPlayActor.md +11 -3
- package/api/@xmachines/play-react/variables/ActorProvider.md +1 -1
- package/api/@xmachines/play-react/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-react/variables/PlayUIProvider.md +1 -1
- package/api/@xmachines/play-react/variables/schema.md +52 -0
- package/api/@xmachines/play-react-router/README.md +22 -50
- package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +17 -16
- package/api/@xmachines/play-react-router/classes/RouteMap.md +11 -5
- package/api/@xmachines/play-react-router/functions/createPlayRouterProvider.md +11 -8
- package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +16 -9
- package/api/@xmachines/play-react-router/interfaces/PlayRouteEvent.md +9 -14
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +10 -10
- package/api/@xmachines/play-react-router/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-react-router/interfaces/RouteMapOptions.md +4 -4
- package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-react-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-react-router/type-aliases/PlayRouterBridgeConstructor.md +17 -7
- package/api/@xmachines/play-react-router/type-aliases/PlayRouterProviderBaseProps.md +5 -5
- package/api/@xmachines/play-react-router/variables/PlayRouterProvider.md +4 -4
- package/api/@xmachines/play-router/README.md +104 -196
- package/api/@xmachines/play-router/errors/README.md +15 -0
- package/api/@xmachines/play-router/errors/classes/DuplicateBridgeError.md +191 -0
- package/api/@xmachines/play-router/errors/classes/DuplicateRoutePathError.md +175 -0
- package/api/@xmachines/play-router/errors/classes/EmptyRoutePathError.md +175 -0
- package/api/@xmachines/play-router/errors/classes/InvalidBasePathError.md +200 -0
- package/api/@xmachines/play-router/errors/classes/InvalidRoutePatternError.md +203 -0
- package/api/@xmachines/play-router/errors/classes/InvalidStateIdError.md +175 -0
- package/api/@xmachines/play-router/errors/classes/MissingBasePathParamError.md +199 -0
- package/api/@xmachines/play-router/errors/classes/RouterSyncError.md +192 -0
- package/api/@xmachines/play-router/errors/classes/UnknownStateTypeError.md +182 -0
- package/api/@xmachines/play-router/index/README.md +75 -0
- package/api/@xmachines/play-router/{classes → index/classes}/RouteMap.md +12 -6
- package/api/@xmachines/play-router/{classes → index/classes}/RouterBridgeBase.md +19 -17
- package/api/@xmachines/play-router/{functions → index/functions}/buildPlayRouteEvent.md +2 -2
- package/api/@xmachines/play-router/{functions → index/functions}/buildRouteTree.md +14 -4
- package/api/@xmachines/play-router/{functions → index/functions}/cleanFrameworkParams.md +3 -4
- package/api/@xmachines/play-router/{functions → index/functions}/createRouteMapFromTree.md +13 -6
- package/api/@xmachines/play-router/{functions → index/functions}/createRouterConnection.md +2 -2
- package/api/@xmachines/play-router/{functions → index/functions}/detectDuplicateRoutes.md +2 -2
- package/api/@xmachines/play-router/{functions → index/functions}/extractQuery.md +2 -2
- package/api/@xmachines/play-router/{functions → index/functions}/extractRouteParams.md +3 -3
- package/api/@xmachines/play-router/{functions → index/functions}/findRouteById.md +2 -2
- package/api/@xmachines/play-router/{functions → index/functions}/findRouteByPath.md +2 -2
- package/api/@xmachines/play-router/index/functions/getPatternParamNames.md +29 -0
- package/api/@xmachines/play-router/index/functions/getRequiredPatternParamNames.md +39 -0
- package/api/@xmachines/play-router/{functions → index/functions}/isMountableBridge.md +2 -2
- package/api/@xmachines/play-router/index/functions/joinBasePath.md +37 -0
- package/api/@xmachines/play-router/{functions → index/functions}/mountKey.md +2 -2
- package/api/@xmachines/play-router/index/functions/normalizeBasePath.md +43 -0
- package/api/@xmachines/play-router/{functions → index/functions}/openProviderBridge.md +14 -14
- package/api/@xmachines/play-router/index/functions/pickOwnParams.md +41 -0
- package/api/@xmachines/play-router/{functions → index/functions}/repointProviderBridge.md +2 -2
- package/api/@xmachines/play-router/index/functions/resolveBasePath.md +51 -0
- package/api/@xmachines/play-router/{functions → index/functions}/resolveFrameworkParams.md +11 -13
- package/api/@xmachines/play-router/{functions → index/functions}/sanitizePathname.md +2 -2
- package/api/@xmachines/play-router/index/functions/stripBasePath.md +44 -0
- package/api/@xmachines/play-router/{functions → index/functions}/validateRouteFormat.md +2 -2
- package/api/@xmachines/play-router/{functions → index/functions}/validateStateExists.md +2 -2
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/BasePathOptions.md +6 -6
- package/api/@xmachines/play-router/index/interfaces/BuildPlayRouteEventOptions.md +13 -0
- package/api/@xmachines/play-router/index/interfaces/FrameworkParamsSource.md +47 -0
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/LocationLike.md +6 -6
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/MountableRouterBridge.md +9 -9
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/OpenProviderBridgeArgs.md +13 -13
- package/api/@xmachines/play-router/index/interfaces/PlayRouteEvent.md +130 -0
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/PlayRouterProviderBaseProps.md +15 -15
- package/api/@xmachines/play-router/index/interfaces/ResolvedBasePath.md +14 -0
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/ResolvedRoutePath.md +6 -6
- package/api/@xmachines/play-router/index/interfaces/Routable.md +26 -0
- package/api/@xmachines/play-router/index/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/RouteInfo.md +11 -11
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/RouteMapping.md +6 -6
- package/api/@xmachines/play-router/index/interfaces/RouteMatch.md +12 -0
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/RouteNode.md +13 -13
- package/api/@xmachines/play-router/index/interfaces/RouteObject.md +34 -0
- package/api/@xmachines/play-router/index/interfaces/RouteTree.md +27 -0
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/RouteWatcherHandle.md +7 -7
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/RouterBridge.md +5 -5
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/RouterConnection.md +10 -10
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/WindowLike.md +4 -4
- package/api/@xmachines/play-router/index/type-aliases/PlayRouterBridgeConstructor.md +46 -0
- package/api/@xmachines/play-router/index/type-aliases/RouteData.md +12 -0
- package/api/@xmachines/play-router/index/type-aliases/RouteDataResolver.md +31 -0
- package/api/@xmachines/play-router/index/type-aliases/RouteMetadata.md +11 -0
- package/api/@xmachines/{play-xstate → play-router/index}/variables/DISPOSE.md +3 -3
- package/api/@xmachines/play-router/index/variables/NO_BASE_PATH.md +18 -0
- package/api/@xmachines/play-router/index/variables/ROOT_NODE_ID.md +18 -0
- package/api/@xmachines/play-router/xstate/README.md +53 -0
- package/api/@xmachines/play-router/{functions → xstate/functions}/createRouteMap.md +8 -6
- package/api/@xmachines/play-router/{functions → xstate/functions}/extractMachineRoutes.md +4 -4
- package/api/@xmachines/play-router/xstate/functions/getNavigableRoutes.md +35 -0
- package/api/@xmachines/play-router/{functions → xstate/functions}/getRoutableRoutes.md +6 -6
- package/api/@xmachines/play-router/{functions → xstate/functions}/getRouteMappings.md +7 -7
- package/api/@xmachines/play-router/{functions → xstate/functions}/getTransitionReachableRoutes.md +2 -2
- package/api/@xmachines/play-router/{functions → xstate/functions}/isRouteReachable.md +2 -2
- package/api/@xmachines/play-router/{functions → xstate/functions}/machineToGraph.md +2 -2
- package/api/@xmachines/play-router/xstate/functions/routeExists.md +26 -0
- package/api/@xmachines/play-router/xstate/interfaces/MachineEdgeData.md +15 -0
- package/api/@xmachines/play-router/xstate/interfaces/MachineNodeData.md +17 -0
- package/api/@xmachines/play-router/{type-aliases → xstate/type-aliases}/MachineGraph.md +2 -2
- package/api/@xmachines/play-signals/README.md +2 -24
- package/api/@xmachines/play-signals/functions/watchSignal.md +1 -1
- package/api/@xmachines/play-signals/interfaces/ComputedOptions.md +2 -2
- package/api/@xmachines/play-signals/interfaces/SignalComputed.md +2 -2
- package/api/@xmachines/play-signals/interfaces/SignalOptions.md +2 -2
- package/api/@xmachines/play-signals/interfaces/SignalState.md +3 -3
- package/api/@xmachines/play-signals/interfaces/SignalWatcher.md +4 -4
- package/api/@xmachines/play-signals/type-aliases/Cleanup.md +2 -2
- package/api/@xmachines/play-signals/type-aliases/WatcherNotify.md +1 -1
- package/api/@xmachines/play-solid/README.md +14 -31
- package/api/@xmachines/play-solid/functions/useActor.md +1 -1
- package/api/@xmachines/play-solid/functions/usePlayView.md +1 -1
- package/api/@xmachines/play-solid/interfaces/ActorProviderProps.md +11 -11
- package/api/@xmachines/play-solid/interfaces/PlayUIProviderProps.md +13 -13
- package/api/@xmachines/play-solid/interfaces/ViewContextValue.md +8 -8
- package/api/@xmachines/play-solid/type-aliases/AnyPlayActor.md +11 -3
- package/api/@xmachines/play-solid/variables/ActorContext.md +1 -1
- package/api/@xmachines/play-solid/variables/ActorProvider.md +1 -1
- package/api/@xmachines/play-solid/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-solid/variables/PlayUIProvider.md +1 -1
- package/api/@xmachines/play-solid/variables/schema.md +71 -0
- package/api/@xmachines/play-solid-router/README.md +31 -52
- package/api/@xmachines/play-solid-router/classes/RouteMap.md +11 -5
- package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +30 -53
- package/api/@xmachines/play-solid-router/functions/createPlayRouterProvider.md +9 -8
- package/api/@xmachines/play-solid-router/interfaces/PlayActor.md +38 -35
- package/api/@xmachines/play-solid-router/interfaces/PlayRouteEvent.md +9 -14
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +12 -12
- package/api/@xmachines/play-solid-router/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-solid-router/interfaces/RouteMapOptions.md +4 -4
- package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +5 -5
- package/api/@xmachines/play-solid-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-solid-router/type-aliases/PlayRouterBridgeConstructor.md +17 -7
- package/api/@xmachines/play-solid-router/type-aliases/PlayRouterProviderBaseProps.md +5 -5
- package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +4 -4
- package/api/@xmachines/play-solid-router/variables/PlayRouterProvider.md +4 -4
- package/api/@xmachines/play-svelte/README.md +11 -26
- package/api/@xmachines/play-svelte/functions/defineRegistry.md +1 -1
- package/api/@xmachines/play-svelte/functions/getActorContext.md +1 -1
- package/api/@xmachines/play-svelte/functions/getPlayViewContext.md +1 -1
- package/api/@xmachines/play-svelte/functions/setActorContext.md +1 -1
- package/api/@xmachines/play-svelte/interfaces/ActorProviderProps.md +12 -12
- package/api/@xmachines/play-svelte/interfaces/DefineRegistryOptions.md +4 -4
- package/api/@xmachines/play-svelte/interfaces/PlayUIProviderProps.md +14 -14
- package/api/@xmachines/play-svelte/interfaces/ViewContextValue.md +8 -8
- package/api/@xmachines/play-svelte/type-aliases/AnyPlayActor.md +11 -3
- package/api/@xmachines/play-svelte/variables/schema.md +16 -0
- package/api/@xmachines/play-svelte-spa-router/README.md +22 -41
- package/api/@xmachines/play-svelte-spa-router/classes/RouteMap.md +11 -5
- package/api/@xmachines/play-svelte-spa-router/classes/SvelteSpaRouterBridge.md +22 -21
- package/api/@xmachines/play-svelte-spa-router/functions/connectRouter.md +3 -2
- package/api/@xmachines/play-svelte-spa-router/interfaces/BasePathOptions.md +5 -5
- package/api/@xmachines/play-svelte-spa-router/interfaces/ConnectRouterOptions.md +8 -8
- package/api/@xmachines/play-svelte-spa-router/interfaces/PlayRouteEvent.md +9 -14
- package/api/@xmachines/play-svelte-spa-router/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapOptions.md +4 -4
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouterConnection.md +8 -8
- package/api/@xmachines/play-svelte-spa-router/interfaces/WindowLike.md +3 -3
- package/api/@xmachines/play-sveltekit-router/README.md +17 -35
- package/api/@xmachines/play-sveltekit-router/classes/RouteMap.md +11 -5
- package/api/@xmachines/play-sveltekit-router/classes/SvelteKitRouterBridge.md +22 -21
- package/api/@xmachines/play-sveltekit-router/functions/connectRouter.md +3 -2
- package/api/@xmachines/play-sveltekit-router/interfaces/BasePathOptions.md +5 -5
- package/api/@xmachines/play-sveltekit-router/interfaces/ConnectRouterOptions.md +8 -8
- package/api/@xmachines/play-sveltekit-router/interfaces/LocationLike.md +3 -3
- package/api/@xmachines/play-sveltekit-router/interfaces/PlayRouteEvent.md +9 -14
- package/api/@xmachines/play-sveltekit-router/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapOptions.md +4 -4
- package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-sveltekit-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-sveltekit-router/interfaces/RouterConnection.md +8 -8
- package/api/@xmachines/play-tanstack-react-router/README.md +19 -43
- package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +11 -5
- package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +18 -17
- package/api/@xmachines/play-tanstack-react-router/functions/createPlayRouterProvider.md +11 -8
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMapFromTree.md +16 -9
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouteEvent.md +9 -14
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +10 -10
- package/api/@xmachines/play-tanstack-react-router/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapOptions.md +4 -4
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-tanstack-react-router/type-aliases/PlayRouterBridgeConstructor.md +17 -7
- package/api/@xmachines/play-tanstack-react-router/type-aliases/PlayRouterProviderBaseProps.md +5 -5
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterInstance.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterLike.md +5 -5
- package/api/@xmachines/play-tanstack-react-router/variables/PlayRouterProvider.md +4 -4
- package/api/@xmachines/play-tanstack-router/README.md +6 -4
- package/api/@xmachines/play-tanstack-router/classes/TanStackRouterBridgeBase.md +17 -20
- package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouteMapLike.md +3 -3
- package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouterLike.md +5 -5
- package/api/@xmachines/play-tanstack-solid-router/README.md +26 -52
- package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +11 -5
- package/api/@xmachines/play-tanstack-solid-router/classes/TanStackSolidRouterBridge.md +49 -45
- package/api/@xmachines/play-tanstack-solid-router/functions/createPlayRouterProvider.md +9 -8
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouteEvent.md +9 -14
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +10 -10
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapOptions.md +4 -4
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/PlayRouterBridgeConstructor.md +17 -7
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/PlayRouterProviderBaseProps.md +5 -5
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterInstance.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterLike.md +5 -5
- package/api/@xmachines/play-tanstack-solid-router/variables/PlayRouterProvider.md +4 -4
- package/api/@xmachines/play-url/README.md +69 -0
- package/api/@xmachines/play-url/errors/README.md +17 -0
- package/api/@xmachines/play-url/errors/classes/InvalidBasePathError.md +200 -0
- package/api/@xmachines/play-url/errors/classes/InvalidRoutePatternError.md +203 -0
- package/api/@xmachines/play-url/errors/classes/MissingBasePathParamError.md +199 -0
- package/api/@xmachines/play-url/index/README.md +65 -0
- package/api/@xmachines/play-url/index/functions/cleanFrameworkParams.md +39 -0
- package/api/@xmachines/play-url/index/functions/getCandidates.md +29 -0
- package/api/@xmachines/play-url/index/functions/getCompiledPattern.md +31 -0
- package/api/@xmachines/play-url/index/functions/getIndexKey.md +30 -0
- package/api/@xmachines/play-url/index/functions/getNormalizedParamNameMap.md +32 -0
- package/api/@xmachines/play-url/index/functions/getPatternParamNames.md +29 -0
- package/api/@xmachines/play-url/index/functions/getRequiredPatternParamNames.md +39 -0
- package/api/@xmachines/play-url/index/functions/holdsUnsubstitutedParam.md +36 -0
- package/api/@xmachines/play-url/index/functions/isParameterizedPattern.md +36 -0
- package/api/@xmachines/{play-router → play-url/index}/functions/joinBasePath.md +2 -2
- package/api/@xmachines/{play-router → play-url/index}/functions/normalizeBasePath.md +2 -2
- package/api/@xmachines/play-url/index/functions/normalizeParamNames.md +36 -0
- package/api/@xmachines/play-url/index/functions/parsePattern.md +27 -0
- package/api/@xmachines/{play-router → play-url/index}/functions/pickOwnParams.md +4 -4
- package/api/@xmachines/{play-router → play-url/index}/functions/resolveBasePath.md +2 -2
- package/api/@xmachines/play-url/index/functions/resolveFrameworkParams.md +49 -0
- package/api/@xmachines/{play-router → play-url/index}/functions/stripBasePath.md +2 -2
- package/api/@xmachines/play-url/index/interfaces/BasePathOptions.md +28 -0
- package/api/@xmachines/{play-router → play-url/index}/interfaces/FrameworkParamsSource.md +9 -9
- package/api/@xmachines/play-url/index/interfaces/GroupPart.md +15 -0
- package/api/@xmachines/play-url/index/interfaces/LiteralPart.md +14 -0
- package/api/@xmachines/play-url/index/interfaces/ParamPart.md +21 -0
- package/api/@xmachines/play-url/index/interfaces/ParsedPattern.md +23 -0
- package/api/@xmachines/play-url/index/interfaces/PatternParam.md +15 -0
- package/api/@xmachines/{play-router → play-url/index}/interfaces/ResolvedBasePath.md +6 -6
- package/api/@xmachines/play-url/index/type-aliases/PatternModifier.md +11 -0
- package/api/@xmachines/play-url/index/type-aliases/PatternPart.md +9 -0
- package/api/@xmachines/play-url/index/type-aliases/URLPatternCtor.md +22 -0
- package/api/@xmachines/play-url/index/type-aliases/URLPatternLike.md +68 -0
- package/api/@xmachines/{play-router → play-url/index}/variables/NO_BASE_PATH.md +2 -2
- package/api/@xmachines/play-url/index/variables/URLPattern.md +21 -0
- package/api/@xmachines/play-view/README.md +165 -0
- package/api/@xmachines/play-view/errors/README.md +17 -0
- package/api/@xmachines/play-view/errors/classes/ReadOnlyContextError.md +192 -0
- package/api/@xmachines/play-view/index/README.md +55 -0
- package/api/@xmachines/{play-actor → play-view/index}/functions/attachRenderErrorHandler.md +6 -6
- package/api/@xmachines/{play-actor → play-view/index}/functions/composePlayState.md +2 -2
- package/api/@xmachines/{play-actor → play-view/index}/functions/createFailureLatch.md +2 -2
- package/api/@xmachines/{play-actor → play-view/index}/functions/createReportGuard.md +2 -2
- package/api/@xmachines/{play-actor → play-view/index}/functions/createViewStoreLifecycle.md +2 -2
- package/api/@xmachines/{play-actor → play-view/index}/functions/guardContextWrites.md +2 -2
- package/api/@xmachines/{play-actor → play-view/index}/functions/refreshContextSubtree.md +2 -2
- package/api/@xmachines/{play-actor → play-view/index}/functions/reuseComposedState.md +3 -3
- package/api/@xmachines/{play-actor → play-view/index}/functions/sameViewInputs.md +2 -2
- package/api/@xmachines/{play-actor → play-view/index}/functions/toAtomState.md +2 -2
- package/api/@xmachines/{play-actor → play-view/index}/functions/typedSpec.md +2 -2
- package/api/@xmachines/play-view/index/interfaces/BaseActorProviderProps.md +49 -0
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/BaseViewContextValue.md +12 -12
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/FailureLatch.md +6 -5
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/PlaySpec.md +8 -8
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/ReportGuard.md +6 -6
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/ReportGuardMessages.md +6 -6
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/ResolveViewStoreOptions.md +5 -5
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/ViewInputs.md +7 -7
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/ViewStoreLifecycle.md +6 -5
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/ViewStoreResolution.md +7 -7
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/Viewable.md +5 -5
- package/api/@xmachines/play-view/index/type-aliases/ViewActor.md +26 -0
- package/api/@xmachines/{play-actor → play-view/index}/variables/CONTEXT_STATE_KEY.md +2 -2
- package/api/@xmachines/play-vue/README.md +15 -33
- package/api/@xmachines/play-vue/functions/defineRegistry.md +1 -1
- package/api/@xmachines/play-vue/functions/useActor.md +1 -1
- package/api/@xmachines/play-vue/functions/usePlayView.md +1 -1
- package/api/@xmachines/play-vue/interfaces/ActorProviderProps.md +9 -9
- package/api/@xmachines/play-vue/interfaces/PlayUIProviderProps.md +11 -11
- package/api/@xmachines/play-vue/interfaces/ViewContextValue.md +8 -8
- package/api/@xmachines/play-vue/type-aliases/AnyPlayActor.md +11 -3
- package/api/@xmachines/play-vue/type-aliases/ComponentEntry.md +1 -1
- package/api/@xmachines/play-vue/type-aliases/ComponentsMap.md +1 -1
- package/api/@xmachines/play-vue/type-aliases/DefineRegistryOptions.md +2 -2
- package/api/@xmachines/play-vue/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-vue/variables/schema.md +71 -0
- package/api/@xmachines/play-vue-router/README.md +34 -77
- package/api/@xmachines/play-vue-router/errors/README.md +8 -0
- package/api/@xmachines/play-vue-router/errors/classes/VueRouterNavigationError.md +193 -0
- package/api/@xmachines/play-vue-router/errors/classes/VueRouterSendError.md +177 -0
- package/api/@xmachines/play-vue-router/index/README.md +20 -0
- package/api/@xmachines/play-vue-router/index/classes/RouteMap.md +157 -0
- package/api/@xmachines/play-vue-router/{classes → index/classes}/VueRouterBridge.md +24 -43
- package/api/@xmachines/play-vue-router/index/interfaces/PlayRouteEvent.md +130 -0
- package/api/@xmachines/play-vue-router/index/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-vue-router/{interfaces → index/interfaces}/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-vue-router/{interfaces → index/interfaces}/RouteMapping.md +6 -6
- package/api/@xmachines/play-vue-router/{interfaces → index/interfaces}/RouterBridge.md +5 -5
- package/api/@xmachines/play-vue-router/{variables → index/variables}/PlayRouterProvider.md +4 -4
- package/api/@xmachines/play-xstate/README.md +153 -105
- package/api/@xmachines/play-xstate/errors/README.md +13 -0
- package/api/@xmachines/play-xstate/errors/classes/ActorThrewNonErrorError.md +199 -0
- package/api/@xmachines/play-xstate/errors/classes/InvalidEventError.md +198 -0
- package/api/@xmachines/play-xstate/errors/classes/InvalidMachineError.md +169 -0
- package/api/@xmachines/play-xstate/errors/classes/InvalidRouteHandlerError.md +197 -0
- package/api/@xmachines/play-xstate/errors/classes/InvalidRouteMetadataError.md +176 -0
- package/api/@xmachines/play-xstate/errors/classes/MissingRouteParamError.md +199 -0
- package/api/@xmachines/play-xstate/errors/classes/MissingStateIdError.md +203 -0
- package/api/@xmachines/play-xstate/index/README.md +38 -0
- package/api/@xmachines/play-xstate/index/classes/PlayerActor.md +584 -0
- package/api/@xmachines/play-xstate/index/functions/compose.md +224 -0
- package/api/@xmachines/play-xstate/index/functions/definePlayer.md +158 -0
- package/api/@xmachines/play-xstate/index/interfaces/PlayerConfig.md +22 -0
- package/api/@xmachines/play-xstate/{interfaces → index/interfaces}/PlayerFactoryResumeOptions.md +3 -3
- package/api/@xmachines/play-xstate/{interfaces → index/interfaces}/PlayerOptions.md +8 -8
- package/api/@xmachines/play-xstate/index/type-aliases/Capability.md +33 -0
- package/api/@xmachines/play-xstate/index/type-aliases/PlayerConstructor.md +39 -0
- package/api/@xmachines/play-xstate/index/type-aliases/PlayerFactory.md +27 -0
- package/api/@xmachines/{play-router → play-xstate/index}/variables/DISPOSE.md +3 -3
- package/api/@xmachines/play-xstate/with-routing/README.md +46 -0
- package/api/@xmachines/play-xstate/{functions → with-routing/functions}/buildRouteUrl.md +2 -2
- package/api/@xmachines/play-xstate/{functions → with-routing/functions}/deriveRoute.md +4 -4
- package/api/@xmachines/play-xstate/{functions → with-routing/functions}/formatPlayRouteTransitions.md +2 -2
- package/api/@xmachines/play-xstate/{functions → with-routing/functions}/isAbsoluteRoute.md +3 -3
- package/api/@xmachines/play-xstate/with-routing/functions/withRouting.md +36 -0
- package/api/@xmachines/play-xstate/{interfaces → with-routing/interfaces}/RouteContext.md +6 -6
- package/api/@xmachines/play-xstate/with-routing/interfaces/RouteObject.md +34 -0
- package/api/@xmachines/play-xstate/with-routing/type-aliases/RouteData.md +12 -0
- package/api/@xmachines/play-xstate/with-routing/type-aliases/RouteDataResolver.md +31 -0
- package/api/@xmachines/play-xstate/{type-aliases → with-routing/type-aliases}/RouteMachineConfig.md +5 -5
- package/api/@xmachines/play-xstate/with-routing/type-aliases/RouteMetadata.md +11 -0
- package/api/@xmachines/play-xstate/{type-aliases → with-routing/type-aliases}/RouteStateNode.md +21 -7
- package/api/@xmachines/play-xstate/with-view/README.md +31 -0
- package/api/@xmachines/play-xstate/with-view/functions/withView.md +32 -0
- package/api/@xmachines/shared/README.md +10 -32
- package/api/@xmachines/shared/vite-aliases/functions/xmAliases.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmCacheDir.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmOptimizeDeps.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmResolve.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmSvelteRunes.md +2 -2
- package/api/@xmachines/shared/vitest/functions/defineXmBrowserConfig.md +1 -1
- package/api/@xmachines/shared/vitest/functions/defineXmVitestConfig.md +2 -1
- package/api/@xmachines/shared/vitest/interfaces/XmBrowserConfigOptions.md +4 -4
- package/api/README.md +2 -0
- package/api/llms.txt +15 -10
- package/contributing/architecture.md +94 -66
- package/contributing/configuration.md +85 -26
- package/contributing/deployment.md +30 -28
- package/contributing/development.md +51 -10
- package/contributing/testing.md +87 -28
- package/examples/README.md +9 -7
- package/examples/form-validation.md +3 -2
- package/examples/multi-router-integration.md +61 -39
- package/examples/routing-patterns.md +15 -14
- package/examples/traffic-light.md +11 -5
- package/guides/README.md +1 -0
- package/guides/actor-model.md +35 -26
- package/guides/getting-started.md +49 -46
- package/guides/inspector.md +4 -4
- package/guides/routing.md +245 -0
- package/guides/state-machines.md +16 -17
- package/package.json +10 -9
- package/rfc/play.md +35 -22
- package/api/@xmachines/play-actor/classes/AbstractActor.md +0 -505
- package/api/@xmachines/play-actor/interfaces/BaseActorProviderProps.md +0 -48
- package/api/@xmachines/play-actor/interfaces/Routable.md +0 -14
- package/api/@xmachines/play-dom/type-aliases/DisposablePlayUI.md +0 -36
- package/api/@xmachines/play-dom-router/functions/createRouteMap.md +0 -40
- package/api/@xmachines/play-dom-router/interfaces/DisposableBrowserHistory.md +0 -262
- package/api/@xmachines/play-dom-router/interfaces/DisposableVanillaRouter.md +0 -80
- package/api/@xmachines/play-dom-router/interfaces/RouteMap.md +0 -122
- package/api/@xmachines/play-react/type-aliases/PlayRendererProps.md +0 -13
- package/api/@xmachines/play-react-router/functions/createRouteMap.md +0 -40
- package/api/@xmachines/play-react-router/interfaces/PlayActor.md +0 -70
- package/api/@xmachines/play-router/functions/getNavigableRoutes.md +0 -35
- package/api/@xmachines/play-router/functions/getPatternParamNames.md +0 -24
- package/api/@xmachines/play-router/functions/getRequiredPatternParamNames.md +0 -36
- package/api/@xmachines/play-router/functions/routeExists.md +0 -26
- package/api/@xmachines/play-router/interfaces/BuildPlayRouteEventOptions.md +0 -13
- package/api/@xmachines/play-router/interfaces/MachineEdgeData.md +0 -15
- package/api/@xmachines/play-router/interfaces/MachineNodeData.md +0 -17
- package/api/@xmachines/play-router/interfaces/PlayActor.md +0 -70
- package/api/@xmachines/play-router/interfaces/PlayRouteEvent.md +0 -135
- package/api/@xmachines/play-router/interfaces/RoutableActor.md +0 -65
- package/api/@xmachines/play-router/interfaces/RouteMatch.md +0 -12
- package/api/@xmachines/play-router/interfaces/RouteObject.md +0 -21
- package/api/@xmachines/play-router/interfaces/RouteTree.md +0 -21
- package/api/@xmachines/play-router/type-aliases/BaseRouteMapping.md +0 -13
- package/api/@xmachines/play-router/type-aliases/PlayRouterBridgeConstructor.md +0 -36
- package/api/@xmachines/play-router/type-aliases/RouteMetadata.md +0 -11
- package/api/@xmachines/play-solid-router/functions/createRouteMap.md +0 -40
- package/api/@xmachines/play-solid-router/interfaces/AbstractActor.md +0 -471
- package/api/@xmachines/play-solid-router/type-aliases/RoutableActor.md +0 -13
- package/api/@xmachines/play-svelte-spa-router/functions/createRouteMap.md +0 -40
- package/api/@xmachines/play-svelte-spa-router/type-aliases/RoutableActor.md +0 -9
- package/api/@xmachines/play-sveltekit-router/functions/createRouteMap.md +0 -40
- package/api/@xmachines/play-sveltekit-router/type-aliases/RoutableActor.md +0 -9
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMap.md +0 -40
- package/api/@xmachines/play-tanstack-react-router/functions/extractMachineRoutes.md +0 -29
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayActor.md +0 -70
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteNavigateEvent.md +0 -31
- package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +0 -40
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayActor.md +0 -70
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/RoutableActor.md +0 -13
- package/api/@xmachines/play-vue/interfaces/VisibilityProviderProps.md +0 -9
- package/api/@xmachines/play-vue/variables/getPlayViewContext.md +0 -39
- package/api/@xmachines/play-vue-router/functions/createRouteMap.md +0 -40
- package/api/@xmachines/play-vue-router/interfaces/PlayActor.md +0 -70
- package/api/@xmachines/play-vue-router/interfaces/PlayRouteEvent.md +0 -135
- package/api/@xmachines/play-vue-router/type-aliases/RoutableActor.md +0 -13
- package/api/@xmachines/play-vue-router/type-aliases/VueRouteMap.md +0 -13
- package/api/@xmachines/play-vue-router/variables/VueRouteMap.md +0 -13
- package/api/@xmachines/play-xstate/classes/PlayerActor.md +0 -568
- package/api/@xmachines/play-xstate/functions/composeGuards.md +0 -86
- package/api/@xmachines/play-xstate/functions/composeGuardsOr.md +0 -72
- package/api/@xmachines/play-xstate/functions/contextFieldMatches.md +0 -43
- package/api/@xmachines/play-xstate/functions/definePlayer.md +0 -78
- package/api/@xmachines/play-xstate/functions/eventMatches.md +0 -45
- package/api/@xmachines/play-xstate/functions/hasContext.md +0 -45
- package/api/@xmachines/play-xstate/functions/negateGuard.md +0 -67
- package/api/@xmachines/play-xstate/interfaces/PlayerConfig.md +0 -20
- package/api/@xmachines/play-xstate/interfaces/RouteObject.md +0 -17
- package/api/@xmachines/play-xstate/type-aliases/ComposedGuard.md +0 -19
- package/api/@xmachines/play-xstate/type-aliases/Guard.md +0 -36
- package/api/@xmachines/play-xstate/type-aliases/GuardArray.md +0 -23
- package/api/@xmachines/play-xstate/type-aliases/PlayerFactory.md +0 -26
- package/api/@xmachines/play-xstate/type-aliases/RouteMetadata.md +0 -9
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
[API](../../../../README.md) / [@xmachines/play-vue-router](../../README.md) / [errors](../README.md) / VueRouterSendError
|
|
2
|
+
|
|
3
|
+
# Class: VueRouterSendError
|
|
4
|
+
|
|
5
|
+
Defined in: [packages/play-vue-router/src/errors.ts:41](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-vue-router/src/errors.ts#L41)
|
|
6
|
+
|
|
7
|
+
The bridge throws this error when its Vue Router `afterEach` hook cannot build
|
|
8
|
+
or send the `play.route` event to the actor after a navigation that succeeded.
|
|
9
|
+
|
|
10
|
+
The `cause` property holds the error below it.
|
|
11
|
+
|
|
12
|
+
**Error code:** `PLAY_VUE_ROUTER_SEND_FAILED`
|
|
13
|
+
|
|
14
|
+
## Extends
|
|
15
|
+
|
|
16
|
+
- [`PlayError`](../../../play/errors/classes/PlayError.md)
|
|
17
|
+
|
|
18
|
+
## Constructors
|
|
19
|
+
|
|
20
|
+
### Constructor
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
new VueRouterSendError(message, options?): VueRouterSendError;
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Defined in: [packages/play-vue-router/src/errors.ts:42](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-vue-router/src/errors.ts#L42)
|
|
27
|
+
|
|
28
|
+
#### Parameters
|
|
29
|
+
|
|
30
|
+
| Parameter | Type |
|
|
31
|
+
| ---------- | -------------- |
|
|
32
|
+
| `message` | `string` |
|
|
33
|
+
| `options?` | `ErrorOptions` |
|
|
34
|
+
|
|
35
|
+
#### Returns
|
|
36
|
+
|
|
37
|
+
`VueRouterSendError`
|
|
38
|
+
|
|
39
|
+
#### Overrides
|
|
40
|
+
|
|
41
|
+
[`PlayError`](../../../play/errors/classes/PlayError.md).[`constructor`](../../../play/errors/classes/PlayError.md#constructor)
|
|
42
|
+
|
|
43
|
+
## Properties
|
|
44
|
+
|
|
45
|
+
| Property | Modifier | Type | Description | Inherited from | Defined in |
|
|
46
|
+
| ------------------------------------------------------- | ---------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------- |
|
|
47
|
+
| <a id="property-cause"></a> `cause?` | `public` | `unknown` | - | [`PlayError`](../../../play/errors/classes/PlayError.md).[`cause`](../../../play/errors/classes/PlayError.md#property-cause) | - |
|
|
48
|
+
| <a id="property-code"></a> `code` | `readonly` | `string` | A stable, machine-readable identifier of the error. An error code follows the naming convention `PLAY_<PACKAGE>_<DESCRIPTION>`. It stays the same across each patch release and each minor release of one major version. Never match on `.message`. Always match on `.code`, or on the subclass. | [`PlayError`](../../../play/errors/classes/PlayError.md).[`code`](../../../play/errors/classes/PlayError.md#property-code) | [packages/play/src/errors.ts:76](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play/src/errors.ts#L76) |
|
|
49
|
+
| <a id="property-message"></a> `message` | `public` | `string` | - | [`PlayError`](../../../play/errors/classes/PlayError.md).[`message`](../../../play/errors/classes/PlayError.md#property-message) | - |
|
|
50
|
+
| <a id="property-name"></a> `name` | `public` | `string` | - | [`PlayError`](../../../play/errors/classes/PlayError.md).[`name`](../../../play/errors/classes/PlayError.md#property-name) | - |
|
|
51
|
+
| <a id="property-scope"></a> `scope` | `readonly` | `string` | The class or the module that threw this error, for example `"RouterBridgeBase"`. | [`PlayError`](../../../play/errors/classes/PlayError.md).[`scope`](../../../play/errors/classes/PlayError.md#property-scope) | [packages/play/src/errors.ts:66](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play/src/errors.ts#L66) |
|
|
52
|
+
| <a id="property-stack"></a> `stack?` | `public` | `string` | - | [`PlayError`](../../../play/errors/classes/PlayError.md).[`stack`](../../../play/errors/classes/PlayError.md#property-stack) | - |
|
|
53
|
+
| <a id="property-stacktracelimit"></a> `stackTraceLimit` | `static` | `number` | The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. | [`PlayError`](../../../play/errors/classes/PlayError.md).[`stackTraceLimit`](../../../play/errors/classes/PlayError.md#property-stacktracelimit) | - |
|
|
54
|
+
|
|
55
|
+
## Methods
|
|
56
|
+
|
|
57
|
+
### captureStackTrace()
|
|
58
|
+
|
|
59
|
+
```ts
|
|
60
|
+
static captureStackTrace(targetObject, constructorOpt?): void;
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Defined in: `@types/node`
|
|
64
|
+
|
|
65
|
+
Creates a `.stack` property on `targetObject`, which when accessed returns
|
|
66
|
+
a string representing the location in the code at which
|
|
67
|
+
`Error.captureStackTrace()` was called.
|
|
68
|
+
|
|
69
|
+
```js
|
|
70
|
+
const myObject = {};
|
|
71
|
+
Error.captureStackTrace(myObject);
|
|
72
|
+
myObject.stack; // Similar to `new Error().stack`
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
The first line of the trace will be prefixed with
|
|
76
|
+
`${myObject.name}: ${myObject.message}`.
|
|
77
|
+
|
|
78
|
+
The optional `constructorOpt` argument accepts a function. If given, all frames
|
|
79
|
+
above `constructorOpt`, including `constructorOpt`, will be omitted from the
|
|
80
|
+
generated stack trace.
|
|
81
|
+
|
|
82
|
+
The `constructorOpt` argument is useful for hiding implementation
|
|
83
|
+
details of error generation from the user. For instance:
|
|
84
|
+
|
|
85
|
+
```js
|
|
86
|
+
function a() {
|
|
87
|
+
b();
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function b() {
|
|
91
|
+
c();
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function c() {
|
|
95
|
+
// Create an error without stack trace to avoid calculating the stack trace twice.
|
|
96
|
+
const { stackTraceLimit } = Error;
|
|
97
|
+
Error.stackTraceLimit = 0;
|
|
98
|
+
const error = new Error();
|
|
99
|
+
Error.stackTraceLimit = stackTraceLimit;
|
|
100
|
+
|
|
101
|
+
// Capture the stack trace above function b
|
|
102
|
+
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
|
|
103
|
+
throw error;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
a();
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
#### Parameters
|
|
110
|
+
|
|
111
|
+
| Parameter | Type |
|
|
112
|
+
| ----------------- | ---------- |
|
|
113
|
+
| `targetObject` | `object` |
|
|
114
|
+
| `constructorOpt?` | `Function` |
|
|
115
|
+
|
|
116
|
+
#### Returns
|
|
117
|
+
|
|
118
|
+
`void`
|
|
119
|
+
|
|
120
|
+
#### Inherited from
|
|
121
|
+
|
|
122
|
+
[`PlayError`](../../../play/errors/classes/PlayError.md).[`captureStackTrace`](../../../play/errors/classes/PlayError.md#capturestacktrace)
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
### isError()
|
|
127
|
+
|
|
128
|
+
```ts
|
|
129
|
+
static isError(error): error is Error;
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Defined in: `typescript`
|
|
133
|
+
|
|
134
|
+
Indicates whether the argument provided is a built-in Error instance or not.
|
|
135
|
+
|
|
136
|
+
#### Parameters
|
|
137
|
+
|
|
138
|
+
| Parameter | Type |
|
|
139
|
+
| --------- | --------- |
|
|
140
|
+
| `error` | `unknown` |
|
|
141
|
+
|
|
142
|
+
#### Returns
|
|
143
|
+
|
|
144
|
+
`error is Error`
|
|
145
|
+
|
|
146
|
+
#### Inherited from
|
|
147
|
+
|
|
148
|
+
[`PlayError`](../../../play/errors/classes/PlayError.md).[`isError`](../../../play/errors/classes/PlayError.md#iserror)
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
### prepareStackTrace()
|
|
153
|
+
|
|
154
|
+
```ts
|
|
155
|
+
static prepareStackTrace(err, stackTraces): any;
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Defined in: `@types/node`
|
|
159
|
+
|
|
160
|
+
#### Parameters
|
|
161
|
+
|
|
162
|
+
| Parameter | Type |
|
|
163
|
+
| ------------- | ------------ |
|
|
164
|
+
| `err` | `Error` |
|
|
165
|
+
| `stackTraces` | `CallSite`[] |
|
|
166
|
+
|
|
167
|
+
#### Returns
|
|
168
|
+
|
|
169
|
+
`any`
|
|
170
|
+
|
|
171
|
+
#### See
|
|
172
|
+
|
|
173
|
+
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
|
|
174
|
+
|
|
175
|
+
#### Inherited from
|
|
176
|
+
|
|
177
|
+
[`PlayError`](../../../play/errors/classes/PlayError.md).[`prepareStackTrace`](../../../play/errors/classes/PlayError.md#preparestacktrace)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
[API](../../../README.md) / [@xmachines/play-vue-router](../README.md) / index
|
|
2
|
+
|
|
3
|
+
# index
|
|
4
|
+
|
|
5
|
+
## Classes
|
|
6
|
+
|
|
7
|
+
- [RouteMap](classes/RouteMap.md)
|
|
8
|
+
- [VueRouterBridge](classes/VueRouterBridge.md)
|
|
9
|
+
|
|
10
|
+
## Interfaces
|
|
11
|
+
|
|
12
|
+
- [PlayRouteEvent](interfaces/PlayRouteEvent.md)
|
|
13
|
+
- [RoutableActor](interfaces/RoutableActor.md)
|
|
14
|
+
- [RouteMapOptions](interfaces/RouteMapOptions.md)
|
|
15
|
+
- [RouteMapping](interfaces/RouteMapping.md)
|
|
16
|
+
- [RouterBridge](interfaces/RouterBridge.md)
|
|
17
|
+
|
|
18
|
+
## Variables
|
|
19
|
+
|
|
20
|
+
- [PlayRouterProvider](variables/PlayRouterProvider.md)
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
[API](../../../../README.md) / [@xmachines/play-vue-router](../../README.md) / [index](../README.md) / RouteMap
|
|
2
|
+
|
|
3
|
+
# Class: RouteMap
|
|
4
|
+
|
|
5
|
+
Defined in: [packages/play-router/src/base-route-map.ts:111](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/base-route-map.ts#L111)
|
|
6
|
+
|
|
7
|
+
The shared base class of the route map for both directions.
|
|
8
|
+
|
|
9
|
+
Every framework adapter uses this class as its route map. An adapter adds no logic
|
|
10
|
+
of its own, and it inherits the complete public API from here.
|
|
11
|
+
|
|
12
|
+
**The strategy of a lookup:**
|
|
13
|
+
|
|
14
|
+
- A static path, without a `:param` → a `Map` lookup in O(1)
|
|
15
|
+
- A dynamic path → a scan of the bucket index in O(k), with `URLPattern`, where
|
|
16
|
+
`k` is the number of the routes with the same first path segment
|
|
17
|
+
- The class keeps each result of a first match in an LRU cache. The default size
|
|
18
|
+
is 500 entries, and the `cacheSize` constructor option changes it
|
|
19
|
+
|
|
20
|
+
**The syntax of a pattern:** the whole URLPattern pathname grammar. The forms used most
|
|
21
|
+
often are:
|
|
22
|
+
|
|
23
|
+
- `:param` — a necessary segment. It matches exactly one segment without a `/`
|
|
24
|
+
- `:param?` — an optional segment. It matches zero segments or one segment without a `/`
|
|
25
|
+
- `*` — a wildcard. It matches each number of segments, as URLPattern defines
|
|
26
|
+
|
|
27
|
+
A `{…}` group, a `:param(\d+)` constraint, a `+` modifier and a `\:` escape are read
|
|
28
|
+
too. The [routing guide](../../../../../guides/routing.md) states every form, the prefix
|
|
29
|
+
rule, and the one divergence from the standard: a param name of this library can hold a
|
|
30
|
+
hyphen.
|
|
31
|
+
|
|
32
|
+
**The forms of a stateId:** you can register a stateId, and you can look one up,
|
|
33
|
+
in the form `"#stateId"` or in the form `"stateId"`. `RouteMap` makes the
|
|
34
|
+
canonical form itself. `getStateIdByPath` returns the stateId exactly as you
|
|
35
|
+
registered it, and `getPathByStateId` accepts both forms. A registration of the
|
|
36
|
+
same stateId in both forms gives one entry, and the later registration wins for
|
|
37
|
+
the lookup in the other direction.
|
|
38
|
+
|
|
39
|
+
## Example
|
|
40
|
+
|
|
41
|
+
```typescript
|
|
42
|
+
import { RouteMap } from "@xmachines/play-router";
|
|
43
|
+
|
|
44
|
+
const map = new RouteMap([
|
|
45
|
+
{ stateId: "home", path: "/" },
|
|
46
|
+
{ stateId: "profile", path: "/profile/:userId" },
|
|
47
|
+
{ stateId: "settings", path: "/settings/:section?" },
|
|
48
|
+
]);
|
|
49
|
+
|
|
50
|
+
map.getStateIdByPath("/"); // "home"
|
|
51
|
+
map.getStateIdByPath("/profile/123"); // "profile"
|
|
52
|
+
map.getStateIdByPath("/settings"); // "settings"
|
|
53
|
+
map.getStateIdByPath("/unknown"); // null
|
|
54
|
+
|
|
55
|
+
map.getPathByStateId("profile"); // "/profile/:userId"
|
|
56
|
+
map.getPathByStateId("missing"); // null
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Constructors
|
|
60
|
+
|
|
61
|
+
### Constructor
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
new RouteMap(mappings, options?): RouteMap;
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Defined in: [packages/play-router/src/base-route-map.ts:139](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/base-route-map.ts#L139)
|
|
68
|
+
|
|
69
|
+
Builds a route map from an array of the mappings between a state ID and a path.
|
|
70
|
+
|
|
71
|
+
The constructor puts each static path, which holds no `:param`, into a `Map` for a
|
|
72
|
+
lookup in O(1). It compiles each parameterized path to a `URLPattern`, and it
|
|
73
|
+
groups the patterns into the buckets of the first segment. The selection of the
|
|
74
|
+
candidates is therefore efficient.
|
|
75
|
+
|
|
76
|
+
#### Parameters
|
|
77
|
+
|
|
78
|
+
| Parameter | Type | Description |
|
|
79
|
+
| -------------------- | ------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
80
|
+
| `mappings` | [`RouteMapping`](../interfaces/RouteMapping.md)[] | The array of the `{ stateId, path }` entries. The order gives the priority when more than one pattern can match the same path. |
|
|
81
|
+
| `options` | \{ `cacheSize?`: `number`; \} | The optional configuration. `options.cacheSize`: the maximum number of the resolved parameterized path lookups in the cache. The default is `500`. Raise it for an application with many different values in a parameterized URL, for example a page of a user profile with thousands of different IDs. After an eviction, the path goes to the bucket pattern scan in O(k) again, which is correct but slower. The smallest effective value is `1`, because QuickLRU requires it. |
|
|
82
|
+
| `options.cacheSize?` | `number` | - |
|
|
83
|
+
|
|
84
|
+
#### Returns
|
|
85
|
+
|
|
86
|
+
`RouteMap`
|
|
87
|
+
|
|
88
|
+
## Methods
|
|
89
|
+
|
|
90
|
+
### getPathByStateId()
|
|
91
|
+
|
|
92
|
+
```ts
|
|
93
|
+
getPathByStateId(stateId): string | null;
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Defined in: [packages/play-router/src/base-route-map.ts:242](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/base-route-map.ts#L242)
|
|
97
|
+
|
|
98
|
+
Returns the path pattern of a state ID.
|
|
99
|
+
|
|
100
|
+
The method accepts the stateId in the form `"#stateId"` and in the form
|
|
101
|
+
`"stateId"`, and the form of the registration has no effect. The method makes the
|
|
102
|
+
canonical form itself. Therefore a consumer tries never both forms.
|
|
103
|
+
|
|
104
|
+
#### Parameters
|
|
105
|
+
|
|
106
|
+
| Parameter | Type | Description |
|
|
107
|
+
| --------- | -------- | --------------------------------------------------------------------------- |
|
|
108
|
+
| `stateId` | `string` | The state ID of the state machine, for example `"profile"` or `"#settings"` |
|
|
109
|
+
|
|
110
|
+
#### Returns
|
|
111
|
+
|
|
112
|
+
`string` \| `null`
|
|
113
|
+
|
|
114
|
+
The registered path pattern, or `null` when the state ID is unknown
|
|
115
|
+
|
|
116
|
+
#### Example
|
|
117
|
+
|
|
118
|
+
```typescript
|
|
119
|
+
map.getPathByStateId("profile"); // "/profile/:userId"
|
|
120
|
+
map.getPathByStateId("#profile"); // "/profile/:userId" — the same entry
|
|
121
|
+
map.getPathByStateId("missing"); // null
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
### getStateIdByPath()
|
|
127
|
+
|
|
128
|
+
```ts
|
|
129
|
+
getStateIdByPath(path): string | null;
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Defined in: [packages/play-router/src/base-route-map.ts:197](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/base-route-map.ts#L197)
|
|
133
|
+
|
|
134
|
+
Resolves a URL path to its state ID.
|
|
135
|
+
|
|
136
|
+
The method removes the query string and the hash fragment before the match. It
|
|
137
|
+
tries an exact lookup in O(1) first, then it uses the pattern match on the bucket
|
|
138
|
+
index. It keeps each result of a first pattern match in the cache.
|
|
139
|
+
|
|
140
|
+
#### Parameters
|
|
141
|
+
|
|
142
|
+
| Parameter | Type | Description |
|
|
143
|
+
| --------- | -------- | -------------------------------------------------------------------------------------- |
|
|
144
|
+
| `path` | `string` | The URL pathname. It can hold a query and a hash, for example `"/profile/123?ref=nav"` |
|
|
145
|
+
|
|
146
|
+
#### Returns
|
|
147
|
+
|
|
148
|
+
`string` \| `null`
|
|
149
|
+
|
|
150
|
+
The state ID of the path, or `null` when no route matches
|
|
151
|
+
|
|
152
|
+
#### Example
|
|
153
|
+
|
|
154
|
+
```typescript
|
|
155
|
+
map.getStateIdByPath("/profile/123"); // "profile"
|
|
156
|
+
map.getStateIdByPath("/unknown"); // null
|
|
157
|
+
```
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
[API](
|
|
1
|
+
[API](../../../../README.md) / [@xmachines/play-vue-router](../../README.md) / [index](../README.md) / VueRouterBridge
|
|
2
2
|
|
|
3
3
|
# Class: VueRouterBridge
|
|
4
4
|
|
|
5
|
-
Defined in: [play-vue-router/src/vue-router-bridge.ts:39](https://gitlab.com/xmachin-es/xmachines-js/-/blob/
|
|
5
|
+
Defined in: [packages/play-vue-router/src/vue-router-bridge.ts:39](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-vue-router/src/vue-router-bridge.ts#L39)
|
|
6
6
|
|
|
7
|
-
@xmachines/play-vue-router - Vue Router 4
|
|
7
|
+
@xmachines/play-vue-router - Vue Router 4/5 adapter for XMachines Play
|
|
8
8
|
|
|
9
9
|
It integrates Vue Router with an XMachines state machine, in both directions.
|
|
10
10
|
|
|
11
11
|
## Extends
|
|
12
12
|
|
|
13
|
-
- [`RouterBridgeBase`](
|
|
13
|
+
- [`RouterBridgeBase`](../../../play-router/index/classes/RouterBridgeBase.md)
|
|
14
14
|
|
|
15
15
|
## Constructors
|
|
16
16
|
|
|
@@ -21,19 +21,20 @@ new VueRouterBridge(
|
|
|
21
21
|
vueRouter,
|
|
22
22
|
actor,
|
|
23
23
|
routeMap,
|
|
24
|
-
options?
|
|
24
|
+
options?
|
|
25
|
+
): VueRouterBridge;
|
|
25
26
|
```
|
|
26
27
|
|
|
27
|
-
Defined in: [play-vue-router/src/vue-router-bridge.ts:48](https://gitlab.com/xmachin-es/xmachines-js/-/blob/
|
|
28
|
+
Defined in: [packages/play-vue-router/src/vue-router-bridge.ts:48](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-vue-router/src/vue-router-bridge.ts#L48)
|
|
28
29
|
|
|
29
30
|
#### Parameters
|
|
30
31
|
|
|
31
|
-
| Parameter | Type
|
|
32
|
-
| ----------- |
|
|
33
|
-
| `vueRouter` | `RouterClassic`
|
|
34
|
-
| `actor` | [`RoutableActor`](
|
|
35
|
-
| `routeMap` | [`RouteMap`](RouteMap.md)
|
|
36
|
-
| `options?` | [`BasePathOptions`](
|
|
32
|
+
| Parameter | Type |
|
|
33
|
+
| ----------- | --------------------------------------------------------------------------- |
|
|
34
|
+
| `vueRouter` | `RouterClassic` |
|
|
35
|
+
| `actor` | [`RoutableActor`](../interfaces/RoutableActor.md) |
|
|
36
|
+
| `routeMap` | [`RouteMap`](RouteMap.md) |
|
|
37
|
+
| `options?` | [`BasePathOptions`](../../../play-dom-router/interfaces/BasePathOptions.md) |
|
|
37
38
|
|
|
38
39
|
#### Returns
|
|
39
40
|
|
|
@@ -41,7 +42,7 @@ Defined in: [play-vue-router/src/vue-router-bridge.ts:48](https://gitlab.com/xma
|
|
|
41
42
|
|
|
42
43
|
#### Overrides
|
|
43
44
|
|
|
44
|
-
[`RouterBridgeBase`](
|
|
45
|
+
[`RouterBridgeBase`](../../../play-router/index/classes/RouterBridgeBase.md).[`constructor`](../../../play-router/index/classes/RouterBridgeBase.md#constructor)
|
|
45
46
|
|
|
46
47
|
## Accessors
|
|
47
48
|
|
|
@@ -53,7 +54,7 @@ Defined in: [play-vue-router/src/vue-router-bridge.ts:48](https://gitlab.com/xma
|
|
|
53
54
|
get basePath(): string;
|
|
54
55
|
```
|
|
55
56
|
|
|
56
|
-
Defined in: [play-router/src/router-bridge-base.ts:
|
|
57
|
+
Defined in: [packages/play-router/src/router-bridge-base.ts:256](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/router-bridge-base.ts#L256)
|
|
57
58
|
|
|
58
59
|
The resolved URL prefix that the machine of this bridge is mounted under, or `""`
|
|
59
60
|
when the machine owns the complete router.
|
|
@@ -66,7 +67,7 @@ The resolved URL prefix of the mount, or `""` when the machine owns the complete
|
|
|
66
67
|
|
|
67
68
|
#### Inherited from
|
|
68
69
|
|
|
69
|
-
[`RouterBridgeBase`](
|
|
70
|
+
[`RouterBridgeBase`](../../../play-router/index/classes/RouterBridgeBase.md).[`basePath`](../../../play-router/index/classes/RouterBridgeBase.md#basepath)
|
|
70
71
|
|
|
71
72
|
---
|
|
72
73
|
|
|
@@ -78,7 +79,7 @@ The resolved URL prefix of the mount, or `""` when the machine owns the complete
|
|
|
78
79
|
get basePathParams(): Readonly<Record<string, string>>;
|
|
79
80
|
```
|
|
80
81
|
|
|
81
|
-
Defined in: [play-router/src/router-bridge-base.ts:
|
|
82
|
+
Defined in: [packages/play-router/src/router-bridge-base.ts:285](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/router-bridge-base.ts#L285)
|
|
82
83
|
|
|
83
84
|
The resolved values of the `:param` segments of the mount, or `{}` for a prefix
|
|
84
85
|
without a param.
|
|
@@ -119,7 +120,7 @@ mount while the machine stays on the same route, and no event goes out.
|
|
|
119
120
|
|
|
120
121
|
#### Inherited from
|
|
121
122
|
|
|
122
|
-
[`RouterBridgeBase`](
|
|
123
|
+
[`RouterBridgeBase`](../../../play-router/index/classes/RouterBridgeBase.md).[`basePathParams`](../../../play-router/index/classes/RouterBridgeBase.md#basepathparams)
|
|
123
124
|
|
|
124
125
|
## Methods
|
|
125
126
|
|
|
@@ -129,7 +130,7 @@ mount while the machine stays on the same route, and no event goes out.
|
|
|
129
130
|
connect(): void;
|
|
130
131
|
```
|
|
131
132
|
|
|
132
|
-
Defined in: [play-router/src/router-bridge-base.ts:
|
|
133
|
+
Defined in: [packages/play-router/src/router-bridge-base.ts:507](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/router-bridge-base.ts#L507)
|
|
133
134
|
|
|
134
135
|
Connects the router bridge to the Actor.
|
|
135
136
|
|
|
@@ -153,7 +154,7 @@ An adapter that needs a different behavior of the first synchronization override
|
|
|
153
154
|
|
|
154
155
|
#### Inherited from
|
|
155
156
|
|
|
156
|
-
[`RouterBridgeBase`](
|
|
157
|
+
[`RouterBridgeBase`](../../../play-router/index/classes/RouterBridgeBase.md).[`connect`](../../../play-router/index/classes/RouterBridgeBase.md#connect)
|
|
157
158
|
|
|
158
159
|
---
|
|
159
160
|
|
|
@@ -163,7 +164,7 @@ An adapter that needs a different behavior of the first synchronization override
|
|
|
163
164
|
disconnect(): void;
|
|
164
165
|
```
|
|
165
166
|
|
|
166
|
-
Defined in: [play-router/src/router-bridge-base.ts:
|
|
167
|
+
Defined in: [packages/play-router/src/router-bridge-base.ts:765](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/router-bridge-base.ts#L765)
|
|
167
168
|
|
|
168
169
|
Disconnects the router bridge from the Actor.
|
|
169
170
|
|
|
@@ -176,27 +177,7 @@ framework.
|
|
|
176
177
|
|
|
177
178
|
#### Inherited from
|
|
178
179
|
|
|
179
|
-
[`RouterBridgeBase`](
|
|
180
|
-
|
|
181
|
-
---
|
|
182
|
-
|
|
183
|
-
### ~~dispose()~~
|
|
184
|
-
|
|
185
|
-
```ts
|
|
186
|
-
dispose(): void;
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
Defined in: [play-vue-router/src/vue-router-bridge.ts:247](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-vue-router/src/vue-router-bridge.ts#L247)
|
|
190
|
-
|
|
191
|
-
The cleanup alias for the Vue component lifecycle (`onUnmounted(() => bridge.dispose())`).
|
|
192
|
-
|
|
193
|
-
#### Returns
|
|
194
|
-
|
|
195
|
-
`void`
|
|
196
|
-
|
|
197
|
-
#### Deprecated
|
|
198
|
-
|
|
199
|
-
Use [disconnect](#disconnect). Will be removed in the next major.
|
|
180
|
+
[`RouterBridgeBase`](../../../play-router/index/classes/RouterBridgeBase.md).[`disconnect`](../../../play-router/index/classes/RouterBridgeBase.md#disconnect)
|
|
200
181
|
|
|
201
182
|
---
|
|
202
183
|
|
|
@@ -206,7 +187,7 @@ Use [disconnect](#disconnect). Will be removed in the next major.
|
|
|
206
187
|
setBasePath(basePath?, basePathParams?): void;
|
|
207
188
|
```
|
|
208
189
|
|
|
209
|
-
Defined in: [play-router/src/router-bridge-base.ts:
|
|
190
|
+
Defined in: [packages/play-router/src/router-bridge-base.ts:325](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/router-bridge-base.ts#L325)
|
|
210
191
|
|
|
211
192
|
Moves the machine to a different mount point, while it stays connected.
|
|
212
193
|
|
|
@@ -258,4 +239,4 @@ bridge.setBasePath("/:region/:machineId/play", { region: "us", machineId });
|
|
|
258
239
|
|
|
259
240
|
#### Inherited from
|
|
260
241
|
|
|
261
|
-
[`RouterBridgeBase`](
|
|
242
|
+
[`RouterBridgeBase`](../../../play-router/index/classes/RouterBridgeBase.md).[`setBasePath`](../../../play-router/index/classes/RouterBridgeBase.md#setbasepath)
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
[API](../../../../README.md) / [@xmachines/play-vue-router](../../README.md) / [index](../README.md) / PlayRouteEvent
|
|
2
|
+
|
|
3
|
+
# Interface: PlayRouteEvent
|
|
4
|
+
|
|
5
|
+
Defined in: [packages/play-router/src/types.ts:336](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/types.ts#L336)
|
|
6
|
+
|
|
7
|
+
The routing event, with its parameters and its query
|
|
8
|
+
|
|
9
|
+
This is the one routing event of the complete Play architecture. It supports a
|
|
10
|
+
navigation that knows the parameters, for example `/profile/:userId`, for a dynamic
|
|
11
|
+
route segment.
|
|
12
|
+
|
|
13
|
+
**Architectural context:** the event implements **Passive Infrastructure
|
|
14
|
+
(INV-04)**, because it holds the navigation intent of the user, and the Actor then
|
|
15
|
+
evaluates that intent with its guards. The infrastructure makes a request with a
|
|
16
|
+
`play.route` event, and the Actor decides with a transition of its state machine.
|
|
17
|
+
|
|
18
|
+
**The flow of a browser navigation:**
|
|
19
|
+
|
|
20
|
+
1. The browser fires `popstate`
|
|
21
|
+
2. The router adapter resolves the URL to a route target
|
|
22
|
+
3. The adapter sends a `PlayRouteEvent` to the Actor
|
|
23
|
+
4. The Actor checks the transition with the guards of its state machine
|
|
24
|
+
|
|
25
|
+
## Param
|
|
26
|
+
|
|
27
|
+
**type**
|
|
28
|
+
|
|
29
|
+
The discriminator of the event. It is always "play.route"
|
|
30
|
+
|
|
31
|
+
## Param
|
|
32
|
+
|
|
33
|
+
**to**
|
|
34
|
+
|
|
35
|
+
The target state ID, with a # prefix, for example '#home' or '#profile'
|
|
36
|
+
|
|
37
|
+
## Param
|
|
38
|
+
|
|
39
|
+
**params**
|
|
40
|
+
|
|
41
|
+
The route parameters of the path only, from the URL path, for
|
|
42
|
+
example `{ userId: '123' }` of `/profile/123`. The `query` field holds the query
|
|
43
|
+
parameters separately.
|
|
44
|
+
|
|
45
|
+
## Param
|
|
46
|
+
|
|
47
|
+
**query**
|
|
48
|
+
|
|
49
|
+
The query parameters only. They stay separate from the params of the path
|
|
50
|
+
|
|
51
|
+
## Param
|
|
52
|
+
|
|
53
|
+
**match**
|
|
54
|
+
|
|
55
|
+
The complete match result of URLPattern, for the debug work and for
|
|
56
|
+
the observability. It is optional
|
|
57
|
+
|
|
58
|
+
## Examples
|
|
59
|
+
|
|
60
|
+
The base event and the routing event together
|
|
61
|
+
|
|
62
|
+
```typescript
|
|
63
|
+
import type { PlayEvent } from "@xmachines/play";
|
|
64
|
+
import type { PlayRouteEvent } from "@xmachines/play-router";
|
|
65
|
+
|
|
66
|
+
type AppEvent = PlayEvent | PlayRouteEvent;
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
A basic navigation to a route
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
import type { PlayRouteEvent } from "@xmachines/play-router";
|
|
73
|
+
|
|
74
|
+
const event: PlayRouteEvent = {
|
|
75
|
+
type: "play.route",
|
|
76
|
+
to: "#home",
|
|
77
|
+
};
|
|
78
|
+
actor.send(event);
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
A navigation with route parameters
|
|
82
|
+
|
|
83
|
+
```typescript
|
|
84
|
+
import type { PlayRouteEvent } from "@xmachines/play-router";
|
|
85
|
+
|
|
86
|
+
const event: PlayRouteEvent = {
|
|
87
|
+
type: "play.route",
|
|
88
|
+
to: "#profile",
|
|
89
|
+
params: { userId: "123" },
|
|
90
|
+
};
|
|
91
|
+
actor.send(event);
|
|
92
|
+
// It resolves to the route /profile/123
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
A navigation with query parameters
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
import type { PlayRouteEvent } from "@xmachines/play-router";
|
|
99
|
+
|
|
100
|
+
const event: PlayRouteEvent = {
|
|
101
|
+
type: "play.route",
|
|
102
|
+
to: "#settings",
|
|
103
|
+
params: { section: "profile" }, // a route parameter of the path only
|
|
104
|
+
query: { tab: "security" }, // the query only
|
|
105
|
+
};
|
|
106
|
+
actor.send(event);
|
|
107
|
+
// It resolves to the route /settings/profile?tab=security
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## See
|
|
111
|
+
|
|
112
|
+
[Play RFC](../../../../../rfc/play.md)
|
|
113
|
+
|
|
114
|
+
## Remarks
|
|
115
|
+
|
|
116
|
+
Use `play.route` when you need a navigation that knows the parameters, with the
|
|
117
|
+
`route: {}` config pattern on the nodes of your state machine. The `match` field
|
|
118
|
+
gives you the complete URLPatternResult, for an advanced use such as a debug or an
|
|
119
|
+
analysis of the pattern.
|
|
120
|
+
|
|
121
|
+
## Properties
|
|
122
|
+
|
|
123
|
+
| Property | Modifier | Type | Description | Defined in |
|
|
124
|
+
| -------------------------------------- | ---------- | ------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
|
|
125
|
+
| <a id="property-data"></a> `data?` | `readonly` | [`RouteData`](../../../play-router/index/type-aliases/RouteData.md) | The extra data that the SENDER of this event supplies: a router bridge, or the code of an application. It is not what the target state declares — that is [RouteObject.data](../../../play-router/index/interfaces/RouteObject.md#property-data), and a resolver there reads this field. | [packages/play-router/src/types.ts:346](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/types.ts#L346) |
|
|
126
|
+
| <a id="property-match"></a> `match?` | `readonly` | `unknown` | - | [packages/play-router/src/types.ts:347](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/types.ts#L347) |
|
|
127
|
+
| <a id="property-params"></a> `params?` | `readonly` | `Record`\<`string`, `string`\> | - | [packages/play-router/src/types.ts:339](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/types.ts#L339) |
|
|
128
|
+
| <a id="property-query"></a> `query?` | `readonly` | `Record`\<`string`, `string`\> | - | [packages/play-router/src/types.ts:340](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/types.ts#L340) |
|
|
129
|
+
| <a id="property-to"></a> `to` | `readonly` | `string` | - | [packages/play-router/src/types.ts:338](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/types.ts#L338) |
|
|
130
|
+
| <a id="property-type"></a> `type` | `readonly` | `"play.route"` | - | [packages/play-router/src/types.ts:337](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-router/src/types.ts#L337) |
|