@caperjs/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/LICENSE +22 -0
- package/README.md +62 -0
- package/cli/add.mjs +197 -0
- package/cli/audio/cc.mjs +128 -0
- package/cli/audio/index.mjs +42 -0
- package/cli/audio/utils.mjs +56 -0
- package/cli/create-caper.mjs +8 -0
- package/cli/create.mjs +351 -0
- package/cli/install-peerdeps.mjs +57 -0
- package/cli/update.mjs +9 -0
- package/cli/utils.mjs +81 -0
- package/cli/vite.mjs +55 -0
- package/cli/voiceover/generateVoiceoverCSV.mjs +158 -0
- package/cli/voiceover/index.mjs +1 -0
- package/cli.mjs +157 -0
- package/client.d.ts +7 -0
- package/config/assetpack.mjs +212 -0
- package/config/tsconfig.base.json +28 -0
- package/config/vite.mjs +2464 -0
- package/extras/css/accessibility.css +9 -0
- package/extras/css/fullscreen.css +28 -0
- package/extras/css/loader.css +67 -0
- package/extras/llms.txt +1602 -0
- package/lib/CaptionsPlugin-Dc8fIrjy.js +277 -0
- package/lib/CaptionsPlugin-Dc8fIrjy.js.map +1 -0
- package/lib/DataAdapter-BY2114sp.js +84 -0
- package/lib/DataAdapter-BY2114sp.js.map +1 -0
- package/lib/DebugRenderer-BJMLILqI.js +1385 -0
- package/lib/DebugRenderer-BJMLILqI.js.map +1 -0
- package/lib/DevToolsPlugin-wQ5rOkn0.js +31 -0
- package/lib/DevToolsPlugin-wQ5rOkn0.js.map +1 -0
- package/lib/GSAPPlugin-DHhSZKv8.js +350 -0
- package/lib/GSAPPlugin-DHhSZKv8.js.map +1 -0
- package/lib/LayoutPlugin-B-DF9SYM.js +1271 -0
- package/lib/LayoutPlugin-B-DF9SYM.js.map +1 -0
- package/lib/SpinePlugin-Dz_3dljz.js +6077 -0
- package/lib/SpinePlugin-Dz_3dljz.js.map +1 -0
- package/lib/StatsPlugin-Cg82JMBD.js +70 -0
- package/lib/StatsPlugin-Cg82JMBD.js.map +1 -0
- package/lib/VoiceOverPlugin-BR3ImT8C.js +114 -0
- package/lib/VoiceOverPlugin-BR3ImT8C.js.map +1 -0
- package/lib/caper.mjs +1233 -0
- package/lib/caper.mjs.map +1 -0
- package/lib/core/Application.d.ts +268 -0
- package/lib/core/Application.d.ts.map +1 -0
- package/lib/core/config.d.ts +39 -0
- package/lib/core/config.d.ts.map +1 -0
- package/lib/core/create.d.ts +41 -0
- package/lib/core/create.d.ts.map +1 -0
- package/lib/core/globals.d.ts +51 -0
- package/lib/core/globals.d.ts.map +1 -0
- package/lib/core/index.d.ts +7 -0
- package/lib/core/index.d.ts.map +1 -0
- package/lib/core/interfaces/IApplication.d.ts +566 -0
- package/lib/core/interfaces/IApplication.d.ts.map +1 -0
- package/lib/core/interfaces/IApplicationOptions.d.ts +65 -0
- package/lib/core/interfaces/IApplicationOptions.d.ts.map +1 -0
- package/lib/core/interfaces/ICoreFunctions.d.ts +49 -0
- package/lib/core/interfaces/ICoreFunctions.d.ts.map +1 -0
- package/lib/core/interfaces/ICoreSignals.d.ts +57 -0
- package/lib/core/interfaces/ICoreSignals.d.ts.map +1 -0
- package/lib/core/interfaces/IStorageCapability.d.ts +20 -0
- package/lib/core/interfaces/IStorageCapability.d.ts.map +1 -0
- package/lib/core/interfaces/IStorageCapability.test.d.ts +2 -0
- package/lib/core/interfaces/IStorageCapability.test.d.ts.map +1 -0
- package/lib/core/interfaces/index.d.ts +7 -0
- package/lib/core/interfaces/index.d.ts.map +1 -0
- package/lib/core/registries.d.ts +8 -0
- package/lib/core/registries.d.ts.map +1 -0
- package/lib/core/types.d.ts +12 -0
- package/lib/core/types.d.ts.map +1 -0
- package/lib/display/AnimatedSprite.d.ts +40 -0
- package/lib/display/AnimatedSprite.d.ts.map +1 -0
- package/lib/display/Camera.d.ts +102 -0
- package/lib/display/Camera.d.ts.map +1 -0
- package/lib/display/Container.d.ts +115 -0
- package/lib/display/Container.d.ts.map +1 -0
- package/lib/display/Entity.d.ts +46 -0
- package/lib/display/Entity.d.ts.map +1 -0
- package/lib/display/ParticleContainer.d.ts +58 -0
- package/lib/display/ParticleContainer.d.ts.map +1 -0
- package/lib/display/Scene.d.ts +250 -0
- package/lib/display/Scene.d.ts.map +1 -0
- package/lib/display/SceneTransition.d.ts +41 -0
- package/lib/display/SceneTransition.d.ts.map +1 -0
- package/lib/display/SpineAnimation.d.ts +76 -0
- package/lib/display/SpineAnimation.d.ts.map +1 -0
- package/lib/display/Svg.d.ts +5 -0
- package/lib/display/Svg.d.ts.map +1 -0
- package/lib/display/index.d.ts +10 -0
- package/lib/display/index.d.ts.map +1 -0
- package/lib/env.d.ts +6 -0
- package/lib/hello.d.ts +2 -0
- package/lib/hello.d.ts.map +1 -0
- package/lib/index.d.ts +15 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/mixins/animated.d.ts +53 -0
- package/lib/mixins/animated.d.ts.map +1 -0
- package/lib/mixins/factory/Factory.d.ts +8 -0
- package/lib/mixins/factory/Factory.d.ts.map +1 -0
- package/lib/mixins/factory/const.d.ts +67 -0
- package/lib/mixins/factory/const.d.ts.map +1 -0
- package/lib/mixins/factory/index.d.ts +8 -0
- package/lib/mixins/factory/index.d.ts.map +1 -0
- package/lib/mixins/factory/methods.d.ts +3 -0
- package/lib/mixins/factory/methods.d.ts.map +1 -0
- package/lib/mixins/factory/props.d.ts +160 -0
- package/lib/mixins/factory/props.d.ts.map +1 -0
- package/lib/mixins/factory/registry.d.ts +27 -0
- package/lib/mixins/factory/registry.d.ts.map +1 -0
- package/lib/mixins/factory/registry.test.d.ts +2 -0
- package/lib/mixins/factory/registry.test.d.ts.map +1 -0
- package/lib/mixins/factory/schema.d.ts +71 -0
- package/lib/mixins/factory/schema.d.ts.map +1 -0
- package/lib/mixins/factory/ui-registry.d.ts +20 -0
- package/lib/mixins/factory/ui-registry.d.ts.map +1 -0
- package/lib/mixins/factory/utils.d.ts +11 -0
- package/lib/mixins/factory/utils.d.ts.map +1 -0
- package/lib/mixins/focus.d.ts +15 -0
- package/lib/mixins/focus.d.ts.map +1 -0
- package/lib/mixins/index.d.ts +6 -0
- package/lib/mixins/index.d.ts.map +1 -0
- package/lib/mixins/interaction.d.ts +20 -0
- package/lib/mixins/interaction.d.ts.map +1 -0
- package/lib/mixins/signals.d.ts +15 -0
- package/lib/mixins/signals.d.ts.map +1 -0
- package/lib/plugins/AssetsPlugin.d.ts +79 -0
- package/lib/plugins/AssetsPlugin.d.ts.map +1 -0
- package/lib/plugins/DataAdapter.d.ts +95 -0
- package/lib/plugins/DataAdapter.d.ts.map +1 -0
- package/lib/plugins/DevToolsPlugin.d.ts +97 -0
- package/lib/plugins/DevToolsPlugin.d.ts.map +1 -0
- package/lib/plugins/FullScreenPlugin.d.ts +240 -0
- package/lib/plugins/FullScreenPlugin.d.ts.map +1 -0
- package/lib/plugins/GSAPPlugin.d.ts +634 -0
- package/lib/plugins/GSAPPlugin.d.ts.map +1 -0
- package/lib/plugins/KeyboardPlugin.d.ts +53 -0
- package/lib/plugins/KeyboardPlugin.d.ts.map +1 -0
- package/lib/plugins/LayoutPlugin.d.ts +100 -0
- package/lib/plugins/LayoutPlugin.d.ts.map +1 -0
- package/lib/plugins/LookupPlugin.d.ts +223 -0
- package/lib/plugins/LookupPlugin.d.ts.map +1 -0
- package/lib/plugins/Plugin.d.ts +132 -0
- package/lib/plugins/Plugin.d.ts.map +1 -0
- package/lib/plugins/Plugin.test.d.ts +2 -0
- package/lib/plugins/Plugin.test.d.ts.map +1 -0
- package/lib/plugins/PopupManagerPlugin.d.ts +108 -0
- package/lib/plugins/PopupManagerPlugin.d.ts.map +1 -0
- package/lib/plugins/ResizerPlugin.d.ts +62 -0
- package/lib/plugins/ResizerPlugin.d.ts.map +1 -0
- package/lib/plugins/SceneManagerPlugin.d.ts +122 -0
- package/lib/plugins/SceneManagerPlugin.d.ts.map +1 -0
- package/lib/plugins/StatsPlugin.d.ts +8 -0
- package/lib/plugins/StatsPlugin.d.ts.map +1 -0
- package/lib/plugins/TimerPlugin.d.ts +401 -0
- package/lib/plugins/TimerPlugin.d.ts.map +1 -0
- package/lib/plugins/WebEventsPlugin.d.ts +60 -0
- package/lib/plugins/WebEventsPlugin.d.ts.map +1 -0
- package/lib/plugins/actions/ActionsPlugin.d.ts +39 -0
- package/lib/plugins/actions/ActionsPlugin.d.ts.map +1 -0
- package/lib/plugins/actions/constants.d.ts +52 -0
- package/lib/plugins/actions/constants.d.ts.map +1 -0
- package/lib/plugins/actions/index.d.ts +5 -0
- package/lib/plugins/actions/index.d.ts.map +1 -0
- package/lib/plugins/actions/methods.d.ts +11 -0
- package/lib/plugins/actions/methods.d.ts.map +1 -0
- package/lib/plugins/actions/types.d.ts +25 -0
- package/lib/plugins/actions/types.d.ts.map +1 -0
- package/lib/plugins/audio/AudioChannel.d.ts +46 -0
- package/lib/plugins/audio/AudioChannel.d.ts.map +1 -0
- package/lib/plugins/audio/AudioChannel.test.d.ts +2 -0
- package/lib/plugins/audio/AudioChannel.test.d.ts.map +1 -0
- package/lib/plugins/audio/AudioInstance.d.ts +79 -0
- package/lib/plugins/audio/AudioInstance.d.ts.map +1 -0
- package/lib/plugins/audio/AudioManagerPlugin.d.ts +323 -0
- package/lib/plugins/audio/AudioManagerPlugin.d.ts.map +1 -0
- package/lib/plugins/audio/VoiceOverPlugin.d.ts +69 -0
- package/lib/plugins/audio/VoiceOverPlugin.d.ts.map +1 -0
- package/lib/plugins/audio/index.d.ts +4 -0
- package/lib/plugins/audio/index.d.ts.map +1 -0
- package/lib/plugins/breakpoints/BreakpointPlugin.d.ts +109 -0
- package/lib/plugins/breakpoints/BreakpointPlugin.d.ts.map +1 -0
- package/lib/plugins/breakpoints/BreakpointPlugin.test.d.ts +2 -0
- package/lib/plugins/breakpoints/BreakpointPlugin.test.d.ts.map +1 -0
- package/lib/plugins/breakpoints/evaluate.d.ts +53 -0
- package/lib/plugins/breakpoints/evaluate.d.ts.map +1 -0
- package/lib/plugins/breakpoints/evaluate.test.d.ts +2 -0
- package/lib/plugins/breakpoints/evaluate.test.d.ts.map +1 -0
- package/lib/plugins/breakpoints/index.d.ts +4 -0
- package/lib/plugins/breakpoints/index.d.ts.map +1 -0
- package/lib/plugins/breakpoints/methods.d.ts +23 -0
- package/lib/plugins/breakpoints/methods.d.ts.map +1 -0
- package/lib/plugins/breakpoints/types.d.ts +70 -0
- package/lib/plugins/breakpoints/types.d.ts.map +1 -0
- package/lib/plugins/captions/CaptionsPlugin.d.ts +150 -0
- package/lib/plugins/captions/CaptionsPlugin.d.ts.map +1 -0
- package/lib/plugins/captions/CaptionsRenderer.d.ts +37 -0
- package/lib/plugins/captions/CaptionsRenderer.d.ts.map +1 -0
- package/lib/plugins/captions/index.d.ts +3 -0
- package/lib/plugins/captions/index.d.ts.map +1 -0
- package/lib/plugins/defaults.d.ts +4 -0
- package/lib/plugins/defaults.d.ts.map +1 -0
- package/lib/plugins/focus/FocusManagerPlugin.d.ts +148 -0
- package/lib/plugins/focus/FocusManagerPlugin.d.ts.map +1 -0
- package/lib/plugins/focus/FocusOutliner.d.ts +32 -0
- package/lib/plugins/focus/FocusOutliner.d.ts.map +1 -0
- package/lib/plugins/focus/index.d.ts +3 -0
- package/lib/plugins/focus/index.d.ts.map +1 -0
- package/lib/plugins/i18nPlugin.d.ts +128 -0
- package/lib/plugins/i18nPlugin.d.ts.map +1 -0
- package/lib/plugins/index.d.ts +18 -0
- package/lib/plugins/index.d.ts.map +1 -0
- package/lib/plugins/input/AbstractControls.d.ts +8 -0
- package/lib/plugins/input/AbstractControls.d.ts.map +1 -0
- package/lib/plugins/input/Controls.d.ts +16 -0
- package/lib/plugins/input/Controls.d.ts.map +1 -0
- package/lib/plugins/input/InputPlugin.d.ts +52 -0
- package/lib/plugins/input/InputPlugin.d.ts.map +1 -0
- package/lib/plugins/input/constants.d.ts +8 -0
- package/lib/plugins/input/constants.d.ts.map +1 -0
- package/lib/plugins/input/index.d.ts +10 -0
- package/lib/plugins/input/index.d.ts.map +1 -0
- package/lib/plugins/input/interfaces.d.ts +30 -0
- package/lib/plugins/input/interfaces.d.ts.map +1 -0
- package/lib/plugins/input/keyboard/KeyboardContols.d.ts +28 -0
- package/lib/plugins/input/keyboard/KeyboardContols.d.ts.map +1 -0
- package/lib/plugins/input/keyboard/index.d.ts +3 -0
- package/lib/plugins/input/keyboard/index.d.ts.map +1 -0
- package/lib/plugins/input/keyboard/interfaces.d.ts +18 -0
- package/lib/plugins/input/keyboard/interfaces.d.ts.map +1 -0
- package/lib/plugins/input/methods.d.ts +4 -0
- package/lib/plugins/input/methods.d.ts.map +1 -0
- package/lib/plugins/input/touch/TouchControls.d.ts +35 -0
- package/lib/plugins/input/touch/TouchControls.d.ts.map +1 -0
- package/lib/plugins/input/touch/constants.d.ts +14 -0
- package/lib/plugins/input/touch/constants.d.ts.map +1 -0
- package/lib/plugins/input/touch/index.d.ts +4 -0
- package/lib/plugins/input/touch/index.d.ts.map +1 -0
- package/lib/plugins/input/touch/interfaces.d.ts +15 -0
- package/lib/plugins/input/touch/interfaces.d.ts.map +1 -0
- package/lib/plugins/input/types.d.ts +32 -0
- package/lib/plugins/input/types.d.ts.map +1 -0
- package/lib/plugins/input/utils.d.ts +23 -0
- package/lib/plugins/input/utils.d.ts.map +1 -0
- package/lib/plugins/spine/SpinePlugin.d.ts +6 -0
- package/lib/plugins/spine/SpinePlugin.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/BatchableSpineSlot.d.ts +31 -0
- package/lib/plugins/spine/pixi-spine/BatchableSpineSlot.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/Spine.d.ts +211 -0
- package/lib/plugins/spine/pixi-spine/Spine.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/SpineDebugRenderer.d.ts +81 -0
- package/lib/plugins/spine/pixi-spine/SpineDebugRenderer.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/SpinePipe.d.ts +21 -0
- package/lib/plugins/spine/pixi-spine/SpinePipe.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/SpineTexture.d.ts +16 -0
- package/lib/plugins/spine/pixi-spine/SpineTexture.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/assets/atlasLoader.d.ts +10 -0
- package/lib/plugins/spine/pixi-spine/assets/atlasLoader.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/assets/skeletonLoader.d.ts +6 -0
- package/lib/plugins/spine/pixi-spine/assets/skeletonLoader.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/darktint/DarkTintBatchGeometry.d.ts +5 -0
- package/lib/plugins/spine/pixi-spine/darktint/DarkTintBatchGeometry.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/darktint/DarkTintBatcher.d.ts +22 -0
- package/lib/plugins/spine/pixi-spine/darktint/DarkTintBatcher.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/darktint/DarkTintShader.d.ts +5 -0
- package/lib/plugins/spine/pixi-spine/darktint/DarkTintShader.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/darktint/darkTintBit.d.ts +51 -0
- package/lib/plugins/spine/pixi-spine/darktint/darkTintBit.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/index.d.ts +9 -0
- package/lib/plugins/spine/pixi-spine/index.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/require-shim.d.ts +34 -0
- package/lib/plugins/spine/pixi-spine/require-shim.d.ts.map +1 -0
- package/lib/registries-CYCaYKZI.js +6885 -0
- package/lib/registries-CYCaYKZI.js.map +1 -0
- package/lib/signals/Signal.d.ts +16 -0
- package/lib/signals/Signal.d.ts.map +1 -0
- package/lib/signals/Signal.test.d.ts +2 -0
- package/lib/signals/Signal.test.d.ts.map +1 -0
- package/lib/signals/index.d.ts +3 -0
- package/lib/signals/index.d.ts.map +1 -0
- package/lib/store/Store.d.ts +56 -0
- package/lib/store/Store.d.ts.map +1 -0
- package/lib/store/Store.test.d.ts +2 -0
- package/lib/store/Store.test.d.ts.map +1 -0
- package/lib/store/index.d.ts +2 -0
- package/lib/store/index.d.ts.map +1 -0
- package/lib/types/framework.d.ts +46 -0
- package/lib/types/gsap.d.ts +23 -0
- package/lib/ui/Button.d.ts +162 -0
- package/lib/ui/Button.d.ts.map +1 -0
- package/lib/ui/FlexContainer.d.ts +109 -0
- package/lib/ui/FlexContainer.d.ts.map +1 -0
- package/lib/ui/Input.d.ts +384 -0
- package/lib/ui/Input.d.ts.map +1 -0
- package/lib/ui/Joystick.d.ts +61 -0
- package/lib/ui/Joystick.d.ts.map +1 -0
- package/lib/ui/Popup.d.ts +109 -0
- package/lib/ui/Popup.d.ts.map +1 -0
- package/lib/ui/Toast.d.ts +131 -0
- package/lib/ui/Toast.d.ts.map +1 -0
- package/lib/ui/Toaster.d.ts +188 -0
- package/lib/ui/Toaster.d.ts.map +1 -0
- package/lib/ui/UICanvas.d.ts +155 -0
- package/lib/ui/UICanvas.d.ts.map +1 -0
- package/lib/ui/index.d.ts +9 -0
- package/lib/ui/index.d.ts.map +1 -0
- package/lib/utils/array.d.ts +11 -0
- package/lib/utils/array.d.ts.map +1 -0
- package/lib/utils/bind.d.ts +21 -0
- package/lib/utils/bind.d.ts.map +1 -0
- package/lib/utils/canvas.d.ts +2 -0
- package/lib/utils/canvas.d.ts.map +1 -0
- package/lib/utils/color.d.ts +66 -0
- package/lib/utils/color.d.ts.map +1 -0
- package/lib/utils/console/Logger.d.ts +15 -0
- package/lib/utils/console/Logger.d.ts.map +1 -0
- package/lib/utils/console/index.d.ts +2 -0
- package/lib/utils/console/index.d.ts.map +1 -0
- package/lib/utils/debug.d.ts +34 -0
- package/lib/utils/debug.d.ts.map +1 -0
- package/lib/utils/define.d.ts +100 -0
- package/lib/utils/define.d.ts.map +1 -0
- package/lib/utils/env.d.ts +4 -0
- package/lib/utils/env.d.ts.map +1 -0
- package/lib/utils/events.d.ts +12 -0
- package/lib/utils/events.d.ts.map +1 -0
- package/lib/utils/framework.d.ts +12 -0
- package/lib/utils/framework.d.ts.map +1 -0
- package/lib/utils/index.d.ts +28 -0
- package/lib/utils/index.d.ts.map +1 -0
- package/lib/utils/map.d.ts +31 -0
- package/lib/utils/map.d.ts.map +1 -0
- package/lib/utils/math.d.ts +15 -0
- package/lib/utils/math.d.ts.map +1 -0
- package/lib/utils/misc.d.ts +13 -0
- package/lib/utils/misc.d.ts.map +1 -0
- package/lib/utils/number.d.ts +2 -0
- package/lib/utils/number.d.ts.map +1 -0
- package/lib/utils/object.d.ts +21 -0
- package/lib/utils/object.d.ts.map +1 -0
- package/lib/utils/padding.d.ts +4 -0
- package/lib/utils/padding.d.ts.map +1 -0
- package/lib/utils/pixi.d.ts +42 -0
- package/lib/utils/pixi.d.ts.map +1 -0
- package/lib/utils/platform.d.ts +20 -0
- package/lib/utils/platform.d.ts.map +1 -0
- package/lib/utils/point.d.ts +66 -0
- package/lib/utils/point.d.ts.map +1 -0
- package/lib/utils/promise/Queue.d.ts +60 -0
- package/lib/utils/promise/Queue.d.ts.map +1 -0
- package/lib/utils/promise/functions.d.ts +14 -0
- package/lib/utils/promise/functions.d.ts.map +1 -0
- package/lib/utils/promise/index.d.ts +3 -0
- package/lib/utils/promise/index.d.ts.map +1 -0
- package/lib/utils/random.d.ts +42 -0
- package/lib/utils/random.d.ts.map +1 -0
- package/lib/utils/rect.d.ts +26 -0
- package/lib/utils/rect.d.ts.map +1 -0
- package/lib/utils/set.d.ts +15 -0
- package/lib/utils/set.d.ts.map +1 -0
- package/lib/utils/string.d.ts +3 -0
- package/lib/utils/string.d.ts.map +1 -0
- package/lib/utils/text.d.ts +3 -0
- package/lib/utils/text.d.ts.map +1 -0
- package/lib/utils/typefilters.d.ts +4 -0
- package/lib/utils/typefilters.d.ts.map +1 -0
- package/lib/utils/types.d.ts +209 -0
- package/lib/utils/types.d.ts.map +1 -0
- package/lib/utils/vite.d.ts +25 -0
- package/lib/utils/vite.d.ts.map +1 -0
- package/lib/utils/web.d.ts +3 -0
- package/lib/utils/web.d.ts.map +1 -0
- package/lib/version.d.ts +3 -0
- package/lib/version.d.ts.map +1 -0
- package/lib/webgl-check.d.ts +2 -0
- package/lib/webgl-check.d.ts.map +1 -0
- package/package.json +138 -0
- package/src/core/Application.ts +1091 -0
- package/src/core/config.ts +168 -0
- package/src/core/create.ts +186 -0
- package/src/core/globals.ts +299 -0
- package/src/core/index.ts +6 -0
- package/src/core/interfaces/IApplication.ts +628 -0
- package/src/core/interfaces/IApplicationOptions.ts +81 -0
- package/src/core/interfaces/ICoreFunctions.ts +86 -0
- package/src/core/interfaces/ICoreSignals.ts +77 -0
- package/src/core/interfaces/IStorageCapability.test.ts +27 -0
- package/src/core/interfaces/IStorageCapability.ts +26 -0
- package/src/core/interfaces/index.ts +6 -0
- package/src/core/registries.ts +7 -0
- package/src/core/types.ts +13 -0
- package/src/display/AnimatedSprite.ts +227 -0
- package/src/display/Camera.ts +371 -0
- package/src/display/Container.ts +240 -0
- package/src/display/Entity.ts +50 -0
- package/src/display/ParticleContainer.ts +107 -0
- package/src/display/Scene.ts +305 -0
- package/src/display/SceneTransition.ts +108 -0
- package/src/display/SpineAnimation.ts +170 -0
- package/src/display/Svg.ts +9 -0
- package/src/display/index.ts +11 -0
- package/src/env.d.ts +6 -0
- package/src/hello.ts +20 -0
- package/src/index.ts +17 -0
- package/src/mixins/animated.ts +340 -0
- package/src/mixins/factory/Factory.ts +24 -0
- package/src/mixins/factory/const.ts +363 -0
- package/src/mixins/factory/index.ts +7 -0
- package/src/mixins/factory/methods.ts +21 -0
- package/src/mixins/factory/props.ts +207 -0
- package/src/mixins/factory/registry.test.ts +83 -0
- package/src/mixins/factory/registry.ts +61 -0
- package/src/mixins/factory/schema.ts +153 -0
- package/src/mixins/factory/ui-registry.ts +54 -0
- package/src/mixins/factory/utils.ts +130 -0
- package/src/mixins/focus.ts +124 -0
- package/src/mixins/index.ts +5 -0
- package/src/mixins/interaction.ts +74 -0
- package/src/mixins/signals.ts +49 -0
- package/src/plugins/AssetsPlugin.ts +407 -0
- package/src/plugins/DataAdapter.ts +259 -0
- package/src/plugins/DevToolsPlugin.ts +103 -0
- package/src/plugins/FullScreenPlugin.ts +359 -0
- package/src/plugins/GSAPPlugin.ts +811 -0
- package/src/plugins/KeyboardPlugin.ts +160 -0
- package/src/plugins/LayoutPlugin.ts +127 -0
- package/src/plugins/LookupPlugin.ts +308 -0
- package/src/plugins/Plugin.test.ts +73 -0
- package/src/plugins/Plugin.ts +200 -0
- package/src/plugins/PopupManagerPlugin.ts +263 -0
- package/src/plugins/ResizerPlugin.ts +220 -0
- package/src/plugins/SceneManagerPlugin.ts +669 -0
- package/src/plugins/StatsPlugin.ts +24 -0
- package/src/plugins/TimerPlugin.ts +841 -0
- package/src/plugins/WebEventsPlugin.ts +132 -0
- package/src/plugins/actions/ActionsPlugin.ts +113 -0
- package/src/plugins/actions/constants.ts +45 -0
- package/src/plugins/actions/index.ts +4 -0
- package/src/plugins/actions/methods.ts +28 -0
- package/src/plugins/actions/types.ts +47 -0
- package/src/plugins/audio/AudioChannel.test.ts +101 -0
- package/src/plugins/audio/AudioChannel.ts +164 -0
- package/src/plugins/audio/AudioInstance.ts +228 -0
- package/src/plugins/audio/AudioManagerPlugin.ts +903 -0
- package/src/plugins/audio/VoiceOverPlugin.ts +354 -0
- package/src/plugins/audio/index.ts +3 -0
- package/src/plugins/breakpoints/BreakpointPlugin.test.ts +228 -0
- package/src/plugins/breakpoints/BreakpointPlugin.ts +293 -0
- package/src/plugins/breakpoints/evaluate.test.ts +239 -0
- package/src/plugins/breakpoints/evaluate.ts +201 -0
- package/src/plugins/breakpoints/index.ts +3 -0
- package/src/plugins/breakpoints/methods.ts +22 -0
- package/src/plugins/breakpoints/types.ts +86 -0
- package/src/plugins/captions/CaptionsPlugin.ts +468 -0
- package/src/plugins/captions/CaptionsRenderer.ts +184 -0
- package/src/plugins/captions/font/Sans.fnt +116 -0
- package/src/plugins/captions/font/Sans.png +0 -0
- package/src/plugins/captions/index.ts +2 -0
- package/src/plugins/defaults.ts +95 -0
- package/src/plugins/focus/FocusManagerPlugin.ts +773 -0
- package/src/plugins/focus/FocusOutliner.ts +111 -0
- package/src/plugins/focus/index.ts +2 -0
- package/src/plugins/i18nPlugin.ts +284 -0
- package/src/plugins/index.ts +17 -0
- package/src/plugins/input/AbstractControls.ts +15 -0
- package/src/plugins/input/Controls.ts +55 -0
- package/src/plugins/input/InputPlugin.ts +168 -0
- package/src/plugins/input/constants.ts +12 -0
- package/src/plugins/input/index.ts +9 -0
- package/src/plugins/input/interfaces.ts +37 -0
- package/src/plugins/input/keyboard/KeyboardContols.ts +182 -0
- package/src/plugins/input/keyboard/index.ts +2 -0
- package/src/plugins/input/keyboard/interfaces.ts +21 -0
- package/src/plugins/input/methods.ts +9 -0
- package/src/plugins/input/touch/TouchControls.ts +237 -0
- package/src/plugins/input/touch/constants.ts +34 -0
- package/src/plugins/input/touch/index.ts +3 -0
- package/src/plugins/input/touch/interfaces.ts +15 -0
- package/src/plugins/input/types.ts +41 -0
- package/src/plugins/input/utils.ts +10 -0
- package/src/plugins/spine/SpinePlugin.ts +14 -0
- package/src/plugins/spine/pixi-spine/BatchableSpineSlot.ts +138 -0
- package/src/plugins/spine/pixi-spine/Spine.ts +897 -0
- package/src/plugins/spine/pixi-spine/SpineDebugRenderer.ts +615 -0
- package/src/plugins/spine/pixi-spine/SpinePipe.ts +197 -0
- package/src/plugins/spine/pixi-spine/SpineTexture.ts +143 -0
- package/src/plugins/spine/pixi-spine/assets/atlasLoader.ts +156 -0
- package/src/plugins/spine/pixi-spine/assets/skeletonLoader.ts +80 -0
- package/src/plugins/spine/pixi-spine/darktint/DarkTintBatchGeometry.ts +92 -0
- package/src/plugins/spine/pixi-spine/darktint/DarkTintBatcher.ts +186 -0
- package/src/plugins/spine/pixi-spine/darktint/DarkTintShader.ts +74 -0
- package/src/plugins/spine/pixi-spine/darktint/darkTintBit.ts +77 -0
- package/src/plugins/spine/pixi-spine/index.ts +43 -0
- package/src/plugins/spine/pixi-spine/require-shim.ts +43 -0
- package/src/signals/Signal.test.ts +54 -0
- package/src/signals/Signal.ts +68 -0
- package/src/signals/index.ts +10 -0
- package/src/store/Store.test.ts +146 -0
- package/src/store/Store.ts +192 -0
- package/src/store/index.ts +1 -0
- package/src/types/framework.d.ts +47 -0
- package/src/types/gsap.d.ts +26 -0
- package/src/ui/Button.ts +454 -0
- package/src/ui/FlexContainer.ts +526 -0
- package/src/ui/Input.ts +1274 -0
- package/src/ui/Joystick.ts +288 -0
- package/src/ui/Popup.ts +242 -0
- package/src/ui/Toast.ts +399 -0
- package/src/ui/Toaster.ts +409 -0
- package/src/ui/UICanvas.ts +812 -0
- package/src/ui/index.ts +8 -0
- package/src/utils/array.ts +24 -0
- package/src/utils/bind.ts +79 -0
- package/src/utils/canvas.ts +26 -0
- package/src/utils/color.ts +126 -0
- package/src/utils/console/Logger.ts +86 -0
- package/src/utils/console/index.ts +1 -0
- package/src/utils/debug.ts +69 -0
- package/src/utils/define.ts +120 -0
- package/src/utils/env.ts +3 -0
- package/src/utils/events.ts +10 -0
- package/src/utils/framework.ts +45 -0
- package/src/utils/index.ts +27 -0
- package/src/utils/map.ts +59 -0
- package/src/utils/math.ts +19 -0
- package/src/utils/misc.ts +45 -0
- package/src/utils/number.ts +3 -0
- package/src/utils/object.ts +43 -0
- package/src/utils/padding.ts +43 -0
- package/src/utils/pixi.ts +116 -0
- package/src/utils/platform.ts +33 -0
- package/src/utils/point.ts +123 -0
- package/src/utils/promise/Queue.ts +125 -0
- package/src/utils/promise/functions.ts +16 -0
- package/src/utils/promise/index.ts +2 -0
- package/src/utils/random.ts +69 -0
- package/src/utils/rect.ts +50 -0
- package/src/utils/set.ts +32 -0
- package/src/utils/string.ts +9 -0
- package/src/utils/text.ts +30 -0
- package/src/utils/typefilters.ts +29 -0
- package/src/utils/types.ts +426 -0
- package/src/utils/vite.ts +41 -0
- package/src/utils/web.ts +7 -0
- package/src/version.ts +3 -0
- package/src/webgl-check.ts +12 -0
- package/templates/app/default/.eslintrc.json +21 -0
- package/templates/app/default/.meta.json +4 -0
- package/templates/app/default/.nvmrc +1 -0
- package/templates/app/default/.prettierrc.json +7 -0
- package/templates/app/default/README.md +8 -0
- package/templates/app/default/assets/audio{m}/music/Cheerful Annoyance.ogg +0 -0
- package/templates/app/default/assets/audio{m}/music/Drumming Sticks.ogg +0 -0
- package/templates/app/default/assets/audio{m}/music/Game Over.ogg +0 -0
- package/templates/app/default/assets/audio{m}/music/Mishief Stroll.ogg +0 -0
- package/templates/app/default/assets/audio{m}/music/Night at the Beach.ogg +0 -0
- package/templates/app/default/assets/audio{m}/sfx/click.ogg +0 -0
- package/templates/app/default/assets/audio{m}/sfx/hover.ogg +0 -0
- package/templates/app/default/assets/required{m}/caper.png +0 -0
- package/templates/app/default/assets/required{m}/fonts{fix}/SpaceGrotesk-Bold{family=Space Grotesk}{wf}.ttf +0 -0
- package/templates/app/default/assets/required{m}/fonts{fix}/SpaceGrotesk-Medium{family=Space Grotesk}{wf}.ttf +0 -0
- package/templates/app/default/assets/required{m}/fonts{fix}/SpaceGrotesk-Regular{family=Space Grotesk}{wf}.ttf +0 -0
- package/templates/app/default/assets/required{m}/fonts{fix}/Syncopate-Bold{family=Syncopate}{wf}.ttf +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn/blue.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn/green.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn/grey.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn/orange.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn/purple.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn/red.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn/yellow.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn_a/down.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn_a/over.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn_a/up.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn_b/down.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn_b/over.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn_b/up.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/joystick/base.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/joystick/handle.png +0 -0
- package/templates/app/default/assets/required{m}/wordmark.svg +1 -0
- package/templates/app/default/assets/spine{m}/spineboy-pro.png +0 -0
- package/templates/app/default/assets/spine{m}/spineboy-pro.skel +0 -0
- package/templates/app/default/assets/spine{m}/spineboy-pro{fix}.atlas +94 -0
- package/templates/app/default/caper.config.ts +60 -0
- package/templates/app/default/index.html +23 -0
- package/templates/app/default/package.template.json +17 -0
- package/templates/app/default/public/favicon.ico +0 -0
- package/templates/app/default/src/__APPLICATION_NAME__.ts +3 -0
- package/templates/app/default/src/main.ts +9 -0
- package/templates/app/default/src/scenes/Base.ts +39 -0
- package/templates/app/default/src/scenes/Game.ts +34 -0
- package/templates/app/default/src/scenes/Splash.ts +70 -0
- package/templates/app/default/src/scenes/Start.ts +90 -0
- package/templates/app/default/src/utils/Constants.ts +3 -0
- package/templates/app/default/tsconfig.json +1 -0
- package/templates/plugin/package.template.json +33 -0
- package/templates/plugin/src/Plugin.template.ts +24 -0
- package/templates/plugin/src/index.template.ts +3 -0
- package/templates/plugin/tsconfig.template.json +43 -0
- package/templates/plugin/vite-env.template.d.ts +16 -0
- package/templates/plugin/vite.config.template.ts +19 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Action } from '../..';
|
|
2
|
+
export declare const DefaultActionContexts: {
|
|
3
|
+
default: string;
|
|
4
|
+
menu: string;
|
|
5
|
+
pause: string;
|
|
6
|
+
popup: string;
|
|
7
|
+
game: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const DefaultActionContextsArray: string[];
|
|
10
|
+
export declare const DefaultActions: Action[];
|
|
11
|
+
export declare const defaultActionsList: {
|
|
12
|
+
action: {
|
|
13
|
+
context: string;
|
|
14
|
+
};
|
|
15
|
+
back: {
|
|
16
|
+
context: string[];
|
|
17
|
+
};
|
|
18
|
+
next: {
|
|
19
|
+
context: string[];
|
|
20
|
+
};
|
|
21
|
+
select: {
|
|
22
|
+
context: string[];
|
|
23
|
+
};
|
|
24
|
+
menu: {
|
|
25
|
+
context: string[];
|
|
26
|
+
};
|
|
27
|
+
down: {
|
|
28
|
+
context: string[];
|
|
29
|
+
};
|
|
30
|
+
up: {
|
|
31
|
+
context: string[];
|
|
32
|
+
};
|
|
33
|
+
left: {
|
|
34
|
+
context: string[];
|
|
35
|
+
};
|
|
36
|
+
right: {
|
|
37
|
+
context: string;
|
|
38
|
+
};
|
|
39
|
+
pause: {
|
|
40
|
+
context: string;
|
|
41
|
+
};
|
|
42
|
+
unpause: {
|
|
43
|
+
context: string;
|
|
44
|
+
};
|
|
45
|
+
start: {
|
|
46
|
+
context: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
export declare const DefaultButtonIds: {
|
|
50
|
+
__default_do_not_use__: string;
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/plugins/actions/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B,eAAO,MAAM,qBAAqB;;;;;;CAMjC,CAAC;AAEF,eAAO,MAAM,0BAA0B,UAAgD,CAAC;AAExF,eAAO,MAAM,cAAc,EAAE,MAAM,EAalC,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAa9B,CAAC;AAEF,eAAO,MAAM,gBAAgB;;CAE5B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/actions/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { UserActions, UserButtons, UserContexts } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Define the contexts for the actions.
|
|
4
|
+
* @param contexts - The contexts to define.
|
|
5
|
+
* @default ['default', 'game', 'menu', 'pause', 'popup', 'default']
|
|
6
|
+
* @returns {ActionContext[]}
|
|
7
|
+
*/
|
|
8
|
+
export declare function defineContexts<C extends UserContexts = UserContexts>(contexts?: C): C;
|
|
9
|
+
export declare function defineActions<C extends UserContexts = UserContexts, U extends UserActions = UserActions<C>>(contexts: C, actions: U, useDefaultActions?: boolean): U;
|
|
10
|
+
export declare function defineButtons<B extends UserButtons = UserButtons>(buttons?: B): B;
|
|
11
|
+
//# sourceMappingURL=methods.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"methods.d.ts","sourceRoot":"","sources":["../../../src/plugins/actions/methods.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAEhF;;;;;GAKG;AAEH,wBAAgB,cAAc,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,EAAE,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC,CAErF;AAED,wBAAgB,aAAa,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,EAAE,CAAC,SAAS,WAAW,GAAG,WAAW,CAAC,CAAC,CAAC,EACzG,QAAQ,EAAE,CAAC,EACX,OAAO,EAAE,CAAC,EACV,iBAAiB,GAAE,OAAc,GAChC,CAAC,CAKH;AAED,wBAAgB,aAAa,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,EAAE,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,CAEjF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Signal } from '../../signals';
|
|
2
|
+
import { DefaultActionContexts, DefaultButtonIds } from './constants';
|
|
3
|
+
export type ActionContext = keyof typeof DefaultActionContexts | (string & {});
|
|
4
|
+
export type Action = 'up' | 'down' | 'left' | 'right' | 'action' | 'next' | 'back' | 'pause' | 'unpause' | 'start' | 'select' | 'menu' | ((string | number) & {});
|
|
5
|
+
export type ActionDetail<T = any> = {
|
|
6
|
+
id: string | number;
|
|
7
|
+
context: string | ActionContext;
|
|
8
|
+
data?: T;
|
|
9
|
+
};
|
|
10
|
+
export type ActionSignal<TActionData = any> = Signal<(detail: ActionDetail<TActionData>) => void>;
|
|
11
|
+
export type ActionsList = (Action | (string & {}))[];
|
|
12
|
+
export type ActionKey = Action | (string & {});
|
|
13
|
+
export type ActionMap<C extends UserContexts = UserContexts> = {
|
|
14
|
+
[K in ActionKey]: ActionDefinition<C>;
|
|
15
|
+
};
|
|
16
|
+
export type UserActions<C extends UserContexts = UserContexts> = Partial<ActionMap<C>>;
|
|
17
|
+
export type ExtractContext<C extends readonly ActionContext[]> = C[number];
|
|
18
|
+
export type UserContexts = ActionContext[];
|
|
19
|
+
export interface ActionDefinition<C extends UserContexts = UserContexts> {
|
|
20
|
+
context: ExtractContext<C> | ExtractContext<C>[] | '*' | (string & {});
|
|
21
|
+
}
|
|
22
|
+
export type UserButton = keyof typeof DefaultButtonIds | (string & {});
|
|
23
|
+
export type UserButtons = UserButton[];
|
|
24
|
+
export type ExtractButtonId<B extends UserButtons> = B[number];
|
|
25
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/plugins/actions/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEtE,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,qBAAqB,GAAG,CAAC,M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AAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;CACxE;AAED,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,gBAAgB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAEvE,MAAM,MAAM,WAAW,GAAG,UAAU,EAAE,CAAC;AAEvC,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,WAAW,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { IAudioInstance } from './AudioInstance';
|
|
2
|
+
import { ChannelName, IAudioManagerPlugin } from './AudioManagerPlugin';
|
|
3
|
+
export interface IAudioChannel {
|
|
4
|
+
name: string;
|
|
5
|
+
muted: boolean;
|
|
6
|
+
volume: number;
|
|
7
|
+
instances: IAudioInstance[];
|
|
8
|
+
add(id: string, instance: IAudioInstance): IAudioInstance;
|
|
9
|
+
get(id: string): IAudioInstance | undefined;
|
|
10
|
+
remove(id: string): IAudioInstance | undefined;
|
|
11
|
+
removeInstance(instance: IAudioInstance): void;
|
|
12
|
+
updateVolume(): void;
|
|
13
|
+
restore(): void;
|
|
14
|
+
destroy(): void;
|
|
15
|
+
pause(): void;
|
|
16
|
+
resume(): void;
|
|
17
|
+
}
|
|
18
|
+
export declare class AudioChannel<C extends ChannelName = ChannelName> {
|
|
19
|
+
name: C;
|
|
20
|
+
manager: IAudioManagerPlugin<C>;
|
|
21
|
+
private _sounds;
|
|
22
|
+
constructor(name: C, manager: IAudioManagerPlugin<C>);
|
|
23
|
+
get instances(): IAudioInstance[];
|
|
24
|
+
private _muted;
|
|
25
|
+
get muted(): boolean;
|
|
26
|
+
set muted(value: boolean);
|
|
27
|
+
private _volume;
|
|
28
|
+
get volume(): number;
|
|
29
|
+
set volume(value: number);
|
|
30
|
+
add(id: string, instance: IAudioInstance): IAudioInstance;
|
|
31
|
+
get(id: string): IAudioInstance | undefined;
|
|
32
|
+
remove(id: string): IAudioInstance | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Removes a single instance from its alias bucket without stopping or
|
|
35
|
+
* destroying it, for use when an instance has naturally reached the end
|
|
36
|
+
* of its life. No-op if the instance is not currently tracked.
|
|
37
|
+
*/
|
|
38
|
+
removeInstance(instance: IAudioInstance): void;
|
|
39
|
+
pause(): void;
|
|
40
|
+
resume(): void;
|
|
41
|
+
_setMuted(): void;
|
|
42
|
+
updateVolume(): void;
|
|
43
|
+
restore(): void;
|
|
44
|
+
destroy(): void;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=AudioChannel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AudioChannel.d.ts","sourceRoot":"","sources":["../../../src/plugins/audio/AudioChannel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAExE,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,cAAc,EAAE,CAAC;IAE5B,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,GAAG,cAAc,CAAC;IAE1D,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAAC;IAE5C,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAAC;IAE/C,cAAc,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAC;IAE/C,YAAY,IAAI,IAAI,CAAC;IAErB,OAAO,IAAI,IAAI,CAAC;IAEhB,OAAO,IAAI,IAAI,CAAC;IAEhB,KAAK,IAAI,IAAI,CAAC;IAEd,MAAM,IAAI,IAAI,CAAC;CAChB;AAED,qBAAa,YAAY,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW;IAIlD,IAAI,EAAE,CAAC;IACP,OAAO,EAAE,mBAAmB,CAAC,CAAC,CAAC;IAJxC,OAAO,CAAC,OAAO,CAAsE;gBAG5E,IAAI,EAAE,CAAC,EACP,OAAO,EAAE,mBAAmB,CAAC,CAAC,CAAC;IAKxC,IAAI,SAAS,IAAI,cAAc,EAAE,CAEhC;IAED,OAAO,CAAC,MAAM,CAAkB;IAEhC,IAAI,KAAK,IAAI,OAAO,CAEnB;IAED,IAAI,KAAK,CAAC,KAAK,EAAE,OAAO,EAIvB;IAED,OAAO,CAAC,OAAO,CAAe;IAE9B,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,MAAM,CAAC,KAAK,EAAE,MAAM,EAGvB;IAED,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,GAAG,cAAc;IAUzD,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS;IAK3C,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS;IAa9C;;;;OAIG;IACH,cAAc,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI;IAe9C,KAAK,IAAI,IAAI;IAYb,MAAM,IAAI,IAAI;IAYd,SAAS,IAAI,IAAI;IAQjB,YAAY;IAWZ,OAAO;IAKP,OAAO;CACR"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AudioChannel.test.d.ts","sourceRoot":"","sources":["../../../src/plugins/audio/AudioChannel.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { IMediaInstance } from '@pixi/sound';
|
|
2
|
+
import { Signal } from '../../signals';
|
|
3
|
+
import { IAudioChannel } from './AudioChannel';
|
|
4
|
+
import { ChannelName, IAudioManagerPlugin } from './AudioManagerPlugin';
|
|
5
|
+
export interface IAudioInstance<C extends ChannelName = ChannelName> {
|
|
6
|
+
volume: number;
|
|
7
|
+
storedVolume: number;
|
|
8
|
+
media: IMediaInstance;
|
|
9
|
+
channel: IAudioChannel;
|
|
10
|
+
muted: boolean;
|
|
11
|
+
id: string;
|
|
12
|
+
manager: IAudioManagerPlugin<C>;
|
|
13
|
+
onStart: Signal<(instance: IAudioInstance) => void>;
|
|
14
|
+
onStop: Signal<(instance: IAudioInstance) => void>;
|
|
15
|
+
onEnd: Signal<(instance: IAudioInstance) => void>;
|
|
16
|
+
onPaused: Signal<(instance: IAudioInstance) => void>;
|
|
17
|
+
onResumed: Signal<(instance: IAudioInstance) => void>;
|
|
18
|
+
isPlaying: boolean;
|
|
19
|
+
fadeTo(volume: number, duration: number): gsap.core.Tween;
|
|
20
|
+
stop(): void;
|
|
21
|
+
destroy(): void;
|
|
22
|
+
remove(): void;
|
|
23
|
+
updateVolume(): void;
|
|
24
|
+
addListeners(): void;
|
|
25
|
+
removeListeners(): void;
|
|
26
|
+
pause(): void;
|
|
27
|
+
play(): void;
|
|
28
|
+
resume(): void;
|
|
29
|
+
}
|
|
30
|
+
export declare class AudioInstance<C extends ChannelName = ChannelName> implements IAudioInstance {
|
|
31
|
+
id: string;
|
|
32
|
+
channel: IAudioChannel;
|
|
33
|
+
manager: IAudioManagerPlugin;
|
|
34
|
+
storedVolume: number;
|
|
35
|
+
onStart: Signal<(instance: IAudioInstance) => void>;
|
|
36
|
+
onStop: Signal<(instance: IAudioInstance) => void>;
|
|
37
|
+
onEnd: Signal<(instance: IAudioInstance) => void>;
|
|
38
|
+
onPaused: Signal<(instance: IAudioInstance) => void>;
|
|
39
|
+
onResumed: Signal<(instance: IAudioInstance) => void>;
|
|
40
|
+
onProgress: Signal<(instance: IAudioInstance) => void>;
|
|
41
|
+
constructor(id: string, channel: IAudioChannel, manager: IAudioManagerPlugin);
|
|
42
|
+
private _media;
|
|
43
|
+
get media(): IMediaInstance;
|
|
44
|
+
set media(value: IMediaInstance);
|
|
45
|
+
private _volume;
|
|
46
|
+
get volume(): number;
|
|
47
|
+
set volume(value: number);
|
|
48
|
+
private _muted;
|
|
49
|
+
get muted(): boolean;
|
|
50
|
+
set muted(value: boolean);
|
|
51
|
+
/**
|
|
52
|
+
* The volume that should actually reach the media instance: the logical
|
|
53
|
+
* (unmuted) volume folded through the channel and master volume, forced
|
|
54
|
+
* to 0 whenever this instance or its channel is muted. Centralizing this
|
|
55
|
+
* keeps `media.muted` from being the sole thing standing between a muted
|
|
56
|
+
* channel and audible sound.
|
|
57
|
+
*/
|
|
58
|
+
private get _effectiveVolume();
|
|
59
|
+
private _isPlaying;
|
|
60
|
+
get isPlaying(): boolean;
|
|
61
|
+
set isPlaying(value: boolean);
|
|
62
|
+
pause(): void;
|
|
63
|
+
resume(): void;
|
|
64
|
+
remove(): void;
|
|
65
|
+
stop(): void;
|
|
66
|
+
updateVolume(): void;
|
|
67
|
+
addListeners(): void;
|
|
68
|
+
removeListeners(): void;
|
|
69
|
+
destroy(): void;
|
|
70
|
+
fadeTo(volume: number, duration: number): gsap.core.Tween;
|
|
71
|
+
play(time?: number): void;
|
|
72
|
+
private _handleMediaEnded;
|
|
73
|
+
private _handleMediaStarted;
|
|
74
|
+
private _handleMediaStopped;
|
|
75
|
+
private _handleMediaPaused;
|
|
76
|
+
private _handleMediaProgress;
|
|
77
|
+
private _handleMediaResumed;
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=AudioInstance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AudioInstance.d.ts","sourceRoot":"","sources":["../../../src/plugins/audio/AudioInstance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAExE,MAAM,WAA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AUZ,eAAe;IAaR,OAAO;IAKP,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK;IAIzD,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI;IAShC,OAAO,CAAC,iBAAiB;IAKzB,OAAO,CAAC,mBAAmB;IAK3B,OAAO,CAAC,mBAAmB;IAK3B,OAAO,CAAC,kBAAkB;IAK1B,OAAO,CAAC,oBAAoB;IAI5B,OAAO,CAAC,mBAAmB;CAI5B"}
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
import { PlayOptions } from '@pixi/sound';
|
|
2
|
+
import { AssetsManifest, UnresolvedAsset } from 'pixi.js';
|
|
3
|
+
import { Signal } from '../../signals';
|
|
4
|
+
import { AudioAsset } from '../../utils';
|
|
5
|
+
import { IPlugin, Plugin } from '../Plugin';
|
|
6
|
+
import { IApplication } from '../../core';
|
|
7
|
+
import { IAudioChannel } from './AudioChannel';
|
|
8
|
+
import { IAudioInstance } from './AudioInstance';
|
|
9
|
+
import TweenVars = gsap.TweenVars;
|
|
10
|
+
export type SoundDetail = {
|
|
11
|
+
id: string;
|
|
12
|
+
instance: IAudioInstance;
|
|
13
|
+
channelName: string;
|
|
14
|
+
};
|
|
15
|
+
export type ChannelVolumeDetail = {
|
|
16
|
+
channel: IAudioChannel;
|
|
17
|
+
volume: number;
|
|
18
|
+
};
|
|
19
|
+
export type ChannelMutedDetail = {
|
|
20
|
+
channel: IAudioChannel;
|
|
21
|
+
muted: boolean;
|
|
22
|
+
};
|
|
23
|
+
export type ChannelName = 'music' | 'sfx' | 'voiceover' | (string & {});
|
|
24
|
+
export interface IAudioManagerPlugin<C extends ChannelName = ChannelName> extends IPlugin {
|
|
25
|
+
onSoundStarted: Signal<(detail: SoundDetail) => void>;
|
|
26
|
+
onSoundEnded: Signal<(detail: SoundDetail) => void>;
|
|
27
|
+
onMasterVolumeChanged: Signal<(volume: number) => void>;
|
|
28
|
+
onChannelVolumeChanged: Signal<(detail: ChannelVolumeDetail) => void>;
|
|
29
|
+
onMuted: Signal<(muted: boolean) => void>;
|
|
30
|
+
onChannelMuted: Signal<(detail: ChannelMutedDetail) => void>;
|
|
31
|
+
masterVolume: number;
|
|
32
|
+
muted: boolean;
|
|
33
|
+
channels: Map<string, IAudioChannel>;
|
|
34
|
+
music: IAudioChannel;
|
|
35
|
+
sfx: IAudioChannel;
|
|
36
|
+
voiceover: IAudioChannel;
|
|
37
|
+
vo: IAudioChannel;
|
|
38
|
+
readonly paused: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* The WebAudio context sounds are actually played on. Anything building
|
|
41
|
+
* `PlayOptions.filters` MUST create its nodes on this context: WebAudio
|
|
42
|
+
* refuses to connect nodes across contexts, and caper may not share a
|
|
43
|
+
* `@pixi/sound` instance (and therefore a context) with the consuming app.
|
|
44
|
+
* `undefined` under the htmlaudio fallback, where filters do not apply.
|
|
45
|
+
*/
|
|
46
|
+
readonly audioContext: AudioContext | undefined;
|
|
47
|
+
createChannel(name: string): void;
|
|
48
|
+
play(soundId: AudioAsset, channelName: C, options?: PlayOptions): Promise<IAudioInstance>;
|
|
49
|
+
isPlaying(soundId: AudioAsset, channelName: C): boolean;
|
|
50
|
+
load(soundId: AudioAsset | AudioAsset[], channelName: C, options?: PlayOptions): void;
|
|
51
|
+
stop(soundId: AudioAsset, channelName: C): IAudioInstance | undefined;
|
|
52
|
+
setChannelVolume(channelName: C | C[], volume: number): void;
|
|
53
|
+
getChannel(name: C): IAudioChannel | undefined;
|
|
54
|
+
addAllFromManifest(manifest: AssetsManifest): void;
|
|
55
|
+
addAllFromBundle(bundleName: string, manifest?: AssetsManifest | string | undefined): void;
|
|
56
|
+
add(soundAsset: UnresolvedAsset): void;
|
|
57
|
+
fade(soundId: AudioAsset, channelName: C, props?: gsap.TweenVars): Promise<gsap.core.Tween | null>;
|
|
58
|
+
fadeIn(soundId: AudioAsset, channelName: C, props?: gsap.TweenVars): Promise<gsap.core.Tween | null>;
|
|
59
|
+
fadeOut(soundId: AudioAsset, channelName: C, props?: gsap.TweenVars): Promise<gsap.core.Tween | null>;
|
|
60
|
+
crossFade(outSoundId: AudioAsset, inSoundId: AudioAsset, channelName: C, duration?: number): Promise<gsap.core.Tween | null>;
|
|
61
|
+
mute(): void;
|
|
62
|
+
unmute(): void;
|
|
63
|
+
pause(): void;
|
|
64
|
+
resume(): void;
|
|
65
|
+
suspend(): void;
|
|
66
|
+
restore(): Promise<void>;
|
|
67
|
+
getAudioInstance(soundId: AudioAsset, channelName: C): IAudioInstance | undefined;
|
|
68
|
+
stopAll(fade?: boolean, duration?: number, props?: TweenVars): void;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* AudioManager is a class that manages audio playback in the application.
|
|
72
|
+
* It provides methods to play, stop, fade in/out, and crossfade sounds.
|
|
73
|
+
* It also allows you to create and manage audio channels.
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* const audioManager = new AudioManager();
|
|
77
|
+
* audioManager.play('soundId', 'music');
|
|
78
|
+
*/
|
|
79
|
+
export declare class AudioManagerPlugin<C extends ChannelName = ChannelName> extends Plugin implements IAudioManagerPlugin<C> {
|
|
80
|
+
/**
|
|
81
|
+
* Signal that is emitted when a sound starts playing.
|
|
82
|
+
* The callback function receives a SoundDetail object.
|
|
83
|
+
*/
|
|
84
|
+
onSoundStarted: Signal<(detail: SoundDetail) => void>;
|
|
85
|
+
/**
|
|
86
|
+
* Signal that is emitted when a sound ends.
|
|
87
|
+
* The callback function receives a SoundDetail object.
|
|
88
|
+
*/
|
|
89
|
+
onSoundEnded: Signal<(detail: SoundDetail) => void>;
|
|
90
|
+
/**
|
|
91
|
+
* Signal that is emitted when the system is muted or unmuted.
|
|
92
|
+
*/
|
|
93
|
+
onMuted: Signal<(muted: boolean) => void>;
|
|
94
|
+
/**
|
|
95
|
+
* Signal that is emitted when the master volume changes.
|
|
96
|
+
* The callback function receives the new volume as a number.
|
|
97
|
+
*/
|
|
98
|
+
onMasterVolumeChanged: Signal<(volume: number) => void>;
|
|
99
|
+
/**
|
|
100
|
+
* Signal that is emitted when a channel's volume changes.
|
|
101
|
+
* The callback function receives a ChannelVolumeDetail object.
|
|
102
|
+
*/
|
|
103
|
+
onChannelVolumeChanged: Signal<(detail: ChannelVolumeDetail) => void>;
|
|
104
|
+
/**
|
|
105
|
+
* Signal that is emitted when a channel is muted or unmuted.
|
|
106
|
+
* The callback function receives a ChannelMutedDetail object.
|
|
107
|
+
*/
|
|
108
|
+
onChannelMuted: Signal<(detail: ChannelMutedDetail) => void>;
|
|
109
|
+
private _storedVolume;
|
|
110
|
+
private _paused;
|
|
111
|
+
private _idMap;
|
|
112
|
+
/**
|
|
113
|
+
* Creates a new AudioManager instance.
|
|
114
|
+
* @param {string} id - The ID of the AudioManager. Default is 'AudioManager'.
|
|
115
|
+
*/
|
|
116
|
+
constructor(id?: string);
|
|
117
|
+
private _masterVolume;
|
|
118
|
+
/**
|
|
119
|
+
* The WebAudio context sounds actually play on — see
|
|
120
|
+
* {@link IAudioManagerPlugin.audioContext}. Exposed so consumers can build
|
|
121
|
+
* `PlayOptions.filters` on the right context instead of guessing.
|
|
122
|
+
*/
|
|
123
|
+
get audioContext(): AudioContext | undefined;
|
|
124
|
+
/**
|
|
125
|
+
* Gets the master volume.
|
|
126
|
+
* @returns {number} The master volume.
|
|
127
|
+
*/
|
|
128
|
+
get masterVolume(): number;
|
|
129
|
+
/**
|
|
130
|
+
* Sets the master volume.
|
|
131
|
+
* @param {number} value - The new master volume.
|
|
132
|
+
*/
|
|
133
|
+
set masterVolume(value: number);
|
|
134
|
+
private _muted;
|
|
135
|
+
/**
|
|
136
|
+
* Gets whether the audio is muted.
|
|
137
|
+
* @returns {boolean} True if the audio is muted, false otherwise.
|
|
138
|
+
*/
|
|
139
|
+
get muted(): boolean;
|
|
140
|
+
/**
|
|
141
|
+
* Sets whether the audio is muted.
|
|
142
|
+
* @param {boolean} value - True to mute the audio, false to unmute.
|
|
143
|
+
*/
|
|
144
|
+
set muted(value: boolean);
|
|
145
|
+
private _channels;
|
|
146
|
+
/**
|
|
147
|
+
* Gets the map of audio channels.
|
|
148
|
+
* @returns {Map<string, IAudioChannel>} The map of audio channels.
|
|
149
|
+
*/
|
|
150
|
+
get channels(): Map<string, IAudioChannel>;
|
|
151
|
+
get music(): IAudioChannel;
|
|
152
|
+
get sfx(): IAudioChannel;
|
|
153
|
+
get voiceover(): IAudioChannel;
|
|
154
|
+
get vo(): IAudioChannel;
|
|
155
|
+
destroy(): void;
|
|
156
|
+
/**
|
|
157
|
+
* Initializes the AudioManager.
|
|
158
|
+
* @param {IApplication} app
|
|
159
|
+
* @returns {Promise<void>}
|
|
160
|
+
*/
|
|
161
|
+
initialize(_options: any, app: IApplication): Promise<void>;
|
|
162
|
+
/**
|
|
163
|
+
* Creates a new audio channel.
|
|
164
|
+
* @param {string} name
|
|
165
|
+
*/
|
|
166
|
+
createChannel(name: string): void;
|
|
167
|
+
/**
|
|
168
|
+
* Sets the volume of the specified channel.
|
|
169
|
+
* @param {ChannelName|ChannelName[]} channelName
|
|
170
|
+
* @param {number} volume
|
|
171
|
+
*/
|
|
172
|
+
setChannelVolume(channelName: C | C[], volume: number): void;
|
|
173
|
+
/**
|
|
174
|
+
* Gets the audio channel with the specified name.
|
|
175
|
+
* @param {C} name
|
|
176
|
+
* @returns {IAudioChannel | undefined}
|
|
177
|
+
*/
|
|
178
|
+
getChannel(name: C): IAudioChannel | undefined;
|
|
179
|
+
/**
|
|
180
|
+
* Mutes the audio.
|
|
181
|
+
*/
|
|
182
|
+
mute(): void;
|
|
183
|
+
/**
|
|
184
|
+
* Unmutes the audio.
|
|
185
|
+
*/
|
|
186
|
+
unmute(): void;
|
|
187
|
+
/**
|
|
188
|
+
* Pauses the audio.
|
|
189
|
+
*/
|
|
190
|
+
pause(): void;
|
|
191
|
+
/**
|
|
192
|
+
* Resumes the audio.
|
|
193
|
+
*/
|
|
194
|
+
resume(): void;
|
|
195
|
+
get paused(): boolean;
|
|
196
|
+
/**
|
|
197
|
+
* Adds all sound assets from the specified manifest.
|
|
198
|
+
* @param {AssetsManifest} manifest
|
|
199
|
+
*/
|
|
200
|
+
addAllFromManifest(manifest: AssetsManifest): void;
|
|
201
|
+
private _addPrefix;
|
|
202
|
+
/**
|
|
203
|
+
* Adds all sound assets from the specified bundle.
|
|
204
|
+
* @param {string} bundleName
|
|
205
|
+
* @param {AssetsManifest | string | undefined} manifest
|
|
206
|
+
*/
|
|
207
|
+
addAllFromBundle(bundleName: string, manifest?: AssetsManifest | string | undefined): void;
|
|
208
|
+
/**
|
|
209
|
+
* Adds a sound asset to the AudioManager.
|
|
210
|
+
* @param {UnresolvedAsset} soundAsset
|
|
211
|
+
*/
|
|
212
|
+
add(soundAsset: UnresolvedAsset): void;
|
|
213
|
+
isPlaying(soundId: string, channelName: C): boolean;
|
|
214
|
+
/**
|
|
215
|
+
* Plays a sound with the specified ID in the specified channel.
|
|
216
|
+
* @param {string} soundId
|
|
217
|
+
* @param {C} channelName
|
|
218
|
+
* @param {PlayOptions} options
|
|
219
|
+
* @returns {Promise<IAudioInstance>}
|
|
220
|
+
*/
|
|
221
|
+
/**
|
|
222
|
+
* Drops any filter whose nodes belong to a different `AudioContext` than the
|
|
223
|
+
* one playback runs on.
|
|
224
|
+
*
|
|
225
|
+
* WebAudio refuses cross-context `connect()`, and @pixi/sound wires filters
|
|
226
|
+
* deep inside `WebAudioInstance.play()` — so one foreign filter throws
|
|
227
|
+
* `InvalidAccessError` from a place the caller cannot catch, and the sound
|
|
228
|
+
* never plays AT ALL. Silent-and-unattributable is the worst failure mode we
|
|
229
|
+
* can hand an app, so prefer dry audio plus a pointed error: the sound is
|
|
230
|
+
* still heard, and the log says exactly how to fix it. This is easy to hit
|
|
231
|
+
* because an app bundling its own `@pixi/sound` gets a different context than
|
|
232
|
+
* caper's — build filters on {@link audioContext}.
|
|
233
|
+
*/
|
|
234
|
+
private _usableFilters;
|
|
235
|
+
play(soundId: AudioAsset, channelName?: C, options?: PlayOptions): Promise<IAudioInstance>;
|
|
236
|
+
/**
|
|
237
|
+
* Stops a sound with the specified ID in the specified channel.
|
|
238
|
+
* @param {AudioAsset} soundId
|
|
239
|
+
* @param {C} channelName
|
|
240
|
+
* @returns {IAudioInstance | undefined}
|
|
241
|
+
*/
|
|
242
|
+
stop(soundId: AudioAsset, channelName?: C): IAudioInstance | undefined;
|
|
243
|
+
/**
|
|
244
|
+
* Fades in a sound with the specified ID in the specified channel.
|
|
245
|
+
* @param {AudioAsset} soundId
|
|
246
|
+
* @param {C} channelName
|
|
247
|
+
* @param {gsap.TweenVars} props
|
|
248
|
+
* @returns {Promise<gsap.core.Tween | null>}
|
|
249
|
+
*/
|
|
250
|
+
fadeIn(soundId: AudioAsset, channelName: C | undefined, props: gsap.TweenVars): Promise<gsap.core.Tween | null>;
|
|
251
|
+
/**
|
|
252
|
+
* Fades out a sound with the specified ID in the specified channel.
|
|
253
|
+
* @param {AudioAsset} soundId
|
|
254
|
+
* @param {C} channelName
|
|
255
|
+
* @param {Partial<gsap.TweenVars>} props
|
|
256
|
+
* @returns {Promise<gsap.core.Tween | null>}
|
|
257
|
+
*/
|
|
258
|
+
fadeOut(soundId: AudioAsset, channelName?: C, props?: Partial<gsap.TweenVars>): Promise<gsap.core.Tween | null>;
|
|
259
|
+
/**
|
|
260
|
+
* Crossfades between two sounds in the specified channel.
|
|
261
|
+
* @param {AudioAsset} outSoundId
|
|
262
|
+
* @param {AudioAsset} inSoundId
|
|
263
|
+
* @param {ChannelName} channelName
|
|
264
|
+
* @param {number} duration
|
|
265
|
+
* @returns {Promise<gsap.core.Tween | null>}
|
|
266
|
+
*/
|
|
267
|
+
crossFade(outSoundId: AudioAsset, inSoundId: AudioAsset, channelName?: ChannelName, duration?: number): Promise<gsap.core.Tween | null>;
|
|
268
|
+
/**
|
|
269
|
+
* Fades a sound with the specified ID in the specified channel.
|
|
270
|
+
* @param {AudioAsset} soundId
|
|
271
|
+
* @param {ChannelName} channelName
|
|
272
|
+
* @param {gsap.TweenVars} props
|
|
273
|
+
* @param {boolean} stopOnComplete
|
|
274
|
+
* @returns {Promise<gsap.core.Tween | null>}
|
|
275
|
+
*/
|
|
276
|
+
fade(soundId: AudioAsset, channelName: ChannelName | undefined, props: gsap.TweenVars, stopOnComplete?: boolean): Promise<gsap.core.Tween | null>;
|
|
277
|
+
/**
|
|
278
|
+
* Restores the audio state after it has been suspended.
|
|
279
|
+
*/
|
|
280
|
+
restore(): Promise<void>;
|
|
281
|
+
/**
|
|
282
|
+
* Suspends the audio by setting the master volume to 0 and pausing all sounds.
|
|
283
|
+
*/
|
|
284
|
+
suspend(): void;
|
|
285
|
+
getAudioInstance(soundId: AudioAsset, channelName?: C): IAudioInstance | undefined;
|
|
286
|
+
load(soundId: AudioAsset | AudioAsset[], channelName?: C, options?: PlayOptions): void;
|
|
287
|
+
stopAll(fade?: boolean, duration?: number, props?: TweenVars): void;
|
|
288
|
+
protected getCoreSignals(): string[];
|
|
289
|
+
private _verifySoundId;
|
|
290
|
+
private _findAndAddFromManifest;
|
|
291
|
+
/**
|
|
292
|
+
* @private
|
|
293
|
+
*/
|
|
294
|
+
private _setMuted;
|
|
295
|
+
/**
|
|
296
|
+
* @private
|
|
297
|
+
*/
|
|
298
|
+
private _setPaused;
|
|
299
|
+
/**
|
|
300
|
+
* Sets the volume of the specified channel.
|
|
301
|
+
* @param {C} channelName
|
|
302
|
+
* @param {number} volume
|
|
303
|
+
* @private
|
|
304
|
+
*/
|
|
305
|
+
private _setChannelVolume;
|
|
306
|
+
/**
|
|
307
|
+
* Sound started event handler. Emit the onSoundStarted signal.
|
|
308
|
+
* @param {string} id
|
|
309
|
+
* @param {IAudioInstance} instance
|
|
310
|
+
* @param {C} channelName
|
|
311
|
+
* @private
|
|
312
|
+
*/
|
|
313
|
+
private _soundStarted;
|
|
314
|
+
/**
|
|
315
|
+
* Sound ended event handler. Emit the onSoundEnded signal.
|
|
316
|
+
* @param {string} id
|
|
317
|
+
* @param {IAudioInstance} instance
|
|
318
|
+
* @param {C} channelName
|
|
319
|
+
* @private
|
|
320
|
+
*/
|
|
321
|
+
private _soundEnded;
|
|
322
|
+
}
|
|
323
|
+
//# sourceMappingURL=AudioManagerPlugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AudioManagerPlugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/audio/AudioManagerPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,WAAW,EAA0C,MAAM,aAAa,CAAC;AAE3F,OAAO,EAAU,cAAc,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,UAAU,EAAU,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAgB,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAiB,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;AAElC,MAAM,MAAM,WAAW,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,cAAc,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC;AACxF,MAAM,MAAM,mBAAmB,GAAG;IAAE,OAAO,EAAE,aAAa,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAC7E,MAAM,MAAM,kBAAkB,GAAG;IAAE,OAAO,EAAE,aAAa,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC;AAC5E,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,KAAK,GAAG,WAAW,GAAG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IACU,IAAI,CACf,OAAO,EAAE,UAAU,EACnB,WAAW,EAAE,WAAW,YAAU,EAClC,KAAK,EAAE,IAAI,CAAC,SAAS,EACrB,cAAc,GAAE,OAAe,GAC9B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IAkBlC;;OAEG;IACU,OAAO;IAepB;;OAEG;IACI,OAAO;IAMP,gBAAgB,CAAC,OAAO,EAAE,UAAU,EAAE,WAAW,GAAE,CAAc,GAAG,cAAc,GAAG,SAAS;IAU9F,IAAI,CAAC,OAAO,EAAE,UAAU,GAAG,UAAU,EAAE,EAAE,WAAW,GAAE,CAAc,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,IAAI;IAuBlG,OAAO,CAAC,IAAI,GAAE,OAAe,EAAE,QAAQ,GAAE,MAAU,EAAE,KAAK,GAAE,SAAc;IA8BjF,SAAS,CAAC,cAAc,IAAI,MAAM,EAAE;IAWpC,OAAO,CAAC,cAAc;IAwCtB,OAAO,CAAC,uBAAuB;IAwC/B;;OAEG;IACH,OAAO,CAAC,SAAS;IASjB;;OAEG;IACH,OAAO,CAAC,UAAU;IAQlB;;;;;OAKG;IACH,OAAO,CAAC,iBAAiB;IASzB;;;;;;OAMG;IACH,OAAO,CAAC,aAAa;IAKrB;;;;;;OAMG;IACH,OAAO,CAAC,WAAW;CAIpB"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Signal } from '../../signals';
|
|
2
|
+
import { IPlugin, Plugin } from '../Plugin';
|
|
3
|
+
import { IAudioInstance } from './AudioInstance';
|
|
4
|
+
export type PlayMode = 'append' | 'override' | 'new';
|
|
5
|
+
export type VoCallback = (didPlay: boolean) => void;
|
|
6
|
+
export type VoKey = string | number;
|
|
7
|
+
export type Caption = {
|
|
8
|
+
id: string;
|
|
9
|
+
args?: {
|
|
10
|
+
[key: string]: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export interface IPlayVoiceOverOptions {
|
|
14
|
+
mode?: PlayMode;
|
|
15
|
+
priority?: number;
|
|
16
|
+
callback?: VoCallback;
|
|
17
|
+
localized?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface IVoiceOverPlugin extends IPlugin {
|
|
20
|
+
fadeOutDuration: number;
|
|
21
|
+
debug: boolean;
|
|
22
|
+
onVoiceOverStart: Signal<(instance: IAudioInstance) => void>;
|
|
23
|
+
onVoiceOverPaused: Signal<(instance: IAudioInstance) => void>;
|
|
24
|
+
onVoiceOverResumed: Signal<(instance: IAudioInstance) => void>;
|
|
25
|
+
onVoiceOverComplete: Signal<(instance: IAudioInstance) => void>;
|
|
26
|
+
onVoiceOverStopped: Signal<(instance?: IAudioInstance) => void>;
|
|
27
|
+
paused: boolean;
|
|
28
|
+
playVO(key: VoKey | VoKey[], mode?: PlayMode, callback?: VoCallback): Promise<IAudioInstance>;
|
|
29
|
+
playVO(key: VoKey | VoKey[], callback?: VoCallback): Promise<IAudioInstance>;
|
|
30
|
+
playVO(key: VoKey | VoKey[], options?: IPlayVoiceOverOptions): Promise<IAudioInstance>;
|
|
31
|
+
stopVO(): Promise<void>;
|
|
32
|
+
pauseVO(): void;
|
|
33
|
+
resumeVO(): void;
|
|
34
|
+
}
|
|
35
|
+
export declare class VoiceOverPlugin extends Plugin implements IVoiceOverPlugin {
|
|
36
|
+
readonly id = "voiceover";
|
|
37
|
+
fadeOutDuration: number;
|
|
38
|
+
debug: boolean;
|
|
39
|
+
onVoiceOverStart: Signal<(instance: IAudioInstance) => void>;
|
|
40
|
+
onVoiceOverPaused: Signal<(instance: IAudioInstance) => void>;
|
|
41
|
+
onVoiceOverComplete: Signal<(instance: IAudioInstance) => void>;
|
|
42
|
+
onVoiceOverResumed: Signal<(instance: IAudioInstance) => void>;
|
|
43
|
+
onVoiceOverStopped: Signal<(instance?: IAudioInstance) => void>;
|
|
44
|
+
private readonly _queue;
|
|
45
|
+
private readonly _pausedQueue;
|
|
46
|
+
private _paused;
|
|
47
|
+
get paused(): boolean;
|
|
48
|
+
get activeTimeout(): gsap.core.Tween | undefined;
|
|
49
|
+
get activeVO(): IAudioInstance | undefined;
|
|
50
|
+
initialize(): Promise<void>;
|
|
51
|
+
playVO(key: VoKey | VoKey[], mode?: PlayMode, callback?: VoCallback): Promise<IAudioInstance>;
|
|
52
|
+
playVO(key: VoKey | VoKey[], callback?: VoCallback): Promise<IAudioInstance>;
|
|
53
|
+
playVO(key: VoKey | VoKey[], options?: IPlayVoiceOverOptions): Promise<IAudioInstance>;
|
|
54
|
+
stopVO(): Promise<void>;
|
|
55
|
+
pauseVO(): void;
|
|
56
|
+
resumeVO(): void;
|
|
57
|
+
protected getCoreSignals(): string[];
|
|
58
|
+
private addToQueue;
|
|
59
|
+
private playNext;
|
|
60
|
+
private _handleActiveVOStarted;
|
|
61
|
+
private _handleActiveVOPaused;
|
|
62
|
+
private _handleActiveVOResumed;
|
|
63
|
+
private _handleActiveVOEndedWithoutPlaying;
|
|
64
|
+
private _handleActiveVOEnded;
|
|
65
|
+
private _currentItemCallback;
|
|
66
|
+
private onPause;
|
|
67
|
+
private onResume;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=VoiceOverPlugin.d.ts.map
|