@xmachines/docs 3.0.0 → 5.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 +14 -20
- package/api/@xmachines/play/README.md +29 -118
- 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 +36 -10
- package/api/@xmachines/play/index/README.md +75 -0
- package/api/@xmachines/play/index/functions/asCleanup.md +77 -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/{type-aliases → index/type-aliases}/Cleanup.md +5 -5
- 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 +80 -231
- package/api/@xmachines/play-actor/interfaces/ActorEvent.md +18 -0
- package/api/@xmachines/play-actor/interfaces/PlayActor.md +73 -0
- package/api/@xmachines/play-atom/README.md +281 -0
- package/api/@xmachines/play-atom/functions/watchAtom.md +79 -0
- package/api/@xmachines/play-atom/interfaces/AsyncAtomOptions.md +16 -0
- package/api/@xmachines/play-atom/interfaces/Atom.md +149 -0
- package/api/@xmachines/play-atom/interfaces/AtomObserver.md +25 -0
- package/api/@xmachines/play-atom/interfaces/AtomOptions.md +33 -0
- package/api/@xmachines/play-atom/interfaces/AtomSubscription.md +23 -0
- package/api/@xmachines/play-atom/interfaces/BaseAtom.md +97 -0
- package/api/@xmachines/play-atom/interfaces/CreateAtom.md +91 -0
- package/api/@xmachines/play-atom/interfaces/Readable.md +93 -0
- package/api/@xmachines/play-atom/interfaces/ReadonlyAtom.md +108 -0
- package/api/@xmachines/play-atom/type-aliases/AnyAtom.md +13 -0
- package/api/@xmachines/play-atom/type-aliases/AsyncAtomState.md +32 -0
- package/api/@xmachines/{play-signals → play-atom}/type-aliases/Cleanup.md +5 -5
- package/api/@xmachines/play-atom/variables/createAsyncAtom.md +42 -0
- package/api/@xmachines/play-atom/variables/createAtom.md +18 -0
- package/api/@xmachines/play-atom/variables/createWritableAtom.md +70 -0
- package/api/@xmachines/play-dom/README.md +44 -52
- package/api/@xmachines/play-dom/classes/PlayRenderer.md +17 -16
- package/api/@xmachines/play-dom/functions/asCleanup.md +77 -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 +4 -4
- package/api/@xmachines/play-dom/type-aliases/MountFn.md +29 -12
- package/api/@xmachines/play-dom-router/README.md +83 -83
- package/api/@xmachines/play-dom-router/classes/DomRouterBridge.md +24 -23
- package/api/@xmachines/play-dom-router/{interfaces → classes}/RouteMap.md +42 -7
- package/api/@xmachines/{play → play-dom-router}/functions/asCleanup.md +5 -6
- 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 -9
- 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 +11 -9
- 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 +10 -4
- package/api/@xmachines/play-dom-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/RouterBridge.md +15 -17
- 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 +4 -4
- package/api/@xmachines/play-dom-router/variables/DISPOSE.md +2 -2
- package/api/@xmachines/play-pattern/README.md +115 -0
- package/api/@xmachines/play-pattern/functions/buildPath.md +46 -0
- package/api/@xmachines/play-pattern/functions/createPatternCache.md +47 -0
- package/api/@xmachines/play-pattern/functions/getIndexKey.md +30 -0
- package/api/@xmachines/play-pattern/functions/isDotSegment.md +40 -0
- package/api/@xmachines/play-pattern/functions/parsePattern.md +28 -0
- package/api/@xmachines/play-pattern/interfaces/GroupPart.md +15 -0
- package/api/@xmachines/play-pattern/interfaces/LiteralPart.md +14 -0
- package/api/@xmachines/play-pattern/interfaces/ParamPart.md +21 -0
- package/api/@xmachines/play-pattern/interfaces/ParseOptions.md +19 -0
- package/api/@xmachines/play-pattern/interfaces/ParsedPattern.md +23 -0
- package/api/@xmachines/play-pattern/interfaces/PatternCache.md +65 -0
- package/api/@xmachines/play-pattern/interfaces/PatternParam.md +15 -0
- package/api/@xmachines/play-pattern/type-aliases/PathBuildResult.md +74 -0
- package/api/@xmachines/play-pattern/type-aliases/PathParams.md +15 -0
- package/api/@xmachines/play-pattern/type-aliases/PatternModifier.md +11 -0
- package/api/@xmachines/play-pattern/type-aliases/PatternPart.md +9 -0
- package/api/@xmachines/play-react/README.md +46 -58
- 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/useAtomEffect.md +103 -0
- package/api/@xmachines/play-react/functions/usePlayView.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 +2 -2
- 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 +23 -51
- package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +24 -23
- package/api/@xmachines/play-react-router/classes/RouteMap.md +18 -12
- 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 +14 -12
- package/api/@xmachines/play-react-router/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-react-router/interfaces/RouteMapOptions.md +10 -4
- package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-react-router/interfaces/RouterBridge.md +15 -17
- package/api/@xmachines/play-react-router/type-aliases/PlayRouterBridgeConstructor.md +29 -12
- 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 +116 -197
- 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 +83 -0
- package/api/@xmachines/play-router/{classes → index/classes}/RouteMap.md +19 -13
- package/api/@xmachines/play-router/{classes → index/classes}/RouterBridgeBase.md +22 -20
- 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/index/functions/createPatternCache.md +47 -0
- package/api/@xmachines/play-router/{functions → index/functions}/createRouteMapFromTree.md +17 -10
- 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 +9 -8
- package/api/@xmachines/play-router/{functions → index/functions}/findRouteById.md +2 -2
- package/api/@xmachines/play-router/index/functions/findRouteByPath.md +48 -0
- package/api/@xmachines/play-router/{functions → index/functions}/isMountableBridge.md +2 -2
- package/api/@xmachines/play-router/index/functions/joinBasePath.md +38 -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/parsePattern.md +28 -0
- 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/index/functions/resolveFrameworkParams.md +49 -0
- package/api/@xmachines/play-router/index/functions/sanitizePathname.md +27 -0
- package/api/@xmachines/play-router/index/functions/splitLocation.md +37 -0
- 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/index/interfaces/BasePathOptions.md +32 -0
- package/api/@xmachines/play-router/index/interfaces/BuildPlayRouteEventOptions.md +13 -0
- package/api/@xmachines/play-router/index/interfaces/CompileOptions.md +35 -0
- package/api/@xmachines/play-router/index/interfaces/FrameworkParamsSource.md +52 -0
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/LocationLike.md +6 -6
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/MountableRouterBridge.md +12 -12
- package/api/@xmachines/play-router/index/interfaces/OpenProviderBridgeArgs.md +30 -0
- package/api/@xmachines/play-router/index/interfaces/ParseOptions.md +24 -0
- package/api/@xmachines/play-router/index/interfaces/ParsedPattern.md +23 -0
- package/api/@xmachines/play-router/index/interfaces/PatternCache.md +65 -0
- package/api/@xmachines/play-router/index/interfaces/PlayRouteEvent.md +130 -0
- package/api/@xmachines/play-router/index/interfaces/PlayRouterProviderBaseProps.md +39 -0
- 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/index/interfaces/RouteMapOptions.md +19 -0
- 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/index/interfaces/RouteWatcherHandle.md +55 -0
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/RouterBridge.md +17 -19
- package/api/@xmachines/play-router/index/interfaces/RouterBridgeOptions.md +31 -0
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/RouterConnection.md +10 -10
- package/api/@xmachines/play-router/index/interfaces/SplitLocation.md +16 -0
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/WindowLike.md +4 -4
- package/api/@xmachines/play-router/index/type-aliases/PlayRouterBridgeConstructor.md +53 -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/type-aliases/URLPatternLike.md +68 -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 +11 -9
- package/api/@xmachines/play-router/xstate/functions/extractMachineRoutes.md +30 -0
- 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-solid/README.md +21 -34
- 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 +2 -2
- 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 +34 -55
- package/api/@xmachines/play-solid-router/classes/RouteMap.md +18 -12
- package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +33 -56
- 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 +14 -12
- package/api/@xmachines/play-solid-router/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-solid-router/interfaces/RouteMapOptions.md +10 -4
- package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +5 -5
- package/api/@xmachines/play-solid-router/interfaces/RouterBridge.md +15 -17
- package/api/@xmachines/play-solid-router/type-aliases/PlayRouterBridgeConstructor.md +29 -12
- 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 +18 -29
- 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 +25 -44
- package/api/@xmachines/play-svelte-spa-router/classes/RouteMap.md +18 -12
- package/api/@xmachines/play-svelte-spa-router/classes/SvelteSpaRouterBridge.md +24 -23
- package/api/@xmachines/play-svelte-spa-router/functions/connectRouter.md +3 -2
- package/api/@xmachines/play-svelte-spa-router/interfaces/BasePathOptions.md +5 -9
- package/api/@xmachines/play-svelte-spa-router/interfaces/ConnectRouterOptions.md +11 -9
- 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 +10 -4
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouterBridge.md +15 -17
- 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 +32 -50
- package/api/@xmachines/play-sveltekit-router/classes/RouteMap.md +18 -12
- package/api/@xmachines/play-sveltekit-router/classes/SvelteKitRouterBridge.md +24 -23
- package/api/@xmachines/play-sveltekit-router/functions/connectRouter.md +3 -2
- package/api/@xmachines/play-sveltekit-router/interfaces/BasePathOptions.md +5 -9
- package/api/@xmachines/play-sveltekit-router/interfaces/ConnectRouterOptions.md +15 -23
- 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 +10 -4
- package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-sveltekit-router/interfaces/RouterBridge.md +15 -17
- package/api/@xmachines/play-sveltekit-router/interfaces/RouterConnection.md +8 -8
- package/api/@xmachines/play-tanstack-react-router/README.md +25 -49
- package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +18 -12
- package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +22 -21
- 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 +14 -12
- package/api/@xmachines/play-tanstack-react-router/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapOptions.md +10 -4
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouterBridge.md +15 -17
- package/api/@xmachines/play-tanstack-react-router/type-aliases/PlayRouterBridgeConstructor.md +29 -12
- 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 +26 -29
- 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 +29 -55
- package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +18 -12
- package/api/@xmachines/play-tanstack-solid-router/classes/TanStackSolidRouterBridge.md +52 -48
- 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 +14 -12
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapOptions.md +10 -4
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouterBridge.md +15 -17
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/PlayRouterBridgeConstructor.md +29 -12
- 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 +75 -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 +72 -0
- package/api/@xmachines/play-url/index/functions/buildPath.md +46 -0
- package/api/@xmachines/play-url/index/functions/cleanFrameworkParams.md +39 -0
- package/api/@xmachines/play-url/index/functions/createPatternCache.md +47 -0
- package/api/@xmachines/play-url/index/functions/getCandidates.md +29 -0
- package/api/@xmachines/play-url/index/functions/getCompiledPattern.md +32 -0
- package/api/@xmachines/play-url/index/functions/getIndexKey.md +30 -0
- package/api/@xmachines/play-url/index/functions/holdsUnsubstitutedParam.md +36 -0
- package/api/@xmachines/play-url/index/functions/isDotSegment.md +40 -0
- package/api/@xmachines/{play-router → play-url/index}/functions/joinBasePath.md +3 -2
- package/api/@xmachines/{play-router → play-url/index}/functions/normalizeBasePath.md +2 -2
- package/api/@xmachines/play-url/index/functions/parsePattern.md +28 -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-url/index/functions/sanitizePathname.md +27 -0
- package/api/@xmachines/play-url/index/functions/splitLocation.md +37 -0
- package/api/@xmachines/{play-router → play-url/index}/functions/stripBasePath.md +2 -2
- package/api/@xmachines/{play-router → play-url/index}/interfaces/BasePathOptions.md +6 -10
- package/api/@xmachines/play-url/index/interfaces/CompileOptions.md +21 -0
- package/api/@xmachines/play-url/index/interfaces/FrameworkParamsSource.md +52 -0
- 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/ParseOptions.md +24 -0
- package/api/@xmachines/play-url/index/interfaces/ParsedPattern.md +23 -0
- package/api/@xmachines/play-url/index/interfaces/PatternCache.md +65 -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/interfaces/SplitLocation.md +16 -0
- package/api/@xmachines/play-url/index/type-aliases/PathBuildResult.md +74 -0
- package/api/@xmachines/play-url/index/type-aliases/PathParams.md +15 -0
- 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 +176 -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-view/index/functions/guardContextWrites.md +19 -0
- 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-view/index/interfaces/Viewable.md +18 -0
- 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 +26 -40
- 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 +42 -84
- 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/{classes → index/classes}/RouteMap.md +19 -13
- package/api/@xmachines/play-vue-router/{classes → index/classes}/VueRouterBridge.md +26 -45
- 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/index/interfaces/RouteMapOptions.md +19 -0
- package/api/@xmachines/play-vue-router/{interfaces → index/interfaces}/RouteMapping.md +6 -6
- package/api/@xmachines/play-vue-router/{interfaces → index/interfaces}/RouterBridge.md +17 -19
- package/api/@xmachines/play-vue-router/{variables → index/variables}/PlayRouterProvider.md +26 -4
- package/api/@xmachines/play-xstate/README.md +195 -116
- package/api/@xmachines/play-xstate/errors/README.md +14 -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/InvalidRouteParamError.md +207 -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 +583 -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 +10 -10
- 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/with-routing/functions/buildRouteUrl.md +57 -0
- 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 +33 -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 +4 -1
- package/api/llms.txt +18 -12
- package/contributing/architecture.md +157 -148
- package/contributing/configuration.md +100 -41
- package/contributing/deployment.md +112 -34
- package/contributing/development.md +103 -34
- package/contributing/migrating-to-play-atom.md +209 -0
- package/contributing/testing.md +136 -80
- package/examples/README.md +11 -9
- package/examples/basic-state-machine.md +4 -4
- package/examples/form-validation.md +4 -3
- package/examples/multi-router-integration.md +81 -59
- package/examples/routing-patterns.md +20 -19
- package/examples/traffic-light.md +17 -11
- package/guides/README.md +2 -1
- package/guides/actor-model.md +50 -32
- package/guides/atoms.md +264 -0
- package/guides/getting-started.md +91 -53
- package/guides/inspector.md +7 -7
- package/guides/routing.md +265 -0
- package/guides/state-machines.md +20 -21
- package/package.json +10 -9
- package/rfc/play.md +104 -60
- package/api/@xmachines/play-actor/classes/AbstractActor.md +0 -505
- package/api/@xmachines/play-actor/functions/guardContextWrites.md +0 -43
- package/api/@xmachines/play-actor/interfaces/BaseActorProviderProps.md +0 -48
- package/api/@xmachines/play-actor/interfaces/Routable.md +0 -14
- package/api/@xmachines/play-actor/interfaces/Viewable.md +0 -18
- 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-react/functions/useSignalEffect.md +0 -77
- 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/extractMachineRoutes.md +0 -29
- package/api/@xmachines/play-router/functions/findRouteByPath.md +0 -41
- 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/resolveFrameworkParams.md +0 -51
- package/api/@xmachines/play-router/functions/routeExists.md +0 -26
- package/api/@xmachines/play-router/functions/sanitizePathname.md +0 -42
- package/api/@xmachines/play-router/interfaces/BuildPlayRouteEventOptions.md +0 -13
- package/api/@xmachines/play-router/interfaces/FrameworkParamsSource.md +0 -47
- 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/OpenProviderBridgeArgs.md +0 -28
- 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/PlayRouterProviderBaseProps.md +0 -33
- package/api/@xmachines/play-router/interfaces/RoutableActor.md +0 -65
- package/api/@xmachines/play-router/interfaces/RouteMapOptions.md +0 -13
- 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/interfaces/RouteWatcherHandle.md +0 -55
- 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-signals/README.md +0 -231
- package/api/@xmachines/play-signals/functions/watchSignal.md +0 -65
- package/api/@xmachines/play-signals/interfaces/ComputedOptions.md +0 -36
- package/api/@xmachines/play-signals/interfaces/SignalComputed.md +0 -49
- package/api/@xmachines/play-signals/interfaces/SignalOptions.md +0 -37
- package/api/@xmachines/play-signals/interfaces/SignalState.md +0 -68
- package/api/@xmachines/play-signals/interfaces/SignalWatcher.md +0 -97
- package/api/@xmachines/play-signals/namespaces/Signal/README.md +0 -22
- package/api/@xmachines/play-signals/namespaces/Signal/classes/Computed.md +0 -52
- package/api/@xmachines/play-signals/namespaces/Signal/classes/State.md +0 -72
- package/api/@xmachines/play-signals/namespaces/Signal/interfaces/Options.md +0 -19
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/README.md +0 -21
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/classes/Watcher.md +0 -85
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/currentComputed.md +0 -13
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/hasSinks.md +0 -19
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/hasSources.md +0 -19
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/introspectSinks.md +0 -19
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/introspectSources.md +0 -19
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/untrack.md +0 -25
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/variables/unwatched.md +0 -9
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/variables/watched.md +0 -9
- package/api/@xmachines/play-signals/namespaces/Signal/variables/isComputed.md +0 -19
- package/api/@xmachines/play-signals/namespaces/Signal/variables/isState.md +0 -19
- package/api/@xmachines/play-signals/namespaces/Signal/variables/isWatcher.md +0 -19
- package/api/@xmachines/play-signals/type-aliases/WatcherNotify.md +0 -33
- 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/interfaces/RouteMapOptions.md +0 -13
- 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/buildRouteUrl.md +0 -50
- 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
- package/guides/signals.md +0 -209
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
[API](../../../README.md) / [@xmachines/play-vue-router](../README.md) / VueRouteMap
|
|
2
|
-
|
|
3
|
-
# ~~Type Alias: VueRouteMap~~
|
|
4
|
-
|
|
5
|
-
```ts
|
|
6
|
-
type VueRouteMap = RouteMap;
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
Defined in: [play-vue-router/src/vue-base-route-map.ts:8](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-vue-router/src/vue-base-route-map.ts#L8)
|
|
10
|
-
|
|
11
|
-
## Deprecated
|
|
12
|
-
|
|
13
|
-
Use `RouteMap` from `@xmachines/play-router`. Will be removed in the next major.
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
[API](../../../README.md) / [@xmachines/play-vue-router](../README.md) / VueRouteMap
|
|
2
|
-
|
|
3
|
-
# ~~Variable: VueRouteMap~~
|
|
4
|
-
|
|
5
|
-
```ts
|
|
6
|
-
const VueRouteMap: typeof RouteMap = RouteMap;
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
Defined in: [play-vue-router/src/vue-base-route-map.ts:8](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-vue-router/src/vue-base-route-map.ts#L8)
|
|
10
|
-
|
|
11
|
-
## Deprecated
|
|
12
|
-
|
|
13
|
-
Use `RouteMap` from `@xmachines/play-router`. Will be removed in the next major.
|
|
@@ -1,568 +0,0 @@
|
|
|
1
|
-
[API](../../../README.md) / [@xmachines/play-xstate](../README.md) / PlayerActor
|
|
2
|
-
|
|
3
|
-
# Class: PlayerActor\<TMachine\>
|
|
4
|
-
|
|
5
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:203](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-xstate/src/player-actor.ts#L203)
|
|
6
|
-
|
|
7
|
-
The concrete XState actor. It implements the signal protocol of the Play Architecture
|
|
8
|
-
|
|
9
|
-
The class extends [@xmachines/play-actor!AbstractActor](../../play-actor/classes/AbstractActor.md), and therefore the
|
|
10
|
-
`Actor` class of XState. It gives you the XState v5 integration, and it keeps the
|
|
11
|
-
compatibility with the ecosystem, such as the XState inspection and the devtools.
|
|
12
|
-
The constructor of the base class receives the machine. Therefore a `PlayerActor`
|
|
13
|
-
**is** the XState actor, and it is no wrapper around one: every member of the
|
|
14
|
-
XState `Actor` class works on the state of this instance, and this class adds the
|
|
15
|
-
reactive state on the TC39 Signals for the observation by the infrastructure.
|
|
16
|
-
|
|
17
|
-
**Capabilities:** the class implements both the
|
|
18
|
-
[@xmachines/play-actor!Routable](../../play-actor/interfaces/Routable.md) interface and the
|
|
19
|
-
[@xmachines/play-actor!Viewable](../../play-actor/interfaces/Viewable.md) interface. It therefore supports the
|
|
20
|
-
routing and the view rendering.
|
|
21
|
-
|
|
22
|
-
**Architectural context:** the class implements **Actor Authority (INV-01)**,
|
|
23
|
-
because the guards of the XState machine control every decision of the
|
|
24
|
-
navigation. The infrastructure observes the signals of the actor (`state`,
|
|
25
|
-
`currentRoute`, and `currentView`), but it changes no state directly: every
|
|
26
|
-
change goes through the event handlers of the state machine.
|
|
27
|
-
|
|
28
|
-
## Examples
|
|
29
|
-
|
|
30
|
-
The creation of an actor, and its lifecycle
|
|
31
|
-
|
|
32
|
-
```typescript
|
|
33
|
-
import { setup } from "xstate";
|
|
34
|
-
import { definePlayer } from "@xmachines/play-xstate";
|
|
35
|
-
|
|
36
|
-
const machine = setup({}).createMachine({
|
|
37
|
-
initial: "idle",
|
|
38
|
-
states: {
|
|
39
|
-
idle: {
|
|
40
|
-
meta: {
|
|
41
|
-
route: "/",
|
|
42
|
-
// A view spec needs `root` and `elements`. Every other shape derives null.
|
|
43
|
-
view: {
|
|
44
|
-
root: "home",
|
|
45
|
-
elements: { home: { type: "HomePage", props: {}, children: [] } },
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
const createPlayer = definePlayer({ machine });
|
|
53
|
-
const actor = createPlayer();
|
|
54
|
-
actor.start();
|
|
55
|
-
|
|
56
|
-
// Observe the signals
|
|
57
|
-
console.log(actor.currentRoute.get()); // '/'
|
|
58
|
-
console.log(actor.currentView.get()?.root); // 'home'
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
The signal lifecycle with a watcher
|
|
62
|
-
|
|
63
|
-
```typescript
|
|
64
|
-
import { Signal } from "@xmachines/play-signals";
|
|
65
|
-
|
|
66
|
-
const watcher = new Signal.subtle.Watcher(() => {
|
|
67
|
-
queueMicrotask(() => {
|
|
68
|
-
const pending = watcher.getPending();
|
|
69
|
-
console.log("State changed:", actor.state.get());
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
watcher.watch(actor.state);
|
|
74
|
-
actor.send({ type: "play.route", to: "#about" });
|
|
75
|
-
// The watcher schedules its own notification in a microtask
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
## See
|
|
79
|
-
|
|
80
|
-
- [Play RFC](../../../../rfc/play.md)
|
|
81
|
-
- [definePlayer](../functions/definePlayer.md) for the creation through a factory
|
|
82
|
-
- [@xmachines/play-actor!AbstractActor](../../play-actor/classes/AbstractActor.md) for the signal protocol
|
|
83
|
-
- [@xmachines/play-actor!Routable](../../play-actor/interfaces/Routable.md) for the routing capability
|
|
84
|
-
- [@xmachines/play-actor!Viewable](../../play-actor/interfaces/Viewable.md) for the view rendering capability
|
|
85
|
-
|
|
86
|
-
## Remarks
|
|
87
|
-
|
|
88
|
-
**The routing:** this actor supports the `route: {}` config pattern of XState and
|
|
89
|
-
also a `play.route` event with parameters. The `deriveRoute()` function reads
|
|
90
|
-
`meta.route`, which is the Stately pattern, for a URL template, and it substitutes
|
|
91
|
-
each parameter.
|
|
92
|
-
|
|
93
|
-
**The pattern of the view signal:** the `currentView` signal is a direct
|
|
94
|
-
`Signal.State`, and not a `Signal.Computed`. The propagation to a watcher in
|
|
95
|
-
PlayRenderer is therefore correct. The class derives each view at the entry of a
|
|
96
|
-
state and keeps it, and it computes no view on a read.
|
|
97
|
-
|
|
98
|
-
## Extends
|
|
99
|
-
|
|
100
|
-
- [`AbstractActor`](../../play-actor/classes/AbstractActor.md)\<[`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic), [`EventFromLogic`](https://www.jsdocs.io/package/xstate#EventFromLogic)\<`TMachine`\>\>
|
|
101
|
-
|
|
102
|
-
## Type Parameters
|
|
103
|
-
|
|
104
|
-
| Type Parameter | Description |
|
|
105
|
-
| ---------------------------------------------------------------------------------------------- | --------------------------------------- |
|
|
106
|
-
| `TMachine` _extends_ [`AnyStateMachine`](https://www.jsdocs.io/package/xstate#AnyStateMachine) | The type of the XState v5 state machine |
|
|
107
|
-
|
|
108
|
-
## Implements
|
|
109
|
-
|
|
110
|
-
- [`Routable`](../../play-actor/interfaces/Routable.md)
|
|
111
|
-
- [`Viewable`](../../play-actor/interfaces/Viewable.md)
|
|
112
|
-
|
|
113
|
-
## Constructors
|
|
114
|
-
|
|
115
|
-
### Constructor
|
|
116
|
-
|
|
117
|
-
```ts
|
|
118
|
-
new PlayerActor<TMachine>(
|
|
119
|
-
machine,
|
|
120
|
-
options,
|
|
121
|
-
input?,
|
|
122
|
-
restoredSnapshot?): PlayerActor<TMachine>;
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:361](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-xstate/src/player-actor.ts#L361)
|
|
126
|
-
|
|
127
|
-
#### Parameters
|
|
128
|
-
|
|
129
|
-
| Parameter | Type |
|
|
130
|
-
| ------------------- | --------------------------------------------------------------------------- |
|
|
131
|
-
| `machine` | `TMachine` |
|
|
132
|
-
| `options` | [`PlayerOptions`](../interfaces/PlayerOptions.md)\<`TMachine`\> |
|
|
133
|
-
| `input?` | [`InputFrom`](https://www.jsdocs.io/package/xstate#InputFrom)\<`TMachine`\> |
|
|
134
|
-
| `restoredSnapshot?` | [`Snapshot`](https://www.jsdocs.io/package/xstate#Snapshot)\<`unknown`\> |
|
|
135
|
-
|
|
136
|
-
#### Returns
|
|
137
|
-
|
|
138
|
-
`PlayerActor`\<`TMachine`\>
|
|
139
|
-
|
|
140
|
-
#### Overrides
|
|
141
|
-
|
|
142
|
-
[`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`constructor`](../../play-actor/classes/AbstractActor.md#constructor)
|
|
143
|
-
|
|
144
|
-
## Properties
|
|
145
|
-
|
|
146
|
-
| Property | Modifier | Type | Description | Overrides | Inherited from | Defined in |
|
|
147
|
-
| ------------------------------------------------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
148
|
-
| <a id="property-_parent"></a> `_parent?` | `public` | [`AnyActorRef`](https://www.jsdocs.io/package/xstate#AnyActorRef) | - | - | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`_parent`](../../play-actor/classes/AbstractActor.md#property-_parent) | - |
|
|
149
|
-
| <a id="property-clock"></a> `clock` | `public` | [`Clock`](https://www.jsdocs.io/package/xstate#Clock) | The clock that is responsible for setting and clearing timeouts, such as delayed events and transitions. | - | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`clock`](../../play-actor/classes/AbstractActor.md#property-clock) | - |
|
|
150
|
-
| <a id="property-currentroute"></a> `currentRoute` | `public` | [`Computed`](../../play-signals/namespaces/Signal/classes/Computed.md)\<`string` \| `null`\> | A TC39 `Signal.Computed`. It derives the current URL path from the `meta.route` template of the active machine state and from the context of the actor. It returns `null` when the current state has no `meta.route` field, and also when it cannot resolve the complete route template. A necessary `:param` that the context does not hold is caught inside the signal, and a `MissingRouteParamError` therefore never leaves `get()`: that condition is temporary during a transition, and the signal computes the value again on the next snapshot. **Example** `// It returns "/profile/alice" when context.params.userId === "alice", // and null while the param is still absent. const route = actor.currentRoute.get();` | - | - | [packages/play-xstate/src/player-actor.ts:305](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-xstate/src/player-actor.ts#L305) |
|
|
151
|
-
| <a id="property-currentview"></a> `currentView` | `readonly` | [`State`](../../play-signals/namespaces/Signal/classes/State.md)\<[`PlaySpec`](../../play-actor/interfaces/PlaySpec.md) \| `null`\> | The reactive signal of the current view spec. The signal derives the spec from the `meta.view` metadata of the active state. It emits a **new object reference** on each real change of the view on the screen: the view of a different state, or a change of a param or of the context that changes the resolved spec. A re-entry with `reenter: true` and new params also changes the spec. A snapshot that changes no view on the screen, such as an assign of the context alone, keeps the previous reference. A provider below the signal therefore mounts the UI again not on every event. The `PlaySpec` of the emission carries the context of the machine in its composed `state` field, under the read-only `/context` subtree. A spec therefore reads the context, and also each URL param, through the ordinary state grammar (`{ $state: "/context/params/section" }`). The context-projection module of `@xmachines/play-actor` holds the complete contract. The signal returns `null` when the current state has no `meta.view` metadata. Two states can declare two separate `meta.view` literals with an identical structure. A transition between those two states then emits two different references, and a provider mounts the UI again. Move the shared literal into one `typedSpec` constant, and the identity then removes the duplicate. **Example** `const view = actor.currentView.get(); if (view) { console.log(view.root); // for example "root" console.log(view.elements); // the Spec elements of @xmachines/json-render-core }` | - | - | [packages/play-xstate/src/player-actor.ts:359](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-xstate/src/player-actor.ts#L359) |
|
|
152
|
-
| <a id="property-id"></a> `id` | `public` | `string` | The unique identifier for this actor relative to its parent. | - | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`id`](../../play-actor/classes/AbstractActor.md#property-id) | - |
|
|
153
|
-
| <a id="property-initialroute"></a> `initialRoute` | `readonly` | `string` \| `null` | The route of the initial state of the machine. The constructor fixes it, and it never changes, also when the code restores the actor from a snapshot. A router bridge compares it with the browser URL, and it therefore separates a deep link (a URL that is not the initial one → the router wins) from a restore (the initial URL, and the actor at a different route from the restore → the actor wins). `deriveInitialRoute` derives the value statically from the machine definition, with the pure `initialTransition` helper of XState: the chain of the initial states and their `meta.route` templates are fixed at the moment of the machine definition, and the substitution of a `:param` uses the real initial context of the machine for the `input` of this actor. The code makes no second actor, and a snapshot of a restore changes the value never: it is always the **default** initial route of the machine. | - | - | [packages/play-xstate/src/player-actor.ts:324](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-xstate/src/player-actor.ts#L324) |
|
|
154
|
-
| <a id="property-logic"></a> `logic` | `public` | [`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic) | - | - | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`logic`](../../play-actor/classes/AbstractActor.md#property-logic) | - |
|
|
155
|
-
| <a id="property-options"></a> `options` | `public` | `Readonly`\<[`ActorOptions`](https://www.jsdocs.io/package/xstate#ActorOptions)\<`TLogic`\>\> | - | - | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`options`](../../play-actor/classes/AbstractActor.md#property-options) | - |
|
|
156
|
-
| <a id="property-ref"></a> `ref` | `public` | [`ActorRef`](https://www.jsdocs.io/package/xstate#ActorRef)\<`any`, `any`, `any`\> | - | - | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`ref`](../../play-actor/classes/AbstractActor.md#property-ref) | - |
|
|
157
|
-
| <a id="property-sessionid"></a> `sessionId` | `public` | `string` | The globally unique process ID for this invocation. | - | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`sessionId`](../../play-actor/classes/AbstractActor.md#property-sessionid) | - |
|
|
158
|
-
| <a id="property-src"></a> `src` | `public` | \| `string` \| [`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic) | - | - | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`src`](../../play-actor/classes/AbstractActor.md#property-src) | - |
|
|
159
|
-
| <a id="property-state"></a> `state` | `public` | [`State`](../../play-signals/namespaces/Signal/classes/State.md)\<`ReturnType`\<`TMachine`\[`"transition"`\]\>\> | The reactive snapshot of the current actor state. The infrastructure observes this signal, and it reacts to each state change. It therefore holds no coupling to the internal state machine of the actor. | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`state`](../../play-actor/classes/AbstractActor.md#property-state) | - | [packages/play-xstate/src/player-actor.ts:264](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-xstate/src/player-actor.ts#L264) |
|
|
160
|
-
| <a id="property-system"></a> `system` | `public` | [`AnyActorSystem`](https://www.jsdocs.io/package/xstate#AnyActorSystem) | The system to which this actor belongs. | - | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`system`](../../play-actor/classes/AbstractActor.md#property-system) | - |
|
|
161
|
-
| <a id="property-systemid"></a> `systemId` | `public` | `string` \| `undefined` | - | - | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`systemId`](../../play-actor/classes/AbstractActor.md#property-systemid) | - |
|
|
162
|
-
|
|
163
|
-
## Methods
|
|
164
|
-
|
|
165
|
-
### \[dispose\]()
|
|
166
|
-
|
|
167
|
-
```ts
|
|
168
|
-
dispose: void;
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:779](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-xstate/src/player-actor.ts#L779)
|
|
172
|
-
|
|
173
|
-
Stops the actor when the scope of a `using` declaration ends.
|
|
174
|
-
|
|
175
|
-
The actor is a `Disposable`, so a scope that owns one writes no teardown:
|
|
176
|
-
|
|
177
|
-
```ts
|
|
178
|
-
{
|
|
179
|
-
using actor = definePlayer({ machine })();
|
|
180
|
-
actor.start();
|
|
181
|
-
actor.send({ type: "go" });
|
|
182
|
-
// stop() runs here, and it runs even when send() throws
|
|
183
|
-
}
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
The release is [stop](#stop), which is synchronous and idempotent. `Disposable` and
|
|
187
|
-
not `AsyncDisposable`: a `Disposable` serves `using` AND `await using`, while an
|
|
188
|
-
`AsyncDisposable` raises a TypeError under a plain `using`.
|
|
189
|
-
|
|
190
|
-
The key is `DISPOSE` of `@xmachines/play` and not a bare `Symbol.dispose`, so that
|
|
191
|
-
the method still answers a `using` that a bundler downlevelled for a target without
|
|
192
|
-
the well-known symbol.
|
|
193
|
-
|
|
194
|
-
#### Returns
|
|
195
|
-
|
|
196
|
-
`void`
|
|
197
|
-
|
|
198
|
-
---
|
|
199
|
-
|
|
200
|
-
### \[observable\]()
|
|
201
|
-
|
|
202
|
-
```ts
|
|
203
|
-
observable: InteropSubscribable<any>;
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
Defined in: `xstate`
|
|
207
|
-
|
|
208
|
-
#### Returns
|
|
209
|
-
|
|
210
|
-
[`InteropSubscribable`](https://www.jsdocs.io/package/xstate#InteropSubscribable)\<`any`\>
|
|
211
|
-
|
|
212
|
-
#### Inherited from
|
|
213
|
-
|
|
214
|
-
[`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`[observable]`](../../play-actor/classes/AbstractActor.md#observable)
|
|
215
|
-
|
|
216
|
-
---
|
|
217
|
-
|
|
218
|
-
### can()
|
|
219
|
-
|
|
220
|
-
```ts
|
|
221
|
-
can(event): boolean;
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:277](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-xstate/src/player-actor.ts#L277)
|
|
225
|
-
|
|
226
|
-
Tells you if the current state of the actor accepts the given event.
|
|
227
|
-
|
|
228
|
-
The type is the event union of the machine. An unknown event type is therefore a
|
|
229
|
-
compile error. The method evaluates the event against the snapshot signal.
|
|
230
|
-
|
|
231
|
-
#### Parameters
|
|
232
|
-
|
|
233
|
-
| Parameter | Type |
|
|
234
|
-
| --------- | ------------------------------------------------------------------------------------- |
|
|
235
|
-
| `event` | [`EventFromLogic`](https://www.jsdocs.io/package/xstate#EventFromLogic)\<`TMachine`\> |
|
|
236
|
-
|
|
237
|
-
#### Returns
|
|
238
|
-
|
|
239
|
-
`boolean`
|
|
240
|
-
|
|
241
|
-
#### Example
|
|
242
|
-
|
|
243
|
-
```typescript
|
|
244
|
-
if (actor.can({ type: "auth.logout" })) { ... }
|
|
245
|
-
```
|
|
246
|
-
|
|
247
|
-
---
|
|
248
|
-
|
|
249
|
-
### ~~dispose()~~
|
|
250
|
-
|
|
251
|
-
```ts
|
|
252
|
-
dispose(): void;
|
|
253
|
-
```
|
|
254
|
-
|
|
255
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:753](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-xstate/src/player-actor.ts#L753)
|
|
256
|
-
|
|
257
|
-
The dispose method, for the cleanup. It is the alias of [stop](#stop).
|
|
258
|
-
|
|
259
|
-
#### Returns
|
|
260
|
-
|
|
261
|
-
`void`
|
|
262
|
-
|
|
263
|
-
#### Deprecated
|
|
264
|
-
|
|
265
|
-
Use [stop](#stop), or a `using` declaration. Will be removed in the
|
|
266
|
-
next major.
|
|
267
|
-
|
|
268
|
-
---
|
|
269
|
-
|
|
270
|
-
### getPersistedSnapshot()
|
|
271
|
-
|
|
272
|
-
```ts
|
|
273
|
-
getPersistedSnapshot(options?): Snapshot<unknown>;
|
|
274
|
-
```
|
|
275
|
-
|
|
276
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:697](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-xstate/src/player-actor.ts#L697)
|
|
277
|
-
|
|
278
|
-
Returns the persisted snapshot of this actor.
|
|
279
|
-
|
|
280
|
-
Use it to serialize the state, and to restore it later with the
|
|
281
|
-
`restore.snapshot` option of the factory.
|
|
282
|
-
|
|
283
|
-
#### Parameters
|
|
284
|
-
|
|
285
|
-
| Parameter | Type |
|
|
286
|
-
| ---------- | --------- |
|
|
287
|
-
| `options?` | `unknown` |
|
|
288
|
-
|
|
289
|
-
#### Returns
|
|
290
|
-
|
|
291
|
-
[`Snapshot`](https://www.jsdocs.io/package/xstate#Snapshot)\<`unknown`\>
|
|
292
|
-
|
|
293
|
-
#### Overrides
|
|
294
|
-
|
|
295
|
-
[`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`getPersistedSnapshot`](../../play-actor/classes/AbstractActor.md#getpersistedsnapshot)
|
|
296
|
-
|
|
297
|
-
---
|
|
298
|
-
|
|
299
|
-
### getSnapshot()
|
|
300
|
-
|
|
301
|
-
```ts
|
|
302
|
-
getSnapshot(): SnapshotFrom<TMachine>;
|
|
303
|
-
```
|
|
304
|
-
|
|
305
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:596](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-xstate/src/player-actor.ts#L596)
|
|
306
|
-
|
|
307
|
-
Returns the current snapshot
|
|
308
|
-
|
|
309
|
-
#### Returns
|
|
310
|
-
|
|
311
|
-
[`SnapshotFrom`](https://www.jsdocs.io/package/xstate#SnapshotFrom)\<`TMachine`\>
|
|
312
|
-
|
|
313
|
-
#### Overrides
|
|
314
|
-
|
|
315
|
-
[`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`getSnapshot`](../../play-actor/classes/AbstractActor.md#getsnapshot)
|
|
316
|
-
|
|
317
|
-
---
|
|
318
|
-
|
|
319
|
-
### on()
|
|
320
|
-
|
|
321
|
-
```ts
|
|
322
|
-
on<TType>(type, handler): Subscription;
|
|
323
|
-
```
|
|
324
|
-
|
|
325
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:682](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-xstate/src/player-actor.ts#L682)
|
|
326
|
-
|
|
327
|
-
Listens for the events that this actor emits with the `emit` action.
|
|
328
|
-
|
|
329
|
-
#### Type Parameters
|
|
330
|
-
|
|
331
|
-
| Type Parameter |
|
|
332
|
-
| ----------------------- |
|
|
333
|
-
| `TType` _extends_ `any` |
|
|
334
|
-
|
|
335
|
-
#### Parameters
|
|
336
|
-
|
|
337
|
-
| Parameter | Type | Description |
|
|
338
|
-
| --------- | --------------------- | ---------------------------------------------------------------------- |
|
|
339
|
-
| `type` | `TType` | The type of the emitted event to listen for, or `"*"` for every event. |
|
|
340
|
-
| `handler` | (`emitted`) => `void` | The actor calls it with each emitted event that matches. |
|
|
341
|
-
|
|
342
|
-
#### Returns
|
|
343
|
-
|
|
344
|
-
[`Subscription`](https://www.jsdocs.io/package/xstate#Subscription)
|
|
345
|
-
|
|
346
|
-
The subscription, with an `unsubscribe()` method.
|
|
347
|
-
|
|
348
|
-
#### Overrides
|
|
349
|
-
|
|
350
|
-
[`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`on`](../../play-actor/classes/AbstractActor.md#on)
|
|
351
|
-
|
|
352
|
-
---
|
|
353
|
-
|
|
354
|
-
### select()
|
|
355
|
-
|
|
356
|
-
```ts
|
|
357
|
-
select<TSelected>(selector, equalityFn?): Readable<TSelected>;
|
|
358
|
-
```
|
|
359
|
-
|
|
360
|
-
Defined in: `xstate`
|
|
361
|
-
|
|
362
|
-
#### Type Parameters
|
|
363
|
-
|
|
364
|
-
| Type Parameter |
|
|
365
|
-
| -------------- |
|
|
366
|
-
| `TSelected` |
|
|
367
|
-
|
|
368
|
-
#### Parameters
|
|
369
|
-
|
|
370
|
-
| Parameter | Type |
|
|
371
|
-
| ------------- | --------------------------- |
|
|
372
|
-
| `selector` | (`snapshot`) => `TSelected` |
|
|
373
|
-
| `equalityFn?` | (`a`, `b`) => `boolean` |
|
|
374
|
-
|
|
375
|
-
#### Returns
|
|
376
|
-
|
|
377
|
-
`Readable`\<`TSelected`\>
|
|
378
|
-
|
|
379
|
-
#### Inherited from
|
|
380
|
-
|
|
381
|
-
[`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`select`](../../play-actor/classes/AbstractActor.md#select)
|
|
382
|
-
|
|
383
|
-
---
|
|
384
|
-
|
|
385
|
-
### send()
|
|
386
|
-
|
|
387
|
-
```ts
|
|
388
|
-
send(event): void;
|
|
389
|
-
```
|
|
390
|
-
|
|
391
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:557](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-xstate/src/player-actor.ts#L557)
|
|
392
|
-
|
|
393
|
-
Sends an event to this actor.
|
|
394
|
-
|
|
395
|
-
The guards of the state machine of the actor decide if the event causes a
|
|
396
|
-
transition. Give any event of the event union of the machine: a domain event, a
|
|
397
|
-
routing event, and so on.
|
|
398
|
-
|
|
399
|
-
#### Parameters
|
|
400
|
-
|
|
401
|
-
| Parameter | Type | Description |
|
|
402
|
-
| --------- | ------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |
|
|
403
|
-
| `event` | [`EventFromLogic`](https://www.jsdocs.io/package/xstate#EventFromLogic)\<`TMachine`\> | An event of the `EventFromLogic<TMachine>` union of the machine. |
|
|
404
|
-
|
|
405
|
-
#### Returns
|
|
406
|
-
|
|
407
|
-
`void`
|
|
408
|
-
|
|
409
|
-
#### Throws
|
|
410
|
-
|
|
411
|
-
When `event` is not a plain object, for example
|
|
412
|
-
`null`, `undefined`, a string, or a number. Import the class from
|
|
413
|
-
`@xmachines/play-xstate/errors`.
|
|
414
|
-
|
|
415
|
-
#### Example
|
|
416
|
-
|
|
417
|
-
```typescript
|
|
418
|
-
// A domain event, with the type of the event union of the machine
|
|
419
|
-
actor.send({ type: "auth.login", userId: "123" });
|
|
420
|
-
|
|
421
|
-
// A routing event
|
|
422
|
-
actor.send({ type: "play.route", to: "#home" });
|
|
423
|
-
```
|
|
424
|
-
|
|
425
|
-
#### Overrides
|
|
426
|
-
|
|
427
|
-
[`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`send`](../../play-actor/classes/AbstractActor.md#send)
|
|
428
|
-
|
|
429
|
-
---
|
|
430
|
-
|
|
431
|
-
### start()
|
|
432
|
-
|
|
433
|
-
```ts
|
|
434
|
-
start(): this;
|
|
435
|
-
```
|
|
436
|
-
|
|
437
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:483](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-xstate/src/player-actor.ts#L483)
|
|
438
|
-
|
|
439
|
-
Starts the actor.
|
|
440
|
-
|
|
441
|
-
The method fires `onStart` on each real start, which is every transition from
|
|
442
|
-
"not running" to "running". A start after a stop is such a transition, and XState
|
|
443
|
-
permits it: its own `start()` stops only while the actor RUNS already. A second
|
|
444
|
-
call while the actor runs fires no hook. Therefore a defensive double mount runs
|
|
445
|
-
the side effects of `onStart` one time for one real start.
|
|
446
|
-
|
|
447
|
-
#### Returns
|
|
448
|
-
|
|
449
|
-
`this`
|
|
450
|
-
|
|
451
|
-
#### Overrides
|
|
452
|
-
|
|
453
|
-
[`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`start`](../../play-actor/classes/AbstractActor.md#start)
|
|
454
|
-
|
|
455
|
-
---
|
|
456
|
-
|
|
457
|
-
### stop()
|
|
458
|
-
|
|
459
|
-
```ts
|
|
460
|
-
stop(): this;
|
|
461
|
-
```
|
|
462
|
-
|
|
463
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:513](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-xstate/src/player-actor.ts#L513)
|
|
464
|
-
|
|
465
|
-
Stops the actor and cleans up.
|
|
466
|
-
|
|
467
|
-
The method fires `onStop` only when the actor ran. This matches XState, where a
|
|
468
|
-
stop of an actor that never started, or of an actor that stopped already, does
|
|
469
|
-
nothing and tears nothing down. Therefore the paired cleanup runs never two
|
|
470
|
-
times, and it runs never against a resource that `onStart` did not take. A stop
|
|
471
|
-
does not close the actor for ever: a later `start()` is a new lifecycle, and it
|
|
472
|
-
fires `onStart` again.
|
|
473
|
-
|
|
474
|
-
#### Returns
|
|
475
|
-
|
|
476
|
-
`this`
|
|
477
|
-
|
|
478
|
-
#### Overrides
|
|
479
|
-
|
|
480
|
-
[`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`stop`](../../play-actor/classes/AbstractActor.md#stop)
|
|
481
|
-
|
|
482
|
-
---
|
|
483
|
-
|
|
484
|
-
### subscribe()
|
|
485
|
-
|
|
486
|
-
#### Call Signature
|
|
487
|
-
|
|
488
|
-
```ts
|
|
489
|
-
subscribe(observer): Subscription;
|
|
490
|
-
```
|
|
491
|
-
|
|
492
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:619](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-xstate/src/player-actor.ts#L619)
|
|
493
|
-
|
|
494
|
-
Subscribes to the snapshot updates of this actor.
|
|
495
|
-
|
|
496
|
-
The method accepts an observer object, exactly like `Actor.subscribe` of XState.
|
|
497
|
-
|
|
498
|
-
##### Parameters
|
|
499
|
-
|
|
500
|
-
| Parameter | Type | Description |
|
|
501
|
-
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------ |
|
|
502
|
-
| `observer` | [`Observer`](https://www.jsdocs.io/package/xstate#Observer)\<[`SnapshotFrom`](https://www.jsdocs.io/package/xstate#SnapshotFrom)\<`TMachine`\>\> | The observer, with a `next`, an `error`, and a `complete` handler. |
|
|
503
|
-
|
|
504
|
-
##### Returns
|
|
505
|
-
|
|
506
|
-
[`Subscription`](https://www.jsdocs.io/package/xstate#Subscription)
|
|
507
|
-
|
|
508
|
-
The subscription, with an `unsubscribe()` method.
|
|
509
|
-
|
|
510
|
-
##### Overrides
|
|
511
|
-
|
|
512
|
-
[`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`subscribe`](../../play-actor/classes/AbstractActor.md#subscribe)
|
|
513
|
-
|
|
514
|
-
#### Call Signature
|
|
515
|
-
|
|
516
|
-
```ts
|
|
517
|
-
subscribe(
|
|
518
|
-
nextListener?,
|
|
519
|
-
errorListener?,
|
|
520
|
-
completeListener?): Subscription;
|
|
521
|
-
```
|
|
522
|
-
|
|
523
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:630](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-xstate/src/player-actor.ts#L630)
|
|
524
|
-
|
|
525
|
-
Subscribes to the snapshot updates of this actor.
|
|
526
|
-
|
|
527
|
-
The method accepts listener functions, exactly like `Actor.subscribe` of XState.
|
|
528
|
-
|
|
529
|
-
##### Parameters
|
|
530
|
-
|
|
531
|
-
| Parameter | Type | Description |
|
|
532
|
-
| ------------------- | ---------------------- | -------------------------------------------------------------------------------- |
|
|
533
|
-
| `nextListener?` | (`snapshot`) => `void` | The listener function of each snapshot. |
|
|
534
|
-
| `errorListener?` | (`error`) => `void` | The actor calls it on an error. |
|
|
535
|
-
| `completeListener?` | () => `void` | The actor calls it when it completes, which means that it reaches a final state. |
|
|
536
|
-
|
|
537
|
-
##### Returns
|
|
538
|
-
|
|
539
|
-
[`Subscription`](https://www.jsdocs.io/package/xstate#Subscription)
|
|
540
|
-
|
|
541
|
-
The subscription, with an `unsubscribe()` method.
|
|
542
|
-
|
|
543
|
-
##### Overrides
|
|
544
|
-
|
|
545
|
-
[`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`subscribe`](../../play-actor/classes/AbstractActor.md#subscribe)
|
|
546
|
-
|
|
547
|
-
---
|
|
548
|
-
|
|
549
|
-
### toJSON()
|
|
550
|
-
|
|
551
|
-
```ts
|
|
552
|
-
toJSON(): object;
|
|
553
|
-
```
|
|
554
|
-
|
|
555
|
-
Defined in: `xstate`
|
|
556
|
-
|
|
557
|
-
#### Returns
|
|
558
|
-
|
|
559
|
-
`object`
|
|
560
|
-
|
|
561
|
-
| Name | Type | Defined in |
|
|
562
|
-
| -------------- | -------- | ---------- |
|
|
563
|
-
| `id` | `string` | - |
|
|
564
|
-
| `xstate$$type` | `number` | - |
|
|
565
|
-
|
|
566
|
-
#### Inherited from
|
|
567
|
-
|
|
568
|
-
[`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`toJSON`](../../play-actor/classes/AbstractActor.md#tojson)
|