@xmachines/docs 2.2.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 +75 -97
- 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/index/functions/asCleanup.md +78 -0
- 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/index/type-aliases/Cleanup.md +38 -0
- package/api/@xmachines/play/index/type-aliases/DisposeKey.md +32 -0
- package/api/@xmachines/play/{type-aliases → index/type-aliases}/PlayEvent.md +4 -4
- package/api/@xmachines/play/index/variables/DISPOSE.md +34 -0
- package/api/@xmachines/play-actor/README.md +78 -222
- 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 +99 -43
- 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 +6 -6
- package/api/@xmachines/play-dom/functions/createRenderer.md +3 -3
- package/api/@xmachines/play-dom/interfaces/CreatePlayUIOptions.md +17 -11
- package/api/@xmachines/play-dom/interfaces/MountOptions.md +5 -4
- package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +14 -12
- package/api/@xmachines/play-dom/type-aliases/Cleanup.md +38 -0
- package/api/@xmachines/play-dom/type-aliases/MountFn.md +30 -8
- package/api/@xmachines/play-dom-router/README.md +99 -73
- 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 +7 -1
- package/api/@xmachines/play-dom-router/functions/createRouter.md +12 -6
- package/api/@xmachines/play-dom-router/interfaces/BasePathOptions.md +5 -5
- package/api/@xmachines/play-dom-router/interfaces/BrowserHistory.md +73 -19
- package/api/@xmachines/play-dom-router/interfaces/BrowserWindow.md +16 -16
- 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 +36 -7
- package/api/@xmachines/play-dom-router/interfaces/VanillaRouter.md +40 -6
- package/api/@xmachines/play-dom-router/type-aliases/Cleanup.md +38 -0
- package/api/@xmachines/play-dom-router/variables/DISPOSE.md +34 -0
- package/api/@xmachines/play-react/README.md +18 -40
- package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +50 -11
- 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 +8 -6
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryState.md +6 -5
- 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 +108 -189
- 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 +38 -9
- 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-router/index/variables/DISPOSE.md +34 -0
- 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-dom-router → play-router/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 +5 -25
- package/api/@xmachines/play-signals/functions/watchSignal.md +27 -4
- 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 +38 -0
- package/api/@xmachines/play-signals/type-aliases/WatcherNotify.md +1 -1
- package/api/@xmachines/play-solid/README.md +36 -35
- package/api/@xmachines/play-solid/functions/useActor.md +1 -1
- package/api/@xmachines/play-solid/functions/usePlayView.md +14 -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 +16 -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 +13 -28
- 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 +7 -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 +36 -7
- 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 +36 -7
- 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-view/index/functions/createFailureLatch.md +20 -0
- package/api/@xmachines/play-view/index/functions/createReportGuard.md +26 -0
- 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-view/index/functions/sameViewInputs.md +25 -0
- 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-view/index/interfaces/FailureLatch.md +60 -0
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/PlaySpec.md +8 -8
- package/api/@xmachines/play-view/index/interfaces/ReportGuard.md +92 -0
- package/api/@xmachines/play-view/index/interfaces/ReportGuardMessages.md +18 -0
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/ResolveViewStoreOptions.md +5 -5
- package/api/@xmachines/play-view/index/interfaces/ViewInputs.md +19 -0
- 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 +46 -42
- 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 +6 -1
- package/api/@xmachines/play-vue/interfaces/ActorProviderProps.md +13 -8
- package/api/@xmachines/play-vue/interfaces/PlayUIProviderProps.md +15 -10
- 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 +163 -98
- 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-xstate/index/variables/DISPOSE.md +34 -0
- 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 +97 -65
- package/contributing/configuration.md +142 -41
- package/contributing/deployment.md +30 -28
- package/contributing/development.md +94 -31
- package/contributing/testing.md +90 -31
- 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 +47 -44
- package/guides/inspector.md +4 -4
- package/guides/routing.md +245 -0
- package/guides/signals.md +43 -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-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/createRouteMap.md +0 -40
- 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 -34
- 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 -532
- 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
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Class: DomRouterBridge
|
|
4
4
|
|
|
5
|
-
Defined in: [play-dom-router/src/dom-router-bridge.ts:27](https://gitlab.com/xmachin-es/xmachines-js/-/blob/
|
|
5
|
+
Defined in: [play-dom-router/src/dom-router-bridge.ts:27](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-dom-router/src/dom-router-bridge.ts#L27)
|
|
6
6
|
|
|
7
7
|
The DOM router bridge — it puts a BrowserHistory from `createBrowserHistory`
|
|
8
8
|
behind the `RouterBridgeBase` protocol.
|
|
@@ -27,7 +27,7 @@ full control of the connection lifecycle.
|
|
|
27
27
|
|
|
28
28
|
## Extends
|
|
29
29
|
|
|
30
|
-
- [`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md)
|
|
30
|
+
- [`RouterBridgeBase`](../../play-router/index/classes/RouterBridgeBase.md)
|
|
31
31
|
|
|
32
32
|
## Constructors
|
|
33
33
|
|
|
@@ -38,19 +38,20 @@ new DomRouterBridge(
|
|
|
38
38
|
actor,
|
|
39
39
|
routeMap,
|
|
40
40
|
history,
|
|
41
|
-
options?
|
|
41
|
+
options?
|
|
42
|
+
): DomRouterBridge;
|
|
42
43
|
```
|
|
43
44
|
|
|
44
|
-
Defined in: [play-dom-router/src/dom-router-bridge.ts:
|
|
45
|
+
Defined in: [play-dom-router/src/dom-router-bridge.ts:40](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-dom-router/src/dom-router-bridge.ts#L40)
|
|
45
46
|
|
|
46
47
|
#### Parameters
|
|
47
48
|
|
|
48
|
-
| Parameter | Type | Description
|
|
49
|
-
| ---------- | ------------------------------------------------------------- |
|
|
50
|
-
| `actor` | [`RoutableActor`](../interfaces/RoutableActor.md) | A `Routable` actor with `currentRoute` and `send`.
|
|
51
|
-
| `routeMap` | [`RouteLookupContract`](../interfaces/RouteLookupContract.md) | The route lookup for both directions. Every object that satisfies [RouteLookupContract](../interfaces/RouteLookupContract.md) works.
|
|
52
|
-
| `history` | [`BrowserHistory`](../interfaces/BrowserHistory.md) | The
|
|
53
|
-
| `options?` | [`BasePathOptions`](../interfaces/BasePathOptions.md) | -
|
|
49
|
+
| Parameter | Type | Description |
|
|
50
|
+
| ---------- | ------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
51
|
+
| `actor` | [`RoutableActor`](../interfaces/RoutableActor.md) | A `Routable` actor with `currentRoute` and `send`. |
|
|
52
|
+
| `routeMap` | [`RouteLookupContract`](../interfaces/RouteLookupContract.md) | The route lookup for both directions. Every object that satisfies [RouteLookupContract](../interfaces/RouteLookupContract.md) works. |
|
|
53
|
+
| `history` | [`BrowserHistory`](../interfaces/BrowserHistory.md) | The history to read. `createBrowserHistory` builds one. Of the interface this class touches three members — `location`, `push` and `subscribe` — and it releases the history never, because the owner of the history does that. The parameter still asks for the WHOLE interface, because that is the type of a history: a stand-in for one writes `destroy()` and `[DISPOSE]()` beside the three, and the README of this package shows the shape. |
|
|
54
|
+
| `options?` | [`BasePathOptions`](../interfaces/BasePathOptions.md) | - |
|
|
54
55
|
|
|
55
56
|
#### Returns
|
|
56
57
|
|
|
@@ -58,7 +59,7 @@ Defined in: [play-dom-router/src/dom-router-bridge.ts:35](https://gitlab.com/xma
|
|
|
58
59
|
|
|
59
60
|
#### Overrides
|
|
60
61
|
|
|
61
|
-
[`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`constructor`](../../play-router/classes/RouterBridgeBase.md#constructor)
|
|
62
|
+
[`RouterBridgeBase`](../../play-router/index/classes/RouterBridgeBase.md).[`constructor`](../../play-router/index/classes/RouterBridgeBase.md#constructor)
|
|
62
63
|
|
|
63
64
|
## Accessors
|
|
64
65
|
|
|
@@ -70,7 +71,7 @@ Defined in: [play-dom-router/src/dom-router-bridge.ts:35](https://gitlab.com/xma
|
|
|
70
71
|
get basePath(): string;
|
|
71
72
|
```
|
|
72
73
|
|
|
73
|
-
Defined in: [play-router/src/router-bridge-base.ts:
|
|
74
|
+
Defined in: [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)
|
|
74
75
|
|
|
75
76
|
The resolved URL prefix that the machine of this bridge is mounted under, or `""`
|
|
76
77
|
when the machine owns the complete router.
|
|
@@ -83,7 +84,7 @@ The resolved URL prefix of the mount, or `""` when the machine owns the complete
|
|
|
83
84
|
|
|
84
85
|
#### Inherited from
|
|
85
86
|
|
|
86
|
-
[`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`basePath`](../../play-router/classes/RouterBridgeBase.md#basepath)
|
|
87
|
+
[`RouterBridgeBase`](../../play-router/index/classes/RouterBridgeBase.md).[`basePath`](../../play-router/index/classes/RouterBridgeBase.md#basepath)
|
|
87
88
|
|
|
88
89
|
---
|
|
89
90
|
|
|
@@ -95,7 +96,7 @@ The resolved URL prefix of the mount, or `""` when the machine owns the complete
|
|
|
95
96
|
get basePathParams(): Readonly<Record<string, string>>;
|
|
96
97
|
```
|
|
97
98
|
|
|
98
|
-
Defined in: [play-router/src/router-bridge-base.ts:
|
|
99
|
+
Defined in: [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)
|
|
99
100
|
|
|
100
101
|
The resolved values of the `:param` segments of the mount, or `{}` for a prefix
|
|
101
102
|
without a param.
|
|
@@ -136,7 +137,7 @@ mount while the machine stays on the same route, and no event goes out.
|
|
|
136
137
|
|
|
137
138
|
#### Inherited from
|
|
138
139
|
|
|
139
|
-
[`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`basePathParams`](../../play-router/classes/RouterBridgeBase.md#basepathparams)
|
|
140
|
+
[`RouterBridgeBase`](../../play-router/index/classes/RouterBridgeBase.md).[`basePathParams`](../../play-router/index/classes/RouterBridgeBase.md#basepathparams)
|
|
140
141
|
|
|
141
142
|
## Methods
|
|
142
143
|
|
|
@@ -146,7 +147,7 @@ mount while the machine stays on the same route, and no event goes out.
|
|
|
146
147
|
connect(): void;
|
|
147
148
|
```
|
|
148
149
|
|
|
149
|
-
Defined in: [play-router/src/router-bridge-base.ts:
|
|
150
|
+
Defined in: [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)
|
|
150
151
|
|
|
151
152
|
Connects the router bridge to the Actor.
|
|
152
153
|
|
|
@@ -170,7 +171,7 @@ An adapter that needs a different behavior of the first synchronization override
|
|
|
170
171
|
|
|
171
172
|
#### Inherited from
|
|
172
173
|
|
|
173
|
-
[`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`connect`](../../play-router/classes/RouterBridgeBase.md#connect)
|
|
174
|
+
[`RouterBridgeBase`](../../play-router/index/classes/RouterBridgeBase.md).[`connect`](../../play-router/index/classes/RouterBridgeBase.md#connect)
|
|
174
175
|
|
|
175
176
|
---
|
|
176
177
|
|
|
@@ -180,7 +181,7 @@ An adapter that needs a different behavior of the first synchronization override
|
|
|
180
181
|
disconnect(): void;
|
|
181
182
|
```
|
|
182
183
|
|
|
183
|
-
Defined in: [play-router/src/router-bridge-base.ts:
|
|
184
|
+
Defined in: [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)
|
|
184
185
|
|
|
185
186
|
Disconnects the router bridge from the Actor.
|
|
186
187
|
|
|
@@ -193,7 +194,7 @@ framework.
|
|
|
193
194
|
|
|
194
195
|
#### Inherited from
|
|
195
196
|
|
|
196
|
-
[`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`disconnect`](../../play-router/classes/RouterBridgeBase.md#disconnect)
|
|
197
|
+
[`RouterBridgeBase`](../../play-router/index/classes/RouterBridgeBase.md).[`disconnect`](../../play-router/index/classes/RouterBridgeBase.md#disconnect)
|
|
197
198
|
|
|
198
199
|
---
|
|
199
200
|
|
|
@@ -203,7 +204,7 @@ framework.
|
|
|
203
204
|
setBasePath(basePath?, basePathParams?): void;
|
|
204
205
|
```
|
|
205
206
|
|
|
206
|
-
Defined in: [play-router/src/router-bridge-base.ts:
|
|
207
|
+
Defined in: [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)
|
|
207
208
|
|
|
208
209
|
Moves the machine to a different mount point, while it stays connected.
|
|
209
210
|
|
|
@@ -255,4 +256,4 @@ bridge.setBasePath("/:region/:machineId/play", { region: "us", machineId });
|
|
|
255
256
|
|
|
256
257
|
#### Inherited from
|
|
257
258
|
|
|
258
|
-
[`RouterBridgeBase`](../../play-router/classes/RouterBridgeBase.md).[`setBasePath`](../../play-router/classes/RouterBridgeBase.md#setbasepath)
|
|
259
|
+
[`RouterBridgeBase`](../../play-router/index/classes/RouterBridgeBase.md).[`setBasePath`](../../play-router/index/classes/RouterBridgeBase.md#setbasepath)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
[API](../../../README.md) / [@xmachines/play-
|
|
1
|
+
[API](../../../README.md) / [@xmachines/play-dom-router](../README.md) / RouteMap
|
|
2
2
|
|
|
3
3
|
# Class: RouteMap
|
|
4
4
|
|
|
5
|
-
Defined in: [play-router/src/base-route-map.ts:
|
|
5
|
+
Defined in: [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
6
|
|
|
7
7
|
The shared base class of the route map for both directions.
|
|
8
8
|
|
|
@@ -17,12 +17,18 @@ of its own, and it inherits the complete public API from here.
|
|
|
17
17
|
- The class keeps each result of a first match in an LRU cache. The default size
|
|
18
18
|
is 500 entries, and the `cacheSize` constructor option changes it
|
|
19
19
|
|
|
20
|
-
**The syntax of a pattern
|
|
20
|
+
**The syntax of a pattern:** the whole URLPattern pathname grammar. The forms used most
|
|
21
|
+
often are:
|
|
21
22
|
|
|
22
23
|
- `:param` — a necessary segment. It matches exactly one segment without a `/`
|
|
23
24
|
- `:param?` — an optional segment. It matches zero segments or one segment without a `/`
|
|
24
25
|
- `*` — a wildcard. It matches each number of segments, as URLPattern defines
|
|
25
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
|
+
|
|
26
32
|
**The forms of a stateId:** you can register a stateId, and you can look one up,
|
|
27
33
|
in the form `"#stateId"` or in the form `"stateId"`. `RouteMap` makes the
|
|
28
34
|
canonical form itself. `getStateIdByPath` returns the stateId exactly as you
|
|
@@ -58,7 +64,7 @@ map.getPathByStateId("missing"); // null
|
|
|
58
64
|
new RouteMap(mappings, options?): RouteMap;
|
|
59
65
|
```
|
|
60
66
|
|
|
61
|
-
Defined in: [play-router/src/base-route-map.ts:
|
|
67
|
+
Defined in: [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)
|
|
62
68
|
|
|
63
69
|
Builds a route map from an array of the mappings between a state ID and a path.
|
|
64
70
|
|
|
@@ -87,7 +93,7 @@ candidates is therefore efficient.
|
|
|
87
93
|
getPathByStateId(stateId): string | null;
|
|
88
94
|
```
|
|
89
95
|
|
|
90
|
-
Defined in: [play-router/src/base-route-map.ts:
|
|
96
|
+
Defined in: [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)
|
|
91
97
|
|
|
92
98
|
Returns the path pattern of a state ID.
|
|
93
99
|
|
|
@@ -123,7 +129,7 @@ map.getPathByStateId("missing"); // null
|
|
|
123
129
|
getStateIdByPath(path): string | null;
|
|
124
130
|
```
|
|
125
131
|
|
|
126
|
-
Defined in: [play-router/src/base-route-map.ts:
|
|
132
|
+
Defined in: [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)
|
|
127
133
|
|
|
128
134
|
Resolves a URL path to its state ID.
|
|
129
135
|
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
[API](../../../README.md) / [@xmachines/play-dom-router](../README.md) / asCleanup
|
|
2
|
+
|
|
3
|
+
# Function: asCleanup()
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
function asCleanup<R>(release): Cleanup;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [play/src/disposable.ts:150](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play/src/disposable.ts#L150)
|
|
10
|
+
|
|
11
|
+
Makes one release function serve as a [Cleanup](../type-aliases/Cleanup.md).
|
|
12
|
+
|
|
13
|
+
The function comes back as itself, with [DISPOSE](../variables/DISPOSE.md) added. Nothing wraps it, so
|
|
14
|
+
the identity of the release holds: a caller that compares two releases, or that puts
|
|
15
|
+
one in a `Set`, sees what it saw before this protocol existed.
|
|
16
|
+
|
|
17
|
+
The release therefore must be idempotent. A scope releases the value one time, but a
|
|
18
|
+
caller that runs the function AND lets the scope end runs it two times. Every release
|
|
19
|
+
of this workspace already accepts that, because a teardown that runs two times is
|
|
20
|
+
older than this protocol.
|
|
21
|
+
|
|
22
|
+
The release must be synchronous. `Disposable` and not `AsyncDisposable`: a
|
|
23
|
+
`Disposable` serves `using` AND `await using`, because `await using` falls back to
|
|
24
|
+
`Symbol.dispose`, while an `AsyncDisposable` raises a TypeError under a plain `using`
|
|
25
|
+
and forces every holder into an async function. Nothing in this workspace releases
|
|
26
|
+
asynchronously. An `AsyncCleanup` can arrive the day something does.
|
|
27
|
+
|
|
28
|
+
The `R extends void | undefined` bound is what holds that line. A plain `() => void`
|
|
29
|
+
parameter would ACCEPT `async () => {}`, because TypeScript lets a function that
|
|
30
|
+
returns a value stand where one returning `void` is wanted. The promise would then go
|
|
31
|
+
on the floor: the scope releases, the release looks finished, and the work runs later
|
|
32
|
+
with nobody able to await it. The bound rejects that at the call, and it rejects a
|
|
33
|
+
release that returns any other value as well.
|
|
34
|
+
|
|
35
|
+
The bound holds where the compiler knows the return type. It cannot hold where the
|
|
36
|
+
caller erased it: `R` infers `any` for a release typed `any`, such as a bare
|
|
37
|
+
`vi.fn()`, and `any` satisfies every constraint. A release declared `() => void` whose
|
|
38
|
+
body is async passes for the same reason — the declaration, and not the body, is what
|
|
39
|
+
the call site sees. Write the release inline, or type it, and the bound applies.
|
|
40
|
+
|
|
41
|
+
The release lands under [DISPOSE](../variables/DISPOSE.md) and, when the two differ, under the
|
|
42
|
+
`Symbol.dispose` that exists at the CALL. `DISPOSE` resolves when the module evaluates,
|
|
43
|
+
so a polyfill that installs the well-known symbol later would otherwise leave the
|
|
44
|
+
release on the registered key while a downlevelled `using` reads the well-known one.
|
|
45
|
+
Writing both closes that window for every release this function publishes.
|
|
46
|
+
|
|
47
|
+
## Type Parameters
|
|
48
|
+
|
|
49
|
+
| Type Parameter |
|
|
50
|
+
| ----------------------------------- |
|
|
51
|
+
| `R` _extends_ `void` \| `undefined` |
|
|
52
|
+
|
|
53
|
+
## Parameters
|
|
54
|
+
|
|
55
|
+
| Parameter | Type | Description |
|
|
56
|
+
| --------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
57
|
+
| `release` | () => `R` | The release to publish. It must return nothing. The function is changed in place, so pass a function that this release owns: a shared or module-level function becomes a `Disposable` for every other holder of it. |
|
|
58
|
+
|
|
59
|
+
## Returns
|
|
60
|
+
|
|
61
|
+
[`Cleanup`](../type-aliases/Cleanup.md)
|
|
62
|
+
|
|
63
|
+
The same function, now also a `Disposable`.
|
|
64
|
+
|
|
65
|
+
## Throws
|
|
66
|
+
|
|
67
|
+
TypeError - When the release is frozen or is otherwise not extensible. The
|
|
68
|
+
protocol adds a property, and a sealed function accepts none.
|
|
69
|
+
|
|
70
|
+
## Example
|
|
71
|
+
|
|
72
|
+
```ts
|
|
73
|
+
export function watchSignal<T>(signal: Signal.State<T>, onValue: (v: T) => void): Cleanup {
|
|
74
|
+
const watcher = new Signal.subtle.Watcher(() => {});
|
|
75
|
+
watcher.watch(signal);
|
|
76
|
+
return asCleanup(() => watcher.unwatch(signal));
|
|
77
|
+
}
|
|
78
|
+
```
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function connectRouter(options): RouterConnection;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [play-dom-router/src/connect-router.ts:
|
|
9
|
+
Defined in: [play-dom-router/src/connect-router.ts:64](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-dom-router/src/connect-router.ts#L64)
|
|
10
10
|
|
|
11
11
|
Connects the vanilla router to an actor. This is a pure browser integration.
|
|
12
12
|
|
|
@@ -27,13 +27,8 @@ before. The handle also carries the mount — `basePath`, `basePathParams` and
|
|
|
27
27
|
## Example
|
|
28
28
|
|
|
29
29
|
```typescript
|
|
30
|
-
import {
|
|
31
|
-
|
|
32
|
-
createRouter,
|
|
33
|
-
connectRouter,
|
|
34
|
-
createRouteMap,
|
|
35
|
-
} from "@xmachines/play-dom-router";
|
|
36
|
-
import { extractMachineRoutes } from "@xmachines/play-router";
|
|
30
|
+
import { createBrowserHistory, createRouter, connectRouter } from "@xmachines/play-dom-router";
|
|
31
|
+
import { createRouteMap, extractMachineRoutes } from "@xmachines/play-router/xstate";
|
|
37
32
|
|
|
38
33
|
const routeTree = extractMachineRoutes(machine);
|
|
39
34
|
const routeMap = createRouteMap(machine);
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function createBrowserHistory(options): BrowserHistory;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [play-dom-router/src/create-browser-history.ts:
|
|
9
|
+
Defined in: [play-dom-router/src/create-browser-history.ts:172](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-dom-router/src/create-browser-history.ts#L172)
|
|
10
10
|
|
|
11
11
|
Creates a browser history that wraps window.history
|
|
12
12
|
|
|
@@ -36,6 +36,12 @@ unsubscribe();
|
|
|
36
36
|
history.destroy();
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
+
Or let a scope do it, which releases the history on an exception too:
|
|
40
|
+
|
|
41
|
+
```typescript
|
|
42
|
+
using history = createBrowserHistory({ window });
|
|
43
|
+
```
|
|
44
|
+
|
|
39
45
|
`destroy()` is idempotent, and it cooperates with each other wrapper of the same
|
|
40
46
|
`window` instance.
|
|
41
47
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function createRouter(options): VanillaRouter;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [play-dom-router/src/create-router.ts:
|
|
9
|
+
Defined in: [play-dom-router/src/create-router.ts:80](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-dom-router/src/create-router.ts#L80)
|
|
10
10
|
|
|
11
11
|
Creates the vanilla router for a framework-agnostic routing.
|
|
12
12
|
|
|
@@ -41,13 +41,19 @@ disconnect();
|
|
|
41
41
|
router.destroy();
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
+
Or let a scope do it, which releases the history on an exception too:
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
using router = createRouter({ routeTree, history });
|
|
48
|
+
```
|
|
49
|
+
|
|
44
50
|
## Parameters
|
|
45
51
|
|
|
46
|
-
| Parameter | Type
|
|
47
|
-
| ------------------- |
|
|
48
|
-
| `options` | \{ `history`: [`BrowserHistory`](../interfaces/BrowserHistory.md); `routeTree`: [`RouteTree`](../../play-router/interfaces/RouteTree.md); \} |
|
|
49
|
-
| `options.history` | [`BrowserHistory`](../interfaces/BrowserHistory.md)
|
|
50
|
-
| `options.routeTree` | [`RouteTree`](../../play-router/interfaces/RouteTree.md) |
|
|
52
|
+
| Parameter | Type |
|
|
53
|
+
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
54
|
+
| `options` | \{ `history`: [`BrowserHistory`](../interfaces/BrowserHistory.md); `routeTree`: [`RouteTree`](../../play-router/index/interfaces/RouteTree.md); \} |
|
|
55
|
+
| `options.history` | [`BrowserHistory`](../interfaces/BrowserHistory.md) |
|
|
56
|
+
| `options.routeTree` | [`RouteTree`](../../play-router/index/interfaces/RouteTree.md) |
|
|
51
57
|
|
|
52
58
|
## Returns
|
|
53
59
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: BasePathOptions
|
|
4
4
|
|
|
5
|
-
Defined in: [play-
|
|
5
|
+
Defined in: [play-url/src/base-path.ts:44](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-url/src/base-path.ts#L44)
|
|
6
6
|
|
|
7
7
|
The base-path options that every router bridge, `connectRouter` function, and
|
|
8
8
|
`PlayRouterProvider` component accepts.
|
|
@@ -26,7 +26,7 @@ connectRouter({
|
|
|
26
26
|
|
|
27
27
|
## Properties
|
|
28
28
|
|
|
29
|
-
| Property | Modifier | Type | Description | Defined in
|
|
30
|
-
| ------------------------------------------------------ | ---------- | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
31
|
-
| <a id="property-basepath"></a> `basePath?` | `readonly` | `string` | The URL prefix that the routes of the machine hang off, for example `"/admin"` or `"/:machineId/play"`. A `:param` segment is a declarative convenience, so that a host keeps ONE string that mirrors its own route config. Every `:param` must have a value in [BasePathOptions.basePathParams](ConnectRouterOptions.md#property-basepathparams), because the bridge writes a real URL. An optional segment (`:param?`) and a wildcard (`*`) are therefore refused: neither of them resolves to one concrete prefix. An absent value, `""`, and `"/"` all mean "no prefix", which is the behaviour of every release before this option existed. | [play-
|
|
32
|
-
| <a id="property-basepathparams"></a> `basePathParams?` | `readonly` | `Record`\<`string`, `string` \| `number`\> | The values of the `:param` segments of [BasePathOptions.basePath](ConnectRouterOptions.md#property-basepath). These values belong to the HOST, which wrote the prefix and resolved them, so they travel in NO `play.route` event: the machine is authoritative over its own params, and `event.params` holds what the pattern of the machine declares, and nothing else. A param of the host that shares a name with one of the machine can therefore shadow it never. A host reads them back from `bridge.basePathParams`, where they cannot go stale. A machine that needs the identity of its host takes it through the `input` of the actor, where that identity decides WHICH machine runs. | [play-
|
|
29
|
+
| Property | Modifier | Type | Description | Defined in |
|
|
30
|
+
| ------------------------------------------------------ | ---------- | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
31
|
+
| <a id="property-basepath"></a> `basePath?` | `readonly` | `string` | The URL prefix that the routes of the machine hang off, for example `"/admin"` or `"/:machineId/play"`. A `:param` segment is a declarative convenience, so that a host keeps ONE string that mirrors its own route config. Every `:param` must have a value in [BasePathOptions.basePathParams](ConnectRouterOptions.md#property-basepathparams), because the bridge writes a real URL. An optional segment (`:param?`) and a wildcard (`*`) are therefore refused: neither of them resolves to one concrete prefix. An absent value, `""`, and `"/"` all mean "no prefix", which is the behaviour of every release before this option existed. | [play-url/src/base-path.ts:58](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-url/src/base-path.ts#L58) |
|
|
32
|
+
| <a id="property-basepathparams"></a> `basePathParams?` | `readonly` | `Record`\<`string`, `string` \| `number`\> | The values of the `:param` segments of [BasePathOptions.basePath](ConnectRouterOptions.md#property-basepath). These values belong to the HOST, which wrote the prefix and resolved them, so they travel in NO `play.route` event: the machine is authoritative over its own params, and `event.params` holds what the pattern of the machine declares, and nothing else. A param of the host that shares a name with one of the machine can therefore shadow it never. A host reads them back from `bridge.basePathParams`, where they cannot go stale. A machine that needs the identity of its host takes it through the `input` of the actor, where that identity decides WHICH machine runs. | [play-url/src/base-path.ts:72](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-url/src/base-path.ts#L72) |
|
|
@@ -2,27 +2,63 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: BrowserHistory
|
|
4
4
|
|
|
5
|
-
Defined in: [play-dom-router/src/create-browser-history.ts:
|
|
5
|
+
Defined in: [play-dom-router/src/create-browser-history.ts:3](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-dom-router/src/create-browser-history.ts#L3)
|
|
6
6
|
|
|
7
7
|
## Properties
|
|
8
8
|
|
|
9
|
-
| Property | Modifier | Type | Description | Defined in
|
|
10
|
-
| ----------------------------------------- | ---------- | --------- | ----------------------------------------- |
|
|
11
|
-
| <a id="property-location"></a> `location` | `readonly` | `object` | Returns the state of the current location | [play-dom-router/src/create-browser-history.ts:
|
|
12
|
-
| `location.hash` | `public` | `string` | - | [play-dom-router/src/create-browser-history.ts:
|
|
13
|
-
| `location.pathname` | `public` | `string` | - | [play-dom-router/src/create-browser-history.ts:
|
|
14
|
-
| `location.search` | `public` | `string` | - | [play-dom-router/src/create-browser-history.ts:
|
|
15
|
-
| `location.state` | `public` | `unknown` | - | [play-dom-router/src/create-browser-history.ts:
|
|
9
|
+
| Property | Modifier | Type | Description | Defined in |
|
|
10
|
+
| ----------------------------------------- | ---------- | --------- | ----------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
11
|
+
| <a id="property-location"></a> `location` | `readonly` | `object` | Returns the state of the current location | [play-dom-router/src/create-browser-history.ts:7](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-dom-router/src/create-browser-history.ts#L7) |
|
|
12
|
+
| `location.hash` | `public` | `string` | - | [play-dom-router/src/create-browser-history.ts:10](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-dom-router/src/create-browser-history.ts#L10) |
|
|
13
|
+
| `location.pathname` | `public` | `string` | - | [play-dom-router/src/create-browser-history.ts:8](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-dom-router/src/create-browser-history.ts#L8) |
|
|
14
|
+
| `location.search` | `public` | `string` | - | [play-dom-router/src/create-browser-history.ts:9](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-dom-router/src/create-browser-history.ts#L9) |
|
|
15
|
+
| `location.state` | `public` | `unknown` | - | [play-dom-router/src/create-browser-history.ts:11](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-dom-router/src/create-browser-history.ts#L11) |
|
|
16
16
|
|
|
17
17
|
## Methods
|
|
18
18
|
|
|
19
|
+
### \[dispose\]()
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
dispose: void;
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Defined in: [play-dom-router/src/create-browser-history.ts:91](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-dom-router/src/create-browser-history.ts#L91)
|
|
26
|
+
|
|
27
|
+
Releases the history with [BrowserHistory.destroy](#destroy). It is idempotent.
|
|
28
|
+
|
|
29
|
+
`destroy()` unpatches `history.pushState` and `history.replaceState` of the window,
|
|
30
|
+
so a scope that drops the history without it leaves the global patched. The key lets
|
|
31
|
+
a scope do that work:
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
{
|
|
35
|
+
using history = createBrowserHistory({ window });
|
|
36
|
+
history.push("/first");
|
|
37
|
+
// destroy() runs at the end of the scope, and after an exception too
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
An implementation writes it as one line beside `destroy`, and the two therefore
|
|
42
|
+
release the same work:
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
destroy() { ... },
|
|
46
|
+
[DISPOSE]() { this.destroy(); },
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
#### Returns
|
|
50
|
+
|
|
51
|
+
`void`
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
19
55
|
### back()
|
|
20
56
|
|
|
21
57
|
```ts
|
|
22
58
|
back(): void;
|
|
23
59
|
```
|
|
24
60
|
|
|
25
|
-
Defined in: [play-dom-router/src/create-browser-history.ts:
|
|
61
|
+
Defined in: [play-dom-router/src/create-browser-history.ts:28](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-dom-router/src/create-browser-history.ts#L28)
|
|
26
62
|
|
|
27
63
|
#### Returns
|
|
28
64
|
|
|
@@ -36,7 +72,7 @@ Defined in: [play-dom-router/src/create-browser-history.ts:26](https://gitlab.co
|
|
|
36
72
|
createHref(path): string;
|
|
37
73
|
```
|
|
38
74
|
|
|
39
|
-
Defined in: [play-dom-router/src/create-browser-history.ts:
|
|
75
|
+
Defined in: [play-dom-router/src/create-browser-history.ts:58](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-dom-router/src/create-browser-history.ts#L58)
|
|
40
76
|
|
|
41
77
|
Creates an href from a path
|
|
42
78
|
|
|
@@ -58,7 +94,7 @@ Creates an href from a path
|
|
|
58
94
|
destroy(): void;
|
|
59
95
|
```
|
|
60
96
|
|
|
61
|
-
Defined in: [play-dom-router/src/create-browser-history.ts:
|
|
97
|
+
Defined in: [play-dom-router/src/create-browser-history.ts:66](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-dom-router/src/create-browser-history.ts#L66)
|
|
62
98
|
|
|
63
99
|
Cleans up.
|
|
64
100
|
|
|
@@ -77,7 +113,7 @@ A second call is safe. When more than one wrapper shares the same
|
|
|
77
113
|
forward(): void;
|
|
78
114
|
```
|
|
79
115
|
|
|
80
|
-
Defined in: [play-dom-router/src/create-browser-history.ts:
|
|
116
|
+
Defined in: [play-dom-router/src/create-browser-history.ts:29](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-dom-router/src/create-browser-history.ts#L29)
|
|
81
117
|
|
|
82
118
|
#### Returns
|
|
83
119
|
|
|
@@ -91,7 +127,7 @@ Defined in: [play-dom-router/src/create-browser-history.ts:27](https://gitlab.co
|
|
|
91
127
|
go(delta): void;
|
|
92
128
|
```
|
|
93
129
|
|
|
94
|
-
Defined in: [play-dom-router/src/create-browser-history.ts:
|
|
130
|
+
Defined in: [play-dom-router/src/create-browser-history.ts:27](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-dom-router/src/create-browser-history.ts#L27)
|
|
95
131
|
|
|
96
132
|
Moves back or forward in the history
|
|
97
133
|
|
|
@@ -113,7 +149,7 @@ Moves back or forward in the history
|
|
|
113
149
|
push(path, state?): void;
|
|
114
150
|
```
|
|
115
151
|
|
|
116
|
-
Defined in: [play-dom-router/src/create-browser-history.ts:
|
|
152
|
+
Defined in: [play-dom-router/src/create-browser-history.ts:17](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-dom-router/src/create-browser-history.ts#L17)
|
|
117
153
|
|
|
118
154
|
Pushes a new URL to the history
|
|
119
155
|
|
|
@@ -136,7 +172,7 @@ Pushes a new URL to the history
|
|
|
136
172
|
replace(path, state?): void;
|
|
137
173
|
```
|
|
138
174
|
|
|
139
|
-
Defined in: [play-dom-router/src/create-browser-history.ts:
|
|
175
|
+
Defined in: [play-dom-router/src/create-browser-history.ts:22](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-dom-router/src/create-browser-history.ts#L22)
|
|
140
176
|
|
|
141
177
|
Replaces the current URL in the history
|
|
142
178
|
|
|
@@ -156,13 +192,31 @@ Replaces the current URL in the history
|
|
|
156
192
|
### subscribe()
|
|
157
193
|
|
|
158
194
|
```ts
|
|
159
|
-
subscribe(listener):
|
|
195
|
+
subscribe(listener): Cleanup;
|
|
160
196
|
```
|
|
161
197
|
|
|
162
|
-
Defined in: [play-dom-router/src/create-browser-history.ts:
|
|
198
|
+
Defined in: [play-dom-router/src/create-browser-history.ts:53](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-dom-router/src/create-browser-history.ts#L53)
|
|
163
199
|
|
|
164
200
|
Subscribes to the history changes.
|
|
165
|
-
It returns
|
|
201
|
+
It returns the release of the subscription.
|
|
202
|
+
|
|
203
|
+
A caller runs the release, or a scope releases it:
|
|
204
|
+
|
|
205
|
+
```ts
|
|
206
|
+
using stop = history.subscribe((location) => render(location));
|
|
207
|
+
// stop() runs at the end of the scope, and after an exception too
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
A `Cleanup` IS a `() => void`, so a caller that runs it keeps that code. An
|
|
211
|
+
implementation of this interface builds one with `asCleanup` of `@xmachines/play`,
|
|
212
|
+
which this package re-exports:
|
|
213
|
+
|
|
214
|
+
```ts
|
|
215
|
+
subscribe(listener) {
|
|
216
|
+
listeners.add(listener);
|
|
217
|
+
return asCleanup(() => listeners.delete(listener));
|
|
218
|
+
}
|
|
219
|
+
```
|
|
166
220
|
|
|
167
221
|
#### Parameters
|
|
168
222
|
|
|
@@ -172,4 +226,4 @@ It returns a function that cancels the subscription
|
|
|
172
226
|
|
|
173
227
|
#### Returns
|
|
174
228
|
|
|
175
|
-
()
|
|
229
|
+
[`Cleanup`](../type-aliases/Cleanup.md)
|