@rb-games/core 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +488 -0
- package/dist/devtools/DraggableController.d.ts +10 -0
- package/dist/devtools/DraggableController.d.ts.map +1 -0
- package/dist/devtools/ResizableController.d.ts +19 -0
- package/dist/devtools/ResizableController.d.ts.map +1 -0
- package/dist/devtools/index.d.ts +7 -0
- package/dist/devtools/index.d.ts.map +1 -0
- package/dist/devtools/index.js +884 -0
- package/dist/devtools/index.js.map +1 -0
- package/dist/devtools/overlayPlugin.d.ts +3 -0
- package/dist/devtools/overlayPlugin.d.ts.map +1 -0
- package/dist/devtools/spinePropertiesPlugin.d.ts +3 -0
- package/dist/devtools/spinePropertiesPlugin.d.ts.map +1 -0
- package/dist/devtools/spriteTextPropertiesPlugin.d.ts +3 -0
- package/dist/devtools/spriteTextPropertiesPlugin.d.ts.map +1 -0
- package/dist/devtools/treePlugin.d.ts +7 -0
- package/dist/devtools/treePlugin.d.ts.map +1 -0
- package/dist/engine/PixiEngine.d.ts +404 -0
- package/dist/engine/PixiEngine.d.ts.map +1 -0
- package/dist/engine/index.d.ts +2 -0
- package/dist/engine/index.d.ts.map +1 -0
- package/dist/engine/index.js +1818 -0
- package/dist/engine/index.js.map +1 -0
- package/dist/filters/ChromaKeyFilter.d.ts +64 -0
- package/dist/filters/ChromaKeyFilter.d.ts.map +1 -0
- package/dist/filters/index.d.ts +2 -0
- package/dist/filters/index.d.ts.map +1 -0
- package/dist/filters/index.js +248 -0
- package/dist/filters/index.js.map +1 -0
- package/dist/helpers/AssetHelper.d.ts +117 -0
- package/dist/helpers/AssetHelper.d.ts.map +1 -0
- package/dist/helpers/SVGAssetHelper.d.ts +397 -0
- package/dist/helpers/SVGAssetHelper.d.ts.map +1 -0
- package/dist/helpers/SVGLoader.d.ts +46 -0
- package/dist/helpers/SVGLoader.d.ts.map +1 -0
- package/dist/helpers/SVGParser.d.ts +121 -0
- package/dist/helpers/SVGParser.d.ts.map +1 -0
- package/dist/helpers/eventBridge.d.ts +150 -0
- package/dist/helpers/eventBridge.d.ts.map +1 -0
- package/dist/helpers/index.d.ts +8 -0
- package/dist/helpers/index.d.ts.map +1 -0
- package/dist/helpers/index.js +702 -0
- package/dist/helpers/index.js.map +1 -0
- package/dist/helpers/mergeUtils.d.ts +21 -0
- package/dist/helpers/mergeUtils.d.ts.map +1 -0
- package/dist/helpers/resolvePublicPath.d.ts +6 -0
- package/dist/helpers/resolvePublicPath.d.ts.map +1 -0
- package/dist/i18n/index.d.ts +2 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +527 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/i18n/sharedI18n.d.ts +11 -0
- package/dist/i18n/sharedI18n.d.ts.map +1 -0
- package/dist/layout/Align.d.ts +126 -0
- package/dist/layout/Align.d.ts.map +1 -0
- package/dist/layout/Bounds.d.ts +120 -0
- package/dist/layout/Bounds.d.ts.map +1 -0
- package/dist/layout/Distribute.d.ts +103 -0
- package/dist/layout/Distribute.d.ts.map +1 -0
- package/dist/layout/Flow.d.ts +213 -0
- package/dist/layout/Flow.d.ts.map +1 -0
- package/dist/layout/PositionUtils.d.ts +57 -0
- package/dist/layout/PositionUtils.d.ts.map +1 -0
- package/dist/layout/index.d.ts +6 -0
- package/dist/layout/index.d.ts.map +1 -0
- package/dist/layout/index.js +673 -0
- package/dist/layout/index.js.map +1 -0
- package/dist/particle/Emitter.d.ts +290 -0
- package/dist/particle/Emitter.d.ts.map +1 -0
- package/dist/particle/EmitterConfig.d.ts +228 -0
- package/dist/particle/EmitterConfig.d.ts.map +1 -0
- package/dist/particle/LinkedListContainer.d.ts +7 -0
- package/dist/particle/LinkedListContainer.d.ts.map +1 -0
- package/dist/particle/Particle.d.ts +63 -0
- package/dist/particle/Particle.d.ts.map +1 -0
- package/dist/particle/ParticleUtils.d.ts +97 -0
- package/dist/particle/ParticleUtils.d.ts.map +1 -0
- package/dist/particle/PropertyList.d.ts +40 -0
- package/dist/particle/PropertyList.d.ts.map +1 -0
- package/dist/particle/PropertyNode.d.ts +74 -0
- package/dist/particle/PropertyNode.d.ts.map +1 -0
- package/dist/particle/SpineEmitter.d.ts +55 -0
- package/dist/particle/SpineEmitter.d.ts.map +1 -0
- package/dist/particle/SpineParticle.d.ts +74 -0
- package/dist/particle/SpineParticle.d.ts.map +1 -0
- package/dist/particle/behaviors/AccelerationMovement.d.ts +62 -0
- package/dist/particle/behaviors/AccelerationMovement.d.ts.map +1 -0
- package/dist/particle/behaviors/Alpha.d.ts +60 -0
- package/dist/particle/behaviors/Alpha.d.ts.map +1 -0
- package/dist/particle/behaviors/AnimatedTexture.d.ts +111 -0
- package/dist/particle/behaviors/AnimatedTexture.d.ts.map +1 -0
- package/dist/particle/behaviors/Behaviors.d.ts +71 -0
- package/dist/particle/behaviors/Behaviors.d.ts.map +1 -0
- package/dist/particle/behaviors/BlendMode.d.ts +31 -0
- package/dist/particle/behaviors/BlendMode.d.ts.map +1 -0
- package/dist/particle/behaviors/BurstSpawn.d.ts +43 -0
- package/dist/particle/behaviors/BurstSpawn.d.ts.map +1 -0
- package/dist/particle/behaviors/Color.d.ts +60 -0
- package/dist/particle/behaviors/Color.d.ts.map +1 -0
- package/dist/particle/behaviors/MultiStateAnimatedTexture.d.ts +99 -0
- package/dist/particle/behaviors/MultiStateAnimatedTexture.d.ts.map +1 -0
- package/dist/particle/behaviors/OrderedTexture.d.ts +33 -0
- package/dist/particle/behaviors/OrderedTexture.d.ts.map +1 -0
- package/dist/particle/behaviors/PathMovement.d.ts +68 -0
- package/dist/particle/behaviors/PathMovement.d.ts.map +1 -0
- package/dist/particle/behaviors/PointSpawn.d.ts +21 -0
- package/dist/particle/behaviors/PointSpawn.d.ts.map +1 -0
- package/dist/particle/behaviors/RandomColor.d.ts +17 -0
- package/dist/particle/behaviors/RandomColor.d.ts.map +1 -0
- package/dist/particle/behaviors/RandomTexture.d.ts +32 -0
- package/dist/particle/behaviors/RandomTexture.d.ts.map +1 -0
- package/dist/particle/behaviors/Rotation.d.ts +114 -0
- package/dist/particle/behaviors/Rotation.d.ts.map +1 -0
- package/dist/particle/behaviors/Scale.d.ts +74 -0
- package/dist/particle/behaviors/Scale.d.ts.map +1 -0
- package/dist/particle/behaviors/ShapeSpawn.d.ts +58 -0
- package/dist/particle/behaviors/ShapeSpawn.d.ts.map +1 -0
- package/dist/particle/behaviors/SingleTexture.d.ts +32 -0
- package/dist/particle/behaviors/SingleTexture.d.ts.map +1 -0
- package/dist/particle/behaviors/SpeedMovement.d.ts +76 -0
- package/dist/particle/behaviors/SpeedMovement.d.ts.map +1 -0
- package/dist/particle/behaviors/SpineTexture.d.ts +173 -0
- package/dist/particle/behaviors/SpineTexture.d.ts.map +1 -0
- package/dist/particle/behaviors/ZindexBehavior.d.ts +16 -0
- package/dist/particle/behaviors/ZindexBehavior.d.ts.map +1 -0
- package/dist/particle/behaviors/editor/Types.d.ts +104 -0
- package/dist/particle/behaviors/editor/Types.d.ts.map +1 -0
- package/dist/particle/behaviors/editor/behaviors/AccelerationMovement.d.ts +2 -0
- package/dist/particle/behaviors/editor/behaviors/AccelerationMovement.d.ts.map +1 -0
- package/dist/particle/behaviors/editor/behaviors/Alpha.d.ts +2 -0
- package/dist/particle/behaviors/editor/behaviors/Alpha.d.ts.map +1 -0
- package/dist/particle/behaviors/editor/behaviors/AnimatedTexture.d.ts +2 -0
- package/dist/particle/behaviors/editor/behaviors/AnimatedTexture.d.ts.map +1 -0
- package/dist/particle/behaviors/editor/behaviors/BlendMode.d.ts +2 -0
- package/dist/particle/behaviors/editor/behaviors/BlendMode.d.ts.map +1 -0
- package/dist/particle/behaviors/editor/behaviors/BurstSpawn.d.ts +2 -0
- package/dist/particle/behaviors/editor/behaviors/BurstSpawn.d.ts.map +1 -0
- package/dist/particle/behaviors/editor/behaviors/Color.d.ts +2 -0
- package/dist/particle/behaviors/editor/behaviors/Color.d.ts.map +1 -0
- package/dist/particle/behaviors/editor/behaviors/OrderedTexture.d.ts +2 -0
- package/dist/particle/behaviors/editor/behaviors/OrderedTexture.d.ts.map +1 -0
- package/dist/particle/behaviors/editor/behaviors/PathMovement.d.ts +2 -0
- package/dist/particle/behaviors/editor/behaviors/PathMovement.d.ts.map +1 -0
- package/dist/particle/behaviors/editor/behaviors/PointSpawn.d.ts +2 -0
- package/dist/particle/behaviors/editor/behaviors/PointSpawn.d.ts.map +1 -0
- package/dist/particle/behaviors/editor/behaviors/RandomTexture.d.ts +2 -0
- package/dist/particle/behaviors/editor/behaviors/RandomTexture.d.ts.map +1 -0
- package/dist/particle/behaviors/editor/behaviors/Rotation.d.ts +2 -0
- package/dist/particle/behaviors/editor/behaviors/Rotation.d.ts.map +1 -0
- package/dist/particle/behaviors/editor/behaviors/Scale.d.ts +2 -0
- package/dist/particle/behaviors/editor/behaviors/Scale.d.ts.map +1 -0
- package/dist/particle/behaviors/editor/behaviors/ShapeSpawn.d.ts +2 -0
- package/dist/particle/behaviors/editor/behaviors/ShapeSpawn.d.ts.map +1 -0
- package/dist/particle/behaviors/editor/behaviors/SingleTexture.d.ts +2 -0
- package/dist/particle/behaviors/editor/behaviors/SingleTexture.d.ts.map +1 -0
- package/dist/particle/behaviors/editor/behaviors/SpeedMovement.d.ts +2 -0
- package/dist/particle/behaviors/editor/behaviors/SpeedMovement.d.ts.map +1 -0
- package/dist/particle/behaviors/editor/behaviors/index.d.ts +15 -0
- package/dist/particle/behaviors/editor/behaviors/index.d.ts.map +1 -0
- package/dist/particle/behaviors/editor/index.d.ts +5 -0
- package/dist/particle/behaviors/editor/index.d.ts.map +1 -0
- package/dist/particle/behaviors/editor/shapes/PolygonalChain.d.ts +2 -0
- package/dist/particle/behaviors/editor/shapes/PolygonalChain.d.ts.map +1 -0
- package/dist/particle/behaviors/editor/shapes/Rectangle.d.ts +2 -0
- package/dist/particle/behaviors/editor/shapes/Rectangle.d.ts.map +1 -0
- package/dist/particle/behaviors/editor/shapes/Torus.d.ts +2 -0
- package/dist/particle/behaviors/editor/shapes/Torus.d.ts.map +1 -0
- package/dist/particle/behaviors/index.d.ts +25 -0
- package/dist/particle/behaviors/index.d.ts.map +1 -0
- package/dist/particle/behaviors/shapes/PolygonalChain.d.ts +57 -0
- package/dist/particle/behaviors/shapes/PolygonalChain.d.ts.map +1 -0
- package/dist/particle/behaviors/shapes/Rectangle.d.ts +59 -0
- package/dist/particle/behaviors/shapes/Rectangle.d.ts.map +1 -0
- package/dist/particle/behaviors/shapes/SpawnShape.d.ts +32 -0
- package/dist/particle/behaviors/shapes/SpawnShape.d.ts.map +1 -0
- package/dist/particle/behaviors/shapes/Torus.d.ts +71 -0
- package/dist/particle/behaviors/shapes/Torus.d.ts.map +1 -0
- package/dist/particle/behaviors/shapes/index.d.ts +5 -0
- package/dist/particle/behaviors/shapes/index.d.ts.map +1 -0
- package/dist/particle/index.d.ts +11 -0
- package/dist/particle/index.d.ts.map +1 -0
- package/dist/particle/index.js +2845 -0
- package/dist/particle/index.js.map +1 -0
- package/dist/plugins/Plugin.types.d.ts +80 -0
- package/dist/plugins/Plugin.types.d.ts.map +1 -0
- package/dist/plugins/device/DeviceOptimizerPlugin.d.ts +187 -0
- package/dist/plugins/device/DeviceOptimizerPlugin.d.ts.map +1 -0
- package/dist/plugins/device/DeviceOptimizerPlugin.types.d.ts +134 -0
- package/dist/plugins/device/DeviceOptimizerPlugin.types.d.ts.map +1 -0
- package/dist/plugins/device/index.d.ts +3 -0
- package/dist/plugins/device/index.d.ts.map +1 -0
- package/dist/plugins/display/DisplayPlugin.d.ts +208 -0
- package/dist/plugins/display/DisplayPlugin.d.ts.map +1 -0
- package/dist/plugins/display/DisplayPlugin.types.d.ts +174 -0
- package/dist/plugins/display/DisplayPlugin.types.d.ts.map +1 -0
- package/dist/plugins/display/displayViewport.d.ts +10 -0
- package/dist/plugins/display/displayViewport.d.ts.map +1 -0
- package/dist/plugins/display/index.d.ts +4 -0
- package/dist/plugins/display/index.d.ts.map +1 -0
- package/dist/plugins/eventbus/EventBusPlugin.d.ts +21 -0
- package/dist/plugins/eventbus/EventBusPlugin.d.ts.map +1 -0
- package/dist/plugins/eventbus/EventBusPlugin.types.d.ts +24 -0
- package/dist/plugins/eventbus/EventBusPlugin.types.d.ts.map +1 -0
- package/dist/plugins/eventbus/index.d.ts +3 -0
- package/dist/plugins/eventbus/index.d.ts.map +1 -0
- package/dist/plugins/gsap/GsapPlugin.d.ts +307 -0
- package/dist/plugins/gsap/GsapPlugin.d.ts.map +1 -0
- package/dist/plugins/gsap/index.d.ts +2 -0
- package/dist/plugins/gsap/index.d.ts.map +1 -0
- package/dist/plugins/index.d.ts +13 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +12806 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/input/InputPlugin.const.d.ts +80 -0
- package/dist/plugins/input/InputPlugin.const.d.ts.map +1 -0
- package/dist/plugins/input/InputPlugin.d.ts +141 -0
- package/dist/plugins/input/InputPlugin.d.ts.map +1 -0
- package/dist/plugins/input/InputPlugin.types.d.ts +41 -0
- package/dist/plugins/input/InputPlugin.types.d.ts.map +1 -0
- package/dist/plugins/input/KeyboardManager.d.ts +139 -0
- package/dist/plugins/input/KeyboardManager.d.ts.map +1 -0
- package/dist/plugins/input/KeyboardManager.types.d.ts +27 -0
- package/dist/plugins/input/KeyboardManager.types.d.ts.map +1 -0
- package/dist/plugins/input/index.d.ts +4 -0
- package/dist/plugins/input/index.d.ts.map +1 -0
- package/dist/plugins/language/I18NextPlugin.d.ts +30 -0
- package/dist/plugins/language/I18NextPlugin.d.ts.map +1 -0
- package/dist/plugins/language/I18NextPlugin.types.d.ts +29 -0
- package/dist/plugins/language/I18NextPlugin.types.d.ts.map +1 -0
- package/dist/plugins/language/index.d.ts +3 -0
- package/dist/plugins/language/index.d.ts.map +1 -0
- package/dist/plugins/resource/ResourcePlugin.d.ts +189 -0
- package/dist/plugins/resource/ResourcePlugin.d.ts.map +1 -0
- package/dist/plugins/resource/ResourcePlugin.types.d.ts +153 -0
- package/dist/plugins/resource/ResourcePlugin.types.d.ts.map +1 -0
- package/dist/plugins/resource/index.d.ts +3 -0
- package/dist/plugins/resource/index.d.ts.map +1 -0
- package/dist/plugins/scene/Scene.d.ts +203 -0
- package/dist/plugins/scene/Scene.d.ts.map +1 -0
- package/dist/plugins/scene/ScenePlugin.d.ts +162 -0
- package/dist/plugins/scene/ScenePlugin.d.ts.map +1 -0
- package/dist/plugins/scene/ScenePlugin.types.d.ts +35 -0
- package/dist/plugins/scene/ScenePlugin.types.d.ts.map +1 -0
- package/dist/plugins/scene/index.d.ts +4 -0
- package/dist/plugins/scene/index.d.ts.map +1 -0
- package/dist/plugins/sentry/SentryPlugin.d.ts +66 -0
- package/dist/plugins/sentry/SentryPlugin.d.ts.map +1 -0
- package/dist/plugins/sentry/SentryPlugin.types.d.ts +8 -0
- package/dist/plugins/sentry/SentryPlugin.types.d.ts.map +1 -0
- package/dist/plugins/sentry/index.d.ts +3 -0
- package/dist/plugins/sentry/index.d.ts.map +1 -0
- package/dist/plugins/service/ServiceAdapter.d.ts +88 -0
- package/dist/plugins/service/ServiceAdapter.d.ts.map +1 -0
- package/dist/plugins/service/ServiceEventHelper.d.ts +6 -0
- package/dist/plugins/service/ServiceEventHelper.d.ts.map +1 -0
- package/dist/plugins/service/ServicePlugin.d.ts +135 -0
- package/dist/plugins/service/ServicePlugin.d.ts.map +1 -0
- package/dist/plugins/service/ServicePlugin.types.d.ts +14 -0
- package/dist/plugins/service/ServicePlugin.types.d.ts.map +1 -0
- package/dist/plugins/service/adapters/DevAuthAdapter.d.ts +56 -0
- package/dist/plugins/service/adapters/DevAuthAdapter.d.ts.map +1 -0
- package/dist/plugins/service/adapters/RGSAdapter.d.ts +82 -0
- package/dist/plugins/service/adapters/RGSAdapter.d.ts.map +1 -0
- package/dist/plugins/service/adapters/index.d.ts +7 -0
- package/dist/plugins/service/adapters/index.d.ts.map +1 -0
- package/dist/plugins/service/adapters/resolvePublicIp.d.ts +10 -0
- package/dist/plugins/service/adapters/resolvePublicIp.d.ts.map +1 -0
- package/dist/plugins/service/index.d.ts +10 -0
- package/dist/plugins/service/index.d.ts.map +1 -0
- package/dist/plugins/service/types/api.types.d.ts +299 -0
- package/dist/plugins/service/types/api.types.d.ts.map +1 -0
- package/dist/plugins/service/types/index.d.ts +6 -0
- package/dist/plugins/service/types/index.d.ts.map +1 -0
- package/dist/plugins/skin/ISkin.d.ts +62 -0
- package/dist/plugins/skin/ISkin.d.ts.map +1 -0
- package/dist/plugins/skin/Skin.d.ts +155 -0
- package/dist/plugins/skin/Skin.d.ts.map +1 -0
- package/dist/plugins/skin/SkinPlugin.d.ts +285 -0
- package/dist/plugins/skin/SkinPlugin.d.ts.map +1 -0
- package/dist/plugins/skin/SkinPlugin.types.d.ts +56 -0
- package/dist/plugins/skin/SkinPlugin.types.d.ts.map +1 -0
- package/dist/plugins/skin/index.d.ts +5 -0
- package/dist/plugins/skin/index.d.ts.map +1 -0
- package/dist/plugins/sound/SoundPlugin.d.ts +319 -0
- package/dist/plugins/sound/SoundPlugin.d.ts.map +1 -0
- package/dist/plugins/sound/SoundPlugin.types.d.ts +102 -0
- package/dist/plugins/sound/SoundPlugin.types.d.ts.map +1 -0
- package/dist/plugins/sound/SoundTestGUI.d.ts +42 -0
- package/dist/plugins/sound/SoundTestGUI.d.ts.map +1 -0
- package/dist/plugins/sound/index.d.ts +4 -0
- package/dist/plugins/sound/index.d.ts.map +1 -0
- package/dist/state-machine/ConfigBuilder.d.ts +239 -0
- package/dist/state-machine/ConfigBuilder.d.ts.map +1 -0
- package/dist/state-machine/StateMachine.d.ts +251 -0
- package/dist/state-machine/StateMachine.d.ts.map +1 -0
- package/dist/state-machine/guards.d.ts +151 -0
- package/dist/state-machine/guards.d.ts.map +1 -0
- package/dist/state-machine/index.d.ts +5 -0
- package/dist/state-machine/index.d.ts.map +1 -0
- package/dist/state-machine/index.js +954 -0
- package/dist/state-machine/index.js.map +1 -0
- package/dist/state-machine/types.d.ts +65 -0
- package/dist/state-machine/types.d.ts.map +1 -0
- package/dist/store/DataStore.d.ts +167 -0
- package/dist/store/DataStore.d.ts.map +1 -0
- package/dist/store/index.d.ts +3 -0
- package/dist/store/index.d.ts.map +1 -0
- package/dist/store/index.js +197 -0
- package/dist/store/index.js.map +1 -0
- package/dist/ui/behaviors/ButtonBehavior.d.ts +245 -0
- package/dist/ui/behaviors/ButtonBehavior.d.ts.map +1 -0
- package/dist/ui/behaviors/InputBehavior.d.ts +169 -0
- package/dist/ui/behaviors/InputBehavior.d.ts.map +1 -0
- package/dist/ui/behaviors/ScrollbarBehavior.d.ts +371 -0
- package/dist/ui/behaviors/ScrollbarBehavior.d.ts.map +1 -0
- package/dist/ui/behaviors/index.d.ts +4 -0
- package/dist/ui/behaviors/index.d.ts.map +1 -0
- package/dist/ui/components/ButtonComp.d.ts +138 -0
- package/dist/ui/components/ButtonComp.d.ts.map +1 -0
- package/dist/ui/components/Comp.utils.d.ts +390 -0
- package/dist/ui/components/Comp.utils.d.ts.map +1 -0
- package/dist/ui/components/Component.types.d.ts +41 -0
- package/dist/ui/components/Component.types.d.ts.map +1 -0
- package/dist/ui/components/InputComp.d.ts +43 -0
- package/dist/ui/components/InputComp.d.ts.map +1 -0
- package/dist/ui/components/LabelBox.d.ts +49 -0
- package/dist/ui/components/LabelBox.d.ts.map +1 -0
- package/dist/ui/components/ListTableComp.d.ts +106 -0
- package/dist/ui/components/ListTableComp.d.ts.map +1 -0
- package/dist/ui/components/Skinable.d.ts +261 -0
- package/dist/ui/components/Skinable.d.ts.map +1 -0
- package/dist/ui/components/SliderComp.d.ts +60 -0
- package/dist/ui/components/SliderComp.d.ts.map +1 -0
- package/dist/ui/components/SpriteTextBBCode.d.ts +16 -0
- package/dist/ui/components/SpriteTextBBCode.d.ts.map +1 -0
- package/dist/ui/components/StepperComp.d.ts +89 -0
- package/dist/ui/components/StepperComp.d.ts.map +1 -0
- package/dist/ui/components/index.d.ts +12 -0
- package/dist/ui/components/index.d.ts.map +1 -0
- package/dist/ui/components/spriteText/SpriteText.d.ts +114 -0
- package/dist/ui/components/spriteText/SpriteText.d.ts.map +1 -0
- package/dist/ui/components/spriteText/SpriteText.types.d.ts +109 -0
- package/dist/ui/components/spriteText/SpriteText.types.d.ts.map +1 -0
- package/dist/ui/components/spriteText/SpriteTextAlignment.d.ts +25 -0
- package/dist/ui/components/spriteText/SpriteTextAlignment.d.ts.map +1 -0
- package/dist/ui/components/spriteText/SpriteTextBezier.d.ts +20 -0
- package/dist/ui/components/spriteText/SpriteTextBezier.d.ts.map +1 -0
- package/dist/ui/components/spriteText/SpriteTextCurve.d.ts +4 -0
- package/dist/ui/components/spriteText/SpriteTextCurve.d.ts.map +1 -0
- package/dist/ui/components/spriteText/SpriteTextKerning.d.ts +7 -0
- package/dist/ui/components/spriteText/SpriteTextKerning.d.ts.map +1 -0
- package/dist/ui/components/spriteText/SpriteTextTexture.d.ts +16 -0
- package/dist/ui/components/spriteText/SpriteTextTexture.d.ts.map +1 -0
- package/dist/ui/components/spriteText/SpriteTextWrap.d.ts +19 -0
- package/dist/ui/components/spriteText/SpriteTextWrap.d.ts.map +1 -0
- package/dist/ui/components/spriteText/index.d.ts +3 -0
- package/dist/ui/components/spriteText/index.d.ts.map +1 -0
- package/dist/ui/index.d.ts +3 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +4778 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/utils/ArrayUtils.d.ts +24 -0
- package/dist/utils/ArrayUtils.d.ts.map +1 -0
- package/dist/utils/ColorUtils.d.ts +34 -0
- package/dist/utils/ColorUtils.d.ts.map +1 -0
- package/dist/utils/DataInjector.d.ts +67 -0
- package/dist/utils/DataInjector.d.ts.map +1 -0
- package/dist/utils/Logger.d.ts +332 -0
- package/dist/utils/Logger.d.ts.map +1 -0
- package/dist/utils/NumberFormatter.d.ts +126 -0
- package/dist/utils/NumberFormatter.d.ts.map +1 -0
- package/dist/utils/ObjectUtils.d.ts +64 -0
- package/dist/utils/ObjectUtils.d.ts.map +1 -0
- package/dist/utils/PixiUtils.d.ts +118 -0
- package/dist/utils/PixiUtils.d.ts.map +1 -0
- package/dist/utils/Throttle.d.ts +103 -0
- package/dist/utils/Throttle.d.ts.map +1 -0
- package/dist/utils/index.d.ts +9 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +899 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/vite/index.d.ts +3 -0
- package/dist/vite/index.d.ts.map +1 -0
- package/dist/vite/index.js +126 -0
- package/dist/vite/index.js.map +1 -0
- package/dist/vite/mergeLocalesPlugin.d.ts +22 -0
- package/dist/vite/mergeLocalesPlugin.d.ts.map +1 -0
- package/package.json +143 -0
|
@@ -0,0 +1,954 @@
|
|
|
1
|
+
import { EventEmitter } from 'pixi.js';
|
|
2
|
+
import merge from 'lodash/merge';
|
|
3
|
+
|
|
4
|
+
// state-machine/StateMachine.ts
|
|
5
|
+
var StateMachine = class extends EventEmitter {
|
|
6
|
+
config;
|
|
7
|
+
context;
|
|
8
|
+
isTransitioning = false;
|
|
9
|
+
resolvedStateCache = /* @__PURE__ */ new Map();
|
|
10
|
+
constructor(config) {
|
|
11
|
+
super();
|
|
12
|
+
this.config = config;
|
|
13
|
+
if (!this.config.modes[this.config.initialMode]) {
|
|
14
|
+
throw new Error(`Initial mode "${this.config.initialMode}" not found in config`);
|
|
15
|
+
}
|
|
16
|
+
const initialMode = this.config.modes[this.config.initialMode];
|
|
17
|
+
if (!initialMode.states[this.config.initialState]) {
|
|
18
|
+
throw new Error(
|
|
19
|
+
`Initial state "${this.config.initialState}" not found in mode "${this.config.initialMode}"`
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
this.context = {
|
|
23
|
+
currentState: this.config.initialState,
|
|
24
|
+
previousState: null,
|
|
25
|
+
currentMode: this.config.initialMode,
|
|
26
|
+
previousMode: null,
|
|
27
|
+
timestamp: Date.now(),
|
|
28
|
+
data: this.config.initialData ?? {},
|
|
29
|
+
metadata: {}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Current state key (e.g., 'IDLE', 'SPIN', 'MATCH')
|
|
34
|
+
*/
|
|
35
|
+
get state() {
|
|
36
|
+
return this.context.currentState;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Current mode key (e.g., 'NORMAL', 'FREESPIN', 'BONUS')
|
|
40
|
+
*/
|
|
41
|
+
get mode() {
|
|
42
|
+
return this.context.currentMode;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Current state data (mutable)
|
|
46
|
+
*/
|
|
47
|
+
get data() {
|
|
48
|
+
return this.context.data;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Get a readonly copy of the current state context
|
|
52
|
+
*
|
|
53
|
+
* @returns Readonly state context with current state, mode, data, and metadata
|
|
54
|
+
*/
|
|
55
|
+
getContext() {
|
|
56
|
+
return { ...this.context };
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Update state data using an updater function
|
|
60
|
+
*
|
|
61
|
+
* @param updater - Function that receives current data and optionally returns new data
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```typescript
|
|
65
|
+
* machine.updateData(data => {
|
|
66
|
+
* data.balance = 1000;
|
|
67
|
+
* data.bet = 10;
|
|
68
|
+
* });
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
updateData(updater) {
|
|
72
|
+
const result = updater(this.context.data);
|
|
73
|
+
if (result !== void 0) {
|
|
74
|
+
this.context.data = result;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
resolveStateDefinition(state, mode) {
|
|
78
|
+
const modeKey = mode ?? this.context.currentMode;
|
|
79
|
+
const cacheKey = `${modeKey}:${state}`;
|
|
80
|
+
if (this.resolvedStateCache.has(cacheKey)) {
|
|
81
|
+
return this.resolvedStateCache.get(cacheKey);
|
|
82
|
+
}
|
|
83
|
+
const currentMode = this.config.modes[modeKey];
|
|
84
|
+
const stateDef = currentMode.states[state];
|
|
85
|
+
if (!stateDef) {
|
|
86
|
+
throw new Error(`State "${state}" not found in mode "${modeKey}"`);
|
|
87
|
+
}
|
|
88
|
+
if (!stateDef.extends) {
|
|
89
|
+
this.resolvedStateCache.set(cacheKey, stateDef);
|
|
90
|
+
return stateDef;
|
|
91
|
+
}
|
|
92
|
+
const chain = [];
|
|
93
|
+
const visited = /* @__PURE__ */ new Set();
|
|
94
|
+
let current = stateDef;
|
|
95
|
+
let currentKey = state;
|
|
96
|
+
while (current) {
|
|
97
|
+
if (visited.has(currentKey)) {
|
|
98
|
+
throw new Error(`Circular extends detected in state "${state}"`);
|
|
99
|
+
}
|
|
100
|
+
visited.add(currentKey);
|
|
101
|
+
chain.unshift(current);
|
|
102
|
+
if (current.extends) {
|
|
103
|
+
const parentKey = current.extends;
|
|
104
|
+
const parent = currentMode.states[parentKey];
|
|
105
|
+
if (!parent) {
|
|
106
|
+
throw new Error(`Parent state "${parentKey}" not found for state "${state}"`);
|
|
107
|
+
}
|
|
108
|
+
current = parent;
|
|
109
|
+
currentKey = parentKey;
|
|
110
|
+
} else {
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
const resolved = merge({}, ...chain);
|
|
115
|
+
delete resolved.extends;
|
|
116
|
+
resolved.guards = stateDef.guards;
|
|
117
|
+
resolved.onEnter = stateDef.onEnter;
|
|
118
|
+
resolved.onExit = stateDef.onExit;
|
|
119
|
+
this.resolvedStateCache.set(cacheKey, resolved);
|
|
120
|
+
return resolved;
|
|
121
|
+
}
|
|
122
|
+
resolveScopeData(scopeConfig) {
|
|
123
|
+
if (!scopeConfig) return {};
|
|
124
|
+
const resolved = {};
|
|
125
|
+
for (const [scopeName, scopeData] of Object.entries(scopeConfig)) {
|
|
126
|
+
resolved[scopeName] = {};
|
|
127
|
+
for (const [componentName, componentData] of Object.entries(scopeData)) {
|
|
128
|
+
resolved[scopeName][componentName] = {};
|
|
129
|
+
for (const [propName, propValue] of Object.entries(componentData)) {
|
|
130
|
+
resolved[scopeName][componentName][propName] = this.resolveValue(propValue);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return resolved;
|
|
135
|
+
}
|
|
136
|
+
resolveValue(value) {
|
|
137
|
+
if (typeof value === "function") {
|
|
138
|
+
return value(this.context);
|
|
139
|
+
}
|
|
140
|
+
return value;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Get resolved scope data for a specific scope
|
|
144
|
+
*
|
|
145
|
+
* @param scopeName - Name of the scope (e.g., 'ui', 'scene', 'audio')
|
|
146
|
+
* @returns Resolved scope data with all resolver functions evaluated
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* ```typescript
|
|
150
|
+
* const uiState = machine.getScope('ui');
|
|
151
|
+
* console.log(uiState.spinButton.enabled); // true
|
|
152
|
+
* ```
|
|
153
|
+
*/
|
|
154
|
+
getScope(scopeName) {
|
|
155
|
+
const resolvedState = this.resolveStateDefinition(this.context.currentState);
|
|
156
|
+
const scopeData = this.resolveScopeData(resolvedState.scopes);
|
|
157
|
+
return scopeData[scopeName] ?? {};
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Get all resolved scope data for the current state
|
|
161
|
+
*
|
|
162
|
+
* @returns Object containing all scopes with resolved data
|
|
163
|
+
*
|
|
164
|
+
* @example
|
|
165
|
+
* ```typescript
|
|
166
|
+
* const scopes = machine.getAllScopes();
|
|
167
|
+
* console.log(scopes.ui); // UI scope data
|
|
168
|
+
* console.log(scopes.scene); // Scene scope data
|
|
169
|
+
* ```
|
|
170
|
+
*/
|
|
171
|
+
getAllScopes() {
|
|
172
|
+
const resolvedState = this.resolveStateDefinition(this.context.currentState);
|
|
173
|
+
return this.resolveScopeData(resolvedState.scopes);
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Transition to a new state within the current mode
|
|
177
|
+
*
|
|
178
|
+
* This is an async operation that:
|
|
179
|
+
* 1. Checks guards (canExit, canEnter)
|
|
180
|
+
* 2. Calls onExit hook of current state
|
|
181
|
+
* 3. Changes the state
|
|
182
|
+
* 4. Calls onEnter hook of target state
|
|
183
|
+
* 5. Emits events (state:exit, state:enter, state:change, scope:update)
|
|
184
|
+
*
|
|
185
|
+
* @param targetState - Target state key to transition to
|
|
186
|
+
* @param options - Transition options
|
|
187
|
+
* @param options.force - Skip guard checks and force transition
|
|
188
|
+
* @param options.silent - Skip event emissions
|
|
189
|
+
* @returns Promise that resolves to true if transition succeeded, false otherwise
|
|
190
|
+
*
|
|
191
|
+
* @example
|
|
192
|
+
* ```typescript
|
|
193
|
+
* // Normal transition
|
|
194
|
+
* await machine.transition('SPIN');
|
|
195
|
+
*
|
|
196
|
+
* // Force transition (skip guards)
|
|
197
|
+
* await machine.transition('SPIN', { force: true });
|
|
198
|
+
*
|
|
199
|
+
* // Silent transition (no events)
|
|
200
|
+
* await machine.transition('SPIN', { silent: true });
|
|
201
|
+
* ```
|
|
202
|
+
*
|
|
203
|
+
* @fires state:exit - When exiting current state
|
|
204
|
+
* @fires state:enter - When entering target state
|
|
205
|
+
* @fires state:change - After state change completes
|
|
206
|
+
* @fires scope:update - For each scope after state change
|
|
207
|
+
* @fires transition:blocked - If guard check fails
|
|
208
|
+
* @fires error - If an error occurs during transition
|
|
209
|
+
*/
|
|
210
|
+
async transition(targetState, options = {}) {
|
|
211
|
+
if (this.isTransitioning && !options.force) {
|
|
212
|
+
console.warn("Transition already in progress");
|
|
213
|
+
return false;
|
|
214
|
+
}
|
|
215
|
+
const fromState = this.context.currentState;
|
|
216
|
+
if (fromState === targetState) {
|
|
217
|
+
return true;
|
|
218
|
+
}
|
|
219
|
+
const currentMode = this.config.modes[this.context.currentMode];
|
|
220
|
+
if (!currentMode.states[targetState]) {
|
|
221
|
+
const error = new Error(
|
|
222
|
+
`State "${targetState}" not found in mode "${this.context.currentMode}"`
|
|
223
|
+
);
|
|
224
|
+
if (this.config.strict) {
|
|
225
|
+
throw error;
|
|
226
|
+
}
|
|
227
|
+
this.emit("error", error, this.context);
|
|
228
|
+
return false;
|
|
229
|
+
}
|
|
230
|
+
if (!options.force) {
|
|
231
|
+
const canTransition = await this.checkGuards(fromState, targetState);
|
|
232
|
+
if (!canTransition.allowed) {
|
|
233
|
+
this.emit(
|
|
234
|
+
"transition:blocked",
|
|
235
|
+
fromState,
|
|
236
|
+
targetState,
|
|
237
|
+
canTransition.reason || "Guard check failed",
|
|
238
|
+
this.context
|
|
239
|
+
);
|
|
240
|
+
return false;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
this.isTransitioning = true;
|
|
244
|
+
try {
|
|
245
|
+
if (!options.silent) {
|
|
246
|
+
this.emit("transition:start", fromState, targetState, this.context);
|
|
247
|
+
}
|
|
248
|
+
const fromStateDef = this.resolveStateDefinition(fromState);
|
|
249
|
+
if (fromStateDef.onExit) {
|
|
250
|
+
await fromStateDef.onExit(this.context);
|
|
251
|
+
}
|
|
252
|
+
if (!options.silent) {
|
|
253
|
+
this.emit("state:exit", fromState, this.context);
|
|
254
|
+
}
|
|
255
|
+
const previousState = this.context.currentState;
|
|
256
|
+
this.context = {
|
|
257
|
+
...this.context,
|
|
258
|
+
currentState: targetState,
|
|
259
|
+
previousState,
|
|
260
|
+
timestamp: Date.now()
|
|
261
|
+
};
|
|
262
|
+
const toStateDef = this.resolveStateDefinition(targetState);
|
|
263
|
+
if (toStateDef.onEnter) {
|
|
264
|
+
await toStateDef.onEnter(this.context);
|
|
265
|
+
}
|
|
266
|
+
if (!options.silent) {
|
|
267
|
+
this.emit("state:enter", targetState, this.context);
|
|
268
|
+
this.emit("state:change", fromState, targetState, this.context);
|
|
269
|
+
const scopes = this.getAllScopes();
|
|
270
|
+
for (const [scopeName, scopeData] of Object.entries(scopes)) {
|
|
271
|
+
this.emit("scope:update", scopeName, scopeData, this.context);
|
|
272
|
+
this.emit(`scope:update:${scopeName}`, scopeData, this.context);
|
|
273
|
+
}
|
|
274
|
+
this.emit("transition:complete", fromState, targetState, this.context);
|
|
275
|
+
}
|
|
276
|
+
return true;
|
|
277
|
+
} catch (error) {
|
|
278
|
+
this.emit("error", error, this.context);
|
|
279
|
+
return false;
|
|
280
|
+
} finally {
|
|
281
|
+
this.isTransitioning = false;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Change to a different mode with an optional initial state
|
|
286
|
+
*
|
|
287
|
+
* This will:
|
|
288
|
+
* 1. Call onExit hook of current mode
|
|
289
|
+
* 2. Clear state resolution cache
|
|
290
|
+
* 3. Change mode and state
|
|
291
|
+
* 4. Call onEnter hook of target mode
|
|
292
|
+
* 5. Call onEnter hook of initial state
|
|
293
|
+
* 6. Emit events
|
|
294
|
+
*
|
|
295
|
+
* @param targetMode - Target mode key to switch to
|
|
296
|
+
* @param initialState - Optional initial state in the target mode (defaults to config.initialState)
|
|
297
|
+
* @returns Promise that resolves to true if mode change succeeded, false otherwise
|
|
298
|
+
*
|
|
299
|
+
* @example
|
|
300
|
+
* ```typescript
|
|
301
|
+
* // Switch to freespin mode
|
|
302
|
+
* await machine.changeMode('FREESPIN', 'IDLE');
|
|
303
|
+
*
|
|
304
|
+
* // Return to normal mode
|
|
305
|
+
* await machine.changeMode('NORMAL', 'IDLE');
|
|
306
|
+
* ```
|
|
307
|
+
*
|
|
308
|
+
* @fires mode:exit - When exiting current mode
|
|
309
|
+
* @fires mode:enter - When entering target mode
|
|
310
|
+
* @fires mode:change - After mode change completes
|
|
311
|
+
* @fires state:enter - When entering initial state
|
|
312
|
+
* @fires scope:update - For each scope after mode change
|
|
313
|
+
*/
|
|
314
|
+
async changeMode(targetMode, initialState) {
|
|
315
|
+
if (this.context.currentMode === targetMode) {
|
|
316
|
+
return true;
|
|
317
|
+
}
|
|
318
|
+
const targetModeDef = this.config.modes[targetMode];
|
|
319
|
+
if (!targetModeDef) {
|
|
320
|
+
const error = new Error(`Mode "${targetMode}" not found`);
|
|
321
|
+
if (this.config.strict) {
|
|
322
|
+
throw error;
|
|
323
|
+
}
|
|
324
|
+
this.emit("error", error, this.context);
|
|
325
|
+
return false;
|
|
326
|
+
}
|
|
327
|
+
const targetState = initialState ?? this.config.initialState;
|
|
328
|
+
if (!targetModeDef.states[targetState]) {
|
|
329
|
+
const error = new Error(`State "${targetState}" not found in mode "${targetMode}"`);
|
|
330
|
+
if (this.config.strict) {
|
|
331
|
+
throw error;
|
|
332
|
+
}
|
|
333
|
+
this.emit("error", error, this.context);
|
|
334
|
+
return false;
|
|
335
|
+
}
|
|
336
|
+
const fromMode = this.context.currentMode;
|
|
337
|
+
const currentModeDef = this.config.modes[fromMode];
|
|
338
|
+
try {
|
|
339
|
+
if (currentModeDef.onExit) {
|
|
340
|
+
await currentModeDef.onExit(this.context);
|
|
341
|
+
}
|
|
342
|
+
this.emit("mode:exit", fromMode, this.context);
|
|
343
|
+
this.resolvedStateCache.clear();
|
|
344
|
+
const previousMode = this.context.currentMode;
|
|
345
|
+
this.context = {
|
|
346
|
+
...this.context,
|
|
347
|
+
currentMode: targetMode,
|
|
348
|
+
previousMode,
|
|
349
|
+
currentState: targetState,
|
|
350
|
+
previousState: this.context.currentState,
|
|
351
|
+
timestamp: Date.now()
|
|
352
|
+
};
|
|
353
|
+
if (targetModeDef.onEnter) {
|
|
354
|
+
await targetModeDef.onEnter(this.context);
|
|
355
|
+
}
|
|
356
|
+
this.emit("mode:enter", targetMode, this.context);
|
|
357
|
+
this.emit("mode:change", fromMode, targetMode, this.context);
|
|
358
|
+
const toStateDef = this.resolveStateDefinition(targetState);
|
|
359
|
+
if (toStateDef.onEnter) {
|
|
360
|
+
await toStateDef.onEnter(this.context);
|
|
361
|
+
}
|
|
362
|
+
this.emit("state:enter", targetState, this.context);
|
|
363
|
+
const scopes = this.getAllScopes();
|
|
364
|
+
for (const [scopeName, scopeData] of Object.entries(scopes)) {
|
|
365
|
+
this.emit("scope:update", scopeName, scopeData, this.context);
|
|
366
|
+
this.emit(`scope:update:${scopeName}`, scopeData, this.context);
|
|
367
|
+
}
|
|
368
|
+
return true;
|
|
369
|
+
} catch (error) {
|
|
370
|
+
this.emit("error", error, this.context);
|
|
371
|
+
return false;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Check if a state exists in the current mode (synchronous, no guard check)
|
|
376
|
+
*
|
|
377
|
+
* @param targetState - State key to check
|
|
378
|
+
* @returns True if state exists in current mode, false otherwise
|
|
379
|
+
*
|
|
380
|
+
* @example
|
|
381
|
+
* ```typescript
|
|
382
|
+
* if (machine.can('SPIN')) {
|
|
383
|
+
* console.log('SPIN state exists');
|
|
384
|
+
* }
|
|
385
|
+
* ```
|
|
386
|
+
*/
|
|
387
|
+
can(targetState) {
|
|
388
|
+
const currentMode = this.config.modes[this.context.currentMode];
|
|
389
|
+
return !!(currentMode == null ? void 0 : currentMode.states[targetState]);
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Check if transition to a state is allowed (async, includes guard check)
|
|
393
|
+
*
|
|
394
|
+
* @param targetState - State key to check
|
|
395
|
+
* @returns Promise that resolves to true if transition is allowed, false otherwise
|
|
396
|
+
*
|
|
397
|
+
* @example
|
|
398
|
+
* ```typescript
|
|
399
|
+
* if (await machine.canAsync('SPIN')) {
|
|
400
|
+
* await machine.transition('SPIN');
|
|
401
|
+
* } else {
|
|
402
|
+
* console.log('Cannot transition to SPIN');
|
|
403
|
+
* }
|
|
404
|
+
* ```
|
|
405
|
+
*/
|
|
406
|
+
async canAsync(targetState) {
|
|
407
|
+
const result = await this.checkGuards(this.context.currentState, targetState);
|
|
408
|
+
return result.allowed;
|
|
409
|
+
}
|
|
410
|
+
async checkGuards(fromState, toState) {
|
|
411
|
+
var _a, _b;
|
|
412
|
+
const fromStateDef = this.resolveStateDefinition(fromState);
|
|
413
|
+
const toStateDef = this.resolveStateDefinition(toState);
|
|
414
|
+
if ((_a = fromStateDef.guards) == null ? void 0 : _a.canExit) {
|
|
415
|
+
const canExit = await fromStateDef.guards.canExit(this.context);
|
|
416
|
+
if (!canExit) {
|
|
417
|
+
return { allowed: false, reason: `Cannot exit state "${fromState}"` };
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
if ((_b = toStateDef.guards) == null ? void 0 : _b.canEnter) {
|
|
421
|
+
const canEnter = await toStateDef.guards.canEnter(this.context);
|
|
422
|
+
if (!canEnter) {
|
|
423
|
+
return { allowed: false, reason: `Cannot enter state "${toState}"` };
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
return { allowed: true };
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* Check if current state matches the given state key
|
|
430
|
+
*
|
|
431
|
+
* @param state - State key to compare
|
|
432
|
+
* @returns True if current state matches, false otherwise
|
|
433
|
+
*
|
|
434
|
+
* @example
|
|
435
|
+
* ```typescript
|
|
436
|
+
* if (machine.is('SPIN')) {
|
|
437
|
+
* console.log('Currently spinning');
|
|
438
|
+
* }
|
|
439
|
+
* ```
|
|
440
|
+
*/
|
|
441
|
+
is(state) {
|
|
442
|
+
return this.context.currentState === state;
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
445
|
+
* Check if current mode matches the given mode key
|
|
446
|
+
*
|
|
447
|
+
* @param mode - Mode key to compare
|
|
448
|
+
* @returns True if current mode matches, false otherwise
|
|
449
|
+
*
|
|
450
|
+
* @example
|
|
451
|
+
* ```typescript
|
|
452
|
+
* if (machine.isMode('FREESPIN')) {
|
|
453
|
+
* console.log('In freespin mode');
|
|
454
|
+
* }
|
|
455
|
+
* ```
|
|
456
|
+
*/
|
|
457
|
+
isMode(mode) {
|
|
458
|
+
return this.context.currentMode === mode;
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* Reset state machine to initial state and mode
|
|
462
|
+
*
|
|
463
|
+
* Clears cache and resets context to initial configuration
|
|
464
|
+
*
|
|
465
|
+
* @example
|
|
466
|
+
* ```typescript
|
|
467
|
+
* machine.reset();
|
|
468
|
+
* console.log(machine.state); // Initial state
|
|
469
|
+
* console.log(machine.mode); // Initial mode
|
|
470
|
+
* ```
|
|
471
|
+
*/
|
|
472
|
+
reset() {
|
|
473
|
+
this.resolvedStateCache.clear();
|
|
474
|
+
this.context = {
|
|
475
|
+
currentState: this.config.initialState,
|
|
476
|
+
previousState: null,
|
|
477
|
+
currentMode: this.config.initialMode,
|
|
478
|
+
previousMode: null,
|
|
479
|
+
timestamp: Date.now(),
|
|
480
|
+
data: this.config.initialData ?? {},
|
|
481
|
+
metadata: {}
|
|
482
|
+
};
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* Destroy state machine and clean up resources
|
|
486
|
+
*
|
|
487
|
+
* Clears cache and removes all event listeners
|
|
488
|
+
*
|
|
489
|
+
* @example
|
|
490
|
+
* ```typescript
|
|
491
|
+
* machine.destroy();
|
|
492
|
+
* ```
|
|
493
|
+
*/
|
|
494
|
+
destroy() {
|
|
495
|
+
this.resolvedStateCache.clear();
|
|
496
|
+
this.removeAllListeners();
|
|
497
|
+
}
|
|
498
|
+
};
|
|
499
|
+
|
|
500
|
+
// state-machine/ConfigBuilder.ts
|
|
501
|
+
var ConfigBuilder = class {
|
|
502
|
+
constructor(initialData) {
|
|
503
|
+
this.config.initialData = initialData;
|
|
504
|
+
}
|
|
505
|
+
config = {
|
|
506
|
+
modes: {}
|
|
507
|
+
};
|
|
508
|
+
currentMode = null;
|
|
509
|
+
currentState = null;
|
|
510
|
+
/**
|
|
511
|
+
* Define a new mode or switch to an existing mode
|
|
512
|
+
*
|
|
513
|
+
* @param name - Mode key (e.g., 'NORMAL', 'FREESPIN', 'BONUS')
|
|
514
|
+
* @returns This builder for chaining
|
|
515
|
+
*/
|
|
516
|
+
mode(name) {
|
|
517
|
+
this.currentMode = name;
|
|
518
|
+
if (!this.config.modes[name]) {
|
|
519
|
+
this.config.modes[name] = { states: {} };
|
|
520
|
+
}
|
|
521
|
+
return this;
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* Define a new state in the current mode
|
|
525
|
+
*
|
|
526
|
+
* @param name - State key (e.g., 'IDLE', 'SPIN', 'MATCH')
|
|
527
|
+
* @returns This builder for chaining
|
|
528
|
+
* @throws Error if mode() hasn't been called first
|
|
529
|
+
*/
|
|
530
|
+
state(name) {
|
|
531
|
+
if (!this.currentMode) {
|
|
532
|
+
throw new Error("Must call mode() before state()");
|
|
533
|
+
}
|
|
534
|
+
this.currentState = name;
|
|
535
|
+
const mode = this.config.modes[this.currentMode];
|
|
536
|
+
if (!mode.states[name]) {
|
|
537
|
+
mode.states[name] = {};
|
|
538
|
+
}
|
|
539
|
+
return this;
|
|
540
|
+
}
|
|
541
|
+
/**
|
|
542
|
+
* Make current state extend from a parent state (inheritance)
|
|
543
|
+
*
|
|
544
|
+
* Child state will inherit all properties from parent state using lodash merge.
|
|
545
|
+
* Child properties override parent properties.
|
|
546
|
+
*
|
|
547
|
+
* @param parentState - Parent state key to extend from
|
|
548
|
+
* @returns This builder for chaining
|
|
549
|
+
* @throws Error if mode() and state() haven't been called first
|
|
550
|
+
*
|
|
551
|
+
* @example
|
|
552
|
+
* ```typescript
|
|
553
|
+
* .state('IDLE')
|
|
554
|
+
* .scope('ui', { spinButton: { enabled: true, icon: 'spin' } })
|
|
555
|
+
*
|
|
556
|
+
* .state('SPIN')
|
|
557
|
+
* .extends('IDLE') // Inherits from IDLE
|
|
558
|
+
* .scope('ui', { spinButton: { icon: 'stop' } }) // Only override icon
|
|
559
|
+
* ```
|
|
560
|
+
*/
|
|
561
|
+
extends(parentState) {
|
|
562
|
+
if (!this.currentMode || !this.currentState) {
|
|
563
|
+
throw new Error("Must call mode() and state() before extends()");
|
|
564
|
+
}
|
|
565
|
+
const state = this.config.modes[this.currentMode].states[this.currentState];
|
|
566
|
+
state.extends = parentState;
|
|
567
|
+
return this;
|
|
568
|
+
}
|
|
569
|
+
/**
|
|
570
|
+
* Define scope configuration for current state
|
|
571
|
+
*
|
|
572
|
+
* Scopes organize related configuration (ui, scene, audio, etc.).
|
|
573
|
+
* Values can be static or resolver functions.
|
|
574
|
+
*
|
|
575
|
+
* @param scopeName - Scope key (e.g., 'ui', 'scene', 'audio')
|
|
576
|
+
* @param scopeData - Scope configuration object
|
|
577
|
+
* @returns This builder for chaining
|
|
578
|
+
* @throws Error if mode() and state() haven't been called first
|
|
579
|
+
*
|
|
580
|
+
* @example
|
|
581
|
+
* ```typescript
|
|
582
|
+
* .scope('ui', {
|
|
583
|
+
* spinButton: {
|
|
584
|
+
* enabled: true,
|
|
585
|
+
* icon: (ctx) => ctx.data.isQuickSpin ? 'quick_spin' : 'spin',
|
|
586
|
+
* },
|
|
587
|
+
* betButtons: { enabled: false },
|
|
588
|
+
* })
|
|
589
|
+
* .scope('scene', {
|
|
590
|
+
* reels: { spinning: true },
|
|
591
|
+
* })
|
|
592
|
+
* ```
|
|
593
|
+
*/
|
|
594
|
+
scope(scopeName, scopeData) {
|
|
595
|
+
if (!this.currentMode || !this.currentState) {
|
|
596
|
+
throw new Error("Must call mode() and state() before scope()");
|
|
597
|
+
}
|
|
598
|
+
const state = this.config.modes[this.currentMode].states[this.currentState];
|
|
599
|
+
if (!state.scopes) {
|
|
600
|
+
state.scopes = {};
|
|
601
|
+
}
|
|
602
|
+
state.scopes[scopeName] = scopeData;
|
|
603
|
+
return this;
|
|
604
|
+
}
|
|
605
|
+
/**
|
|
606
|
+
* Add onEnter lifecycle hook to current state
|
|
607
|
+
*
|
|
608
|
+
* Called when entering this state. Can be async.
|
|
609
|
+
* Transition waits for this hook to complete.
|
|
610
|
+
*
|
|
611
|
+
* @param hook - Lifecycle hook function
|
|
612
|
+
* @returns This builder for chaining
|
|
613
|
+
* @throws Error if mode() and state() haven't been called first
|
|
614
|
+
*
|
|
615
|
+
* @example
|
|
616
|
+
* ```typescript
|
|
617
|
+
* .onEnter(async (ctx) => {
|
|
618
|
+
* ctx.data.balance -= ctx.data.bet;
|
|
619
|
+
* await scene.playAnimation();
|
|
620
|
+
* })
|
|
621
|
+
* ```
|
|
622
|
+
*/
|
|
623
|
+
onEnter(hook) {
|
|
624
|
+
if (!this.currentMode || !this.currentState) {
|
|
625
|
+
throw new Error("Must call mode() and state() before onEnter()");
|
|
626
|
+
}
|
|
627
|
+
const state = this.config.modes[this.currentMode].states[this.currentState];
|
|
628
|
+
state.onEnter = hook;
|
|
629
|
+
return this;
|
|
630
|
+
}
|
|
631
|
+
/**
|
|
632
|
+
* Add onExit lifecycle hook to current state
|
|
633
|
+
*
|
|
634
|
+
* Called when exiting this state. Can be async.
|
|
635
|
+
* Transition waits for this hook to complete.
|
|
636
|
+
*
|
|
637
|
+
* @param hook - Lifecycle hook function
|
|
638
|
+
* @returns This builder for chaining
|
|
639
|
+
* @throws Error if mode() and state() haven't been called first
|
|
640
|
+
*
|
|
641
|
+
* @example
|
|
642
|
+
* ```typescript
|
|
643
|
+
* .onExit(async (ctx) => {
|
|
644
|
+
* await scene.cleanup();
|
|
645
|
+
* })
|
|
646
|
+
* ```
|
|
647
|
+
*/
|
|
648
|
+
onExit(hook) {
|
|
649
|
+
if (!this.currentMode || !this.currentState) {
|
|
650
|
+
throw new Error("Must call mode() and state() before onExit()");
|
|
651
|
+
}
|
|
652
|
+
const state = this.config.modes[this.currentMode].states[this.currentState];
|
|
653
|
+
state.onExit = hook;
|
|
654
|
+
return this;
|
|
655
|
+
}
|
|
656
|
+
/**
|
|
657
|
+
* Add transition guard to current state
|
|
658
|
+
*
|
|
659
|
+
* Guards control whether transitions are allowed.
|
|
660
|
+
* Return false to block transition.
|
|
661
|
+
*
|
|
662
|
+
* @param type - Guard type ('canEnter' or 'canExit')
|
|
663
|
+
* @param guard - Guard function
|
|
664
|
+
* @returns This builder for chaining
|
|
665
|
+
* @throws Error if mode() and state() haven't been called first
|
|
666
|
+
*
|
|
667
|
+
* @example
|
|
668
|
+
* ```typescript
|
|
669
|
+
* .guard('canEnter', (ctx) => ctx.data.balance >= ctx.data.bet)
|
|
670
|
+
* .guard('canExit', (ctx) => !ctx.data.isLocked)
|
|
671
|
+
* ```
|
|
672
|
+
*/
|
|
673
|
+
guard(type, guard) {
|
|
674
|
+
if (!this.currentMode || !this.currentState) {
|
|
675
|
+
throw new Error("Must call mode() and state() before guard()");
|
|
676
|
+
}
|
|
677
|
+
const state = this.config.modes[this.currentMode].states[this.currentState];
|
|
678
|
+
if (!state.guards) {
|
|
679
|
+
state.guards = {};
|
|
680
|
+
}
|
|
681
|
+
state.guards[type] = guard;
|
|
682
|
+
return this;
|
|
683
|
+
}
|
|
684
|
+
/**
|
|
685
|
+
* Add metadata to current state
|
|
686
|
+
*
|
|
687
|
+
* @param data - Metadata object
|
|
688
|
+
* @returns This builder for chaining
|
|
689
|
+
* @throws Error if mode() and state() haven't been called first
|
|
690
|
+
*/
|
|
691
|
+
metadata(data) {
|
|
692
|
+
if (!this.currentMode || !this.currentState) {
|
|
693
|
+
throw new Error("Must call mode() and state() before metadata()");
|
|
694
|
+
}
|
|
695
|
+
const state = this.config.modes[this.currentMode].states[this.currentState];
|
|
696
|
+
state.metadata = { ...state.metadata, ...data };
|
|
697
|
+
return this;
|
|
698
|
+
}
|
|
699
|
+
/**
|
|
700
|
+
* Add lifecycle hook to current mode
|
|
701
|
+
*
|
|
702
|
+
* @param type - Hook type ('onEnter' or 'onExit')
|
|
703
|
+
* @param hook - Lifecycle hook function
|
|
704
|
+
* @returns This builder for chaining
|
|
705
|
+
* @throws Error if mode() hasn't been called first
|
|
706
|
+
*
|
|
707
|
+
* @example
|
|
708
|
+
* ```typescript
|
|
709
|
+
* .mode('FREESPIN')
|
|
710
|
+
* .modeHook('onEnter', (ctx) => {
|
|
711
|
+
* ctx.data.freeSpinsRemaining = 10;
|
|
712
|
+
* })
|
|
713
|
+
* ```
|
|
714
|
+
*/
|
|
715
|
+
modeHook(type, hook) {
|
|
716
|
+
if (!this.currentMode) {
|
|
717
|
+
throw new Error("Must call mode() before modeHook()");
|
|
718
|
+
}
|
|
719
|
+
const mode = this.config.modes[this.currentMode];
|
|
720
|
+
mode[type] = hook;
|
|
721
|
+
return this;
|
|
722
|
+
}
|
|
723
|
+
/**
|
|
724
|
+
* Set initial state and mode
|
|
725
|
+
*
|
|
726
|
+
* @param state - Initial state key
|
|
727
|
+
* @param mode - Initial mode key
|
|
728
|
+
* @returns This builder for chaining
|
|
729
|
+
*
|
|
730
|
+
* @example
|
|
731
|
+
* ```typescript
|
|
732
|
+
* .initial('IDLE', 'NORMAL')
|
|
733
|
+
* ```
|
|
734
|
+
*/
|
|
735
|
+
initial(state, mode) {
|
|
736
|
+
this.config.initialState = state;
|
|
737
|
+
this.config.initialMode = mode;
|
|
738
|
+
return this;
|
|
739
|
+
}
|
|
740
|
+
/**
|
|
741
|
+
* Set initial data for state context
|
|
742
|
+
*
|
|
743
|
+
* @param data - Initial data object
|
|
744
|
+
* @returns This builder for chaining
|
|
745
|
+
*
|
|
746
|
+
* @example
|
|
747
|
+
* ```typescript
|
|
748
|
+
* .initialData({ balance: 1000, bet: 10 })
|
|
749
|
+
* ```
|
|
750
|
+
*/
|
|
751
|
+
initialData(data) {
|
|
752
|
+
this.config.initialData = data;
|
|
753
|
+
return this;
|
|
754
|
+
}
|
|
755
|
+
/**
|
|
756
|
+
* Enable strict mode (throws errors instead of emitting error events)
|
|
757
|
+
*
|
|
758
|
+
* @param value - Enable strict mode (default: true)
|
|
759
|
+
* @returns This builder for chaining
|
|
760
|
+
*/
|
|
761
|
+
strict(value = true) {
|
|
762
|
+
this.config.strict = value;
|
|
763
|
+
return this;
|
|
764
|
+
}
|
|
765
|
+
/**
|
|
766
|
+
* Build and return the final state machine configuration
|
|
767
|
+
*
|
|
768
|
+
* @returns Complete state machine configuration
|
|
769
|
+
* @throws Error if initial state and mode haven't been set
|
|
770
|
+
*
|
|
771
|
+
* @example
|
|
772
|
+
* ```typescript
|
|
773
|
+
* const config = createConfig()
|
|
774
|
+
* .initial('IDLE', 'NORMAL')
|
|
775
|
+
* .mode('NORMAL')
|
|
776
|
+
* .state('IDLE')
|
|
777
|
+
* .build();
|
|
778
|
+
* ```
|
|
779
|
+
*/
|
|
780
|
+
build() {
|
|
781
|
+
if (!this.config.initialState || !this.config.initialMode) {
|
|
782
|
+
throw new Error("Must set initial state and mode");
|
|
783
|
+
}
|
|
784
|
+
return this.config;
|
|
785
|
+
}
|
|
786
|
+
};
|
|
787
|
+
function createConfig(initialData) {
|
|
788
|
+
return new ConfigBuilder(initialData);
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
// state-machine/guards.ts
|
|
792
|
+
var guards = {
|
|
793
|
+
/**
|
|
794
|
+
* Always allow transition
|
|
795
|
+
*
|
|
796
|
+
* @returns Guard that always returns true
|
|
797
|
+
*
|
|
798
|
+
* @example
|
|
799
|
+
* ```typescript
|
|
800
|
+
* .guard('canEnter', guards.always())
|
|
801
|
+
* ```
|
|
802
|
+
*/
|
|
803
|
+
always: () => () => true,
|
|
804
|
+
/**
|
|
805
|
+
* Never allow transition
|
|
806
|
+
*
|
|
807
|
+
* @returns Guard that always returns false
|
|
808
|
+
*
|
|
809
|
+
* @example
|
|
810
|
+
* ```typescript
|
|
811
|
+
* .guard('canEnter', guards.never())
|
|
812
|
+
* ```
|
|
813
|
+
*/
|
|
814
|
+
never: () => () => false,
|
|
815
|
+
/**
|
|
816
|
+
* Check if data key exists and is not null/undefined
|
|
817
|
+
*
|
|
818
|
+
* @template TData - Type of state data
|
|
819
|
+
* @param key - Data key to check
|
|
820
|
+
* @returns Guard that checks if key exists
|
|
821
|
+
*
|
|
822
|
+
* @example
|
|
823
|
+
* ```typescript
|
|
824
|
+
* .guard('canEnter', guards.hasData('balance'))
|
|
825
|
+
* ```
|
|
826
|
+
*/
|
|
827
|
+
hasData: (key) => {
|
|
828
|
+
return (context) => context.data[key] !== void 0 && context.data[key] !== null;
|
|
829
|
+
},
|
|
830
|
+
/**
|
|
831
|
+
* Check if data key equals a specific value
|
|
832
|
+
*
|
|
833
|
+
* @template TData - Type of state data
|
|
834
|
+
* @param key - Data key to check
|
|
835
|
+
* @param value - Value to compare against
|
|
836
|
+
* @returns Guard that checks equality
|
|
837
|
+
*
|
|
838
|
+
* @example
|
|
839
|
+
* ```typescript
|
|
840
|
+
* .guard('canEnter', guards.dataEquals('gameMode', 'normal'))
|
|
841
|
+
* ```
|
|
842
|
+
*/
|
|
843
|
+
dataEquals: (key, value) => {
|
|
844
|
+
return (context) => context.data[key] === value;
|
|
845
|
+
},
|
|
846
|
+
/**
|
|
847
|
+
* Check if data key is greater than a value
|
|
848
|
+
*
|
|
849
|
+
* @template TData - Type of state data
|
|
850
|
+
* @param key - Data key to check (must be number)
|
|
851
|
+
* @param value - Value to compare against
|
|
852
|
+
* @returns Guard that checks if key > value
|
|
853
|
+
*
|
|
854
|
+
* @example
|
|
855
|
+
* ```typescript
|
|
856
|
+
* .guard('canEnter', guards.dataGreaterThan('balance', 0))
|
|
857
|
+
* ```
|
|
858
|
+
*/
|
|
859
|
+
dataGreaterThan: (key, value) => {
|
|
860
|
+
return (context) => context.data[key] > value;
|
|
861
|
+
},
|
|
862
|
+
/**
|
|
863
|
+
* Check if data key is less than a value
|
|
864
|
+
*
|
|
865
|
+
* @template TData - Type of state data
|
|
866
|
+
* @param key - Data key to check (must be number)
|
|
867
|
+
* @param value - Value to compare against
|
|
868
|
+
* @returns Guard that checks if key < value
|
|
869
|
+
*
|
|
870
|
+
* @example
|
|
871
|
+
* ```typescript
|
|
872
|
+
* .guard('canEnter', guards.dataLessThan('lives', 3))
|
|
873
|
+
* ```
|
|
874
|
+
*/
|
|
875
|
+
dataLessThan: (key, value) => {
|
|
876
|
+
return (context) => context.data[key] < value;
|
|
877
|
+
},
|
|
878
|
+
/**
|
|
879
|
+
* Combine multiple guards with AND logic
|
|
880
|
+
*
|
|
881
|
+
* All guards must return true for transition to be allowed.
|
|
882
|
+
*
|
|
883
|
+
* @template TData - Type of state data
|
|
884
|
+
* @param guards - Guards to combine
|
|
885
|
+
* @returns Guard that checks all guards
|
|
886
|
+
*
|
|
887
|
+
* @example
|
|
888
|
+
* ```typescript
|
|
889
|
+
* .guard('canEnter', guards.and(
|
|
890
|
+
* guards.hasData('balance'),
|
|
891
|
+
* guards.dataGreaterThan('balance', 10),
|
|
892
|
+
* (ctx) => ctx.data.isActive
|
|
893
|
+
* ))
|
|
894
|
+
* ```
|
|
895
|
+
*/
|
|
896
|
+
and: (...guards2) => {
|
|
897
|
+
return async (context) => {
|
|
898
|
+
for (const guard of guards2) {
|
|
899
|
+
const result = await guard(context);
|
|
900
|
+
if (!result) return false;
|
|
901
|
+
}
|
|
902
|
+
return true;
|
|
903
|
+
};
|
|
904
|
+
},
|
|
905
|
+
/**
|
|
906
|
+
* Combine multiple guards with OR logic
|
|
907
|
+
*
|
|
908
|
+
* At least one guard must return true for transition to be allowed.
|
|
909
|
+
*
|
|
910
|
+
* @template TData - Type of state data
|
|
911
|
+
* @param guards - Guards to combine
|
|
912
|
+
* @returns Guard that checks any guard
|
|
913
|
+
*
|
|
914
|
+
* @example
|
|
915
|
+
* ```typescript
|
|
916
|
+
* .guard('canEnter', guards.or(
|
|
917
|
+
* guards.dataEquals('mode', 'demo'),
|
|
918
|
+
* guards.dataGreaterThan('balance', 0)
|
|
919
|
+
* ))
|
|
920
|
+
* ```
|
|
921
|
+
*/
|
|
922
|
+
or: (...guards2) => {
|
|
923
|
+
return async (context) => {
|
|
924
|
+
for (const guard of guards2) {
|
|
925
|
+
const result = await guard(context);
|
|
926
|
+
if (result) return true;
|
|
927
|
+
}
|
|
928
|
+
return false;
|
|
929
|
+
};
|
|
930
|
+
},
|
|
931
|
+
/**
|
|
932
|
+
* Negate a guard (NOT logic)
|
|
933
|
+
*
|
|
934
|
+
* Returns opposite of the guard's result.
|
|
935
|
+
*
|
|
936
|
+
* @template TData - Type of state data
|
|
937
|
+
* @param guard - Guard to negate
|
|
938
|
+
* @returns Guard that returns opposite result
|
|
939
|
+
*
|
|
940
|
+
* @example
|
|
941
|
+
* ```typescript
|
|
942
|
+
* .guard('canEnter', guards.not(
|
|
943
|
+
* guards.dataEquals('isLocked', true)
|
|
944
|
+
* ))
|
|
945
|
+
* ```
|
|
946
|
+
*/
|
|
947
|
+
not: (guard) => {
|
|
948
|
+
return async (context) => !await guard(context);
|
|
949
|
+
}
|
|
950
|
+
};
|
|
951
|
+
|
|
952
|
+
export { ConfigBuilder, StateMachine, createConfig, guards };
|
|
953
|
+
//# sourceMappingURL=index.js.map
|
|
954
|
+
//# sourceMappingURL=index.js.map
|