@egret/engine 0.0.0-stage → 7.0.1-rc.3
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 +201 -0
- package/NOTICE +21 -0
- package/README.md +101 -2
- package/README.zh-CN.md +102 -0
- package/dist/Engine.d.ts +77 -0
- package/dist/Engine.js +464 -0
- package/dist/animation/index.d.ts +6 -0
- package/dist/animation/index.js +5 -0
- package/dist/animation/sequenceController.d.ts +22 -0
- package/dist/animation/sequenceController.js +618 -0
- package/dist/animation/sequenceCoordinator.d.ts +26 -0
- package/dist/animation/sequenceCoordinator.js +161 -0
- package/dist/animation/sequenceInput.d.ts +25 -0
- package/dist/animation/sequenceInput.js +108 -0
- package/dist/animation/sequenceMath.d.ts +35 -0
- package/dist/animation/sequenceMath.js +164 -0
- package/dist/animation/sequenceResetSlot.d.ts +7 -0
- package/dist/animation/sequenceResetSlot.js +367 -0
- package/dist/animation/sequenceResetTypes.d.ts +42 -0
- package/dist/animation/sequenceResetTypes.js +2 -0
- package/dist/animation/types.d.ts +69 -0
- package/dist/animation/types.js +2 -0
- package/dist/assetBundle.d.ts +52 -0
- package/dist/assetBundle.js +173 -0
- package/dist/assetGroup.d.ts +17 -0
- package/dist/assetGroup.js +332 -0
- package/dist/assetGroupTypes.d.ts +15 -0
- package/dist/assetGroupTypes.js +2 -0
- package/dist/audio.d.ts +4 -0
- package/dist/audio.js +4 -0
- package/dist/audioCues.d.ts +43 -0
- package/dist/audioCues.js +127 -0
- package/dist/audioMixer.d.ts +7 -0
- package/dist/audioMixer.js +785 -0
- package/dist/audioTypes.d.ts +233 -0
- package/dist/audioTypes.js +3 -0
- package/dist/bitmapBindingTicket.d.ts +24 -0
- package/dist/bitmapBindingTicket.js +215 -0
- package/dist/bitmapButton.d.ts +4 -0
- package/dist/bitmapButton.js +407 -0
- package/dist/bitmapButtonTypes.d.ts +29 -0
- package/dist/bitmapButtonTypes.js +2 -0
- package/dist/bitmapFontParse.d.ts +10 -0
- package/dist/bitmapFontParse.js +246 -0
- package/dist/bitmapFontTypes.d.ts +109 -0
- package/dist/bitmapFontTypes.js +2 -0
- package/dist/bitmapResourceSlot.d.ts +25 -0
- package/dist/bitmapResourceSlot.js +340 -0
- package/dist/bitmapText.d.ts +6 -0
- package/dist/bitmapText.js +320 -0
- package/dist/bitmapfont.d.ts +5 -0
- package/dist/bitmapfont.js +5 -0
- package/dist/camera.d.ts +4 -0
- package/dist/camera.js +4 -0
- package/dist/camera2d.d.ts +7 -0
- package/dist/camera2d.js +411 -0
- package/dist/cameraTypes.d.ts +114 -0
- package/dist/cameraTypes.js +2 -0
- package/dist/closeHost.d.ts +4 -0
- package/dist/closeHost.js +66 -0
- package/dist/contentArtifacts.d.ts +12 -0
- package/dist/contentArtifacts.js +153 -0
- package/dist/contentAtlasPages.d.ts +13 -0
- package/dist/contentAtlasPages.js +117 -0
- package/dist/contentLoader.d.ts +6 -0
- package/dist/contentLoader.js +327 -0
- package/dist/contentTypes.d.ts +33 -0
- package/dist/contentTypes.js +2 -0
- package/dist/createEngine.d.ts +7 -0
- package/dist/createEngine.js +25 -0
- package/dist/createEngineForProfile.d.ts +5 -0
- package/dist/createEngineForProfile.js +42 -0
- package/dist/displaySubtreeTicket.d.ts +25 -0
- package/dist/displaySubtreeTicket.js +76 -0
- package/dist/fontContentLoader.d.ts +6 -0
- package/dist/fontContentLoader.js +298 -0
- package/dist/fontContentTypes.d.ts +34 -0
- package/dist/fontContentTypes.js +2 -0
- package/dist/gameClock.d.ts +24 -0
- package/dist/gameClock.js +246 -0
- package/dist/gameClockTypes.d.ts +31 -0
- package/dist/gameClockTypes.js +2 -0
- package/dist/gameRun.d.ts +50 -0
- package/dist/gameRun.js +97 -0
- package/dist/gamepad.d.ts +5 -0
- package/dist/gamepad.js +5 -0
- package/dist/gamepadInput.d.ts +4 -0
- package/dist/gamepadInput.js +281 -0
- package/dist/gamepadKeys.d.ts +4 -0
- package/dist/gamepadKeys.js +205 -0
- package/dist/gamepadTypes.d.ts +134 -0
- package/dist/gamepadTypes.js +3 -0
- package/dist/hover.d.ts +4 -0
- package/dist/hover.js +4 -0
- package/dist/hoverInput.d.ts +8 -0
- package/dist/hoverInput.js +503 -0
- package/dist/hoverInputTypes.d.ts +119 -0
- package/dist/hoverInputTypes.js +2 -0
- package/dist/index.d.ts +49 -0
- package/dist/index.js +20 -0
- package/dist/input.d.ts +6 -0
- package/dist/input.js +5 -0
- package/dist/inputActions.d.ts +81 -0
- package/dist/inputActions.js +330 -0
- package/dist/internal/contentFactoryState.d.ts +19 -0
- package/dist/internal/contentFactoryState.js +42 -0
- package/dist/internal/mouseInputFactoryState.d.ts +57 -0
- package/dist/internal/mouseInputFactoryState.js +125 -0
- package/dist/internal/sequenceControllerFactoryState.d.ts +42 -0
- package/dist/internal/sequenceControllerFactoryState.js +98 -0
- package/dist/internal/textFieldFactoryState.d.ts +11 -0
- package/dist/internal/textFieldFactoryState.js +32 -0
- package/dist/internal/texturedFrameState.d.ts +4 -0
- package/dist/internal/texturedFrameState.js +12 -0
- package/dist/internal/uiFactoryState.d.ts +64 -0
- package/dist/internal/uiFactoryState.js +157 -0
- package/dist/internal/uiRootState.d.ts +67 -0
- package/dist/internal/uiRootState.js +103 -0
- package/dist/keyboardInput.d.ts +12 -0
- package/dist/keyboardInput.js +578 -0
- package/dist/keyboardInputTypes.d.ts +81 -0
- package/dist/keyboardInputTypes.js +2 -0
- package/dist/kit.d.ts +14 -0
- package/dist/kit.js +9 -0
- package/dist/layout.d.ts +5 -0
- package/dist/layout.js +132 -0
- package/dist/layoutTypes.d.ts +28 -0
- package/dist/layoutTypes.js +2 -0
- package/dist/manifestAssetGroup.d.ts +10 -0
- package/dist/manifestAssetGroup.js +477 -0
- package/dist/manifestResourceState.d.ts +16 -0
- package/dist/manifestResourceState.js +57 -0
- package/dist/manifestResourceTypes.d.ts +25 -0
- package/dist/manifestResourceTypes.js +2 -0
- package/dist/motion.d.ts +33 -0
- package/dist/motion.js +206 -0
- package/dist/mouseInput.d.ts +102 -0
- package/dist/mouseInput.js +562 -0
- package/dist/mouseInputTypes.d.ts +37 -0
- package/dist/mouseInputTypes.js +2 -0
- package/dist/paragraph.d.ts +8 -0
- package/dist/paragraph.js +7 -0
- package/dist/particleEmitter.d.ts +4 -0
- package/dist/particleEmitter.js +292 -0
- package/dist/particleTypes.d.ts +107 -0
- package/dist/particleTypes.js +2 -0
- package/dist/particles.d.ts +4 -0
- package/dist/particles.js +4 -0
- package/dist/physics2d.d.ts +4 -0
- package/dist/physics2d.js +4 -0
- package/dist/physics2dGeometry.d.ts +39 -0
- package/dist/physics2dGeometry.js +230 -0
- package/dist/physics2dTypes.d.ts +167 -0
- package/dist/physics2dTypes.js +2 -0
- package/dist/physics2dWorld.d.ts +4 -0
- package/dist/physics2dWorld.js +623 -0
- package/dist/pointerInput.d.ts +11 -0
- package/dist/pointerInput.js +299 -0
- package/dist/pointerInputTypes.d.ts +38 -0
- package/dist/pointerInputTypes.js +2 -0
- package/dist/random.d.ts +29 -0
- package/dist/random.js +131 -0
- package/dist/rendering/ownedPreparationFailure2D.d.ts +5 -0
- package/dist/rendering/ownedPreparationFailure2D.js +33 -0
- package/dist/rendering/packSharedDraws2D.d.ts +50 -0
- package/dist/rendering/packSharedDraws2D.js +331 -0
- package/dist/rendering/packedOrientation.d.ts +4 -0
- package/dist/rendering/packedOrientation.js +7 -0
- package/dist/rendering/prepareRectangles2D.d.ts +92 -0
- package/dist/rendering/prepareRectangles2D.js +481 -0
- package/dist/rendering/prepareSharedDraws2D.d.ts +88 -0
- package/dist/rendering/prepareSharedDraws2D.js +652 -0
- package/dist/rendering/preparedBatches2D.d.ts +17 -0
- package/dist/rendering/preparedBatches2D.js +30 -0
- package/dist/rendering/preparedSharedBatches2D.d.ts +44 -0
- package/dist/rendering/preparedSharedBatches2D.js +247 -0
- package/dist/rendering/sharedColor2D.d.ts +18 -0
- package/dist/rendering/sharedColor2D.js +68 -0
- package/dist/rendering/sharedEffects2D.d.ts +23 -0
- package/dist/rendering/sharedEffects2D.js +118 -0
- package/dist/rendering/sharedPreparationRetention2D.d.ts +120 -0
- package/dist/rendering/sharedPreparationRetention2D.js +357 -0
- package/dist/rendering/srgbBytes.d.ts +3 -0
- package/dist/rendering/srgbBytes.js +64 -0
- package/dist/rendering/texturedPreparationBudget2D.d.ts +31 -0
- package/dist/rendering/texturedPreparationBudget2D.js +81 -0
- package/dist/rendering/world3d/Animation3D.d.ts +95 -0
- package/dist/rendering/world3d/Animation3D.js +380 -0
- package/dist/rendering/world3d/AnimationTexture3D.d.ts +157 -0
- package/dist/rendering/world3d/AnimationTexture3D.js +601 -0
- package/dist/rendering/world3d/Batch3D.d.ts +71 -0
- package/dist/rendering/world3d/Batch3D.js +329 -0
- package/dist/rendering/world3d/Camera3D.d.ts +57 -0
- package/dist/rendering/world3d/Camera3D.js +129 -0
- package/dist/rendering/world3d/Character3D.d.ts +123 -0
- package/dist/rendering/world3d/Character3D.js +303 -0
- package/dist/rendering/world3d/Cloth3D.d.ts +115 -0
- package/dist/rendering/world3d/Cloth3D.js +498 -0
- package/dist/rendering/world3d/Compression3D.d.ts +21 -0
- package/dist/rendering/world3d/Compression3D.js +702 -0
- package/dist/rendering/world3d/Curves3D.d.ts +111 -0
- package/dist/rendering/world3d/Curves3D.js +455 -0
- package/dist/rendering/world3d/Decal3D.d.ts +41 -0
- package/dist/rendering/world3d/Decal3D.js +241 -0
- package/dist/rendering/world3d/Geometry3D.d.ts +85 -0
- package/dist/rendering/world3d/Geometry3D.js +326 -0
- package/dist/rendering/world3d/GeometryBuilder3D.d.ts +51 -0
- package/dist/rendering/world3d/GeometryBuilder3D.js +196 -0
- package/dist/rendering/world3d/Gizmo3D.d.ts +75 -0
- package/dist/rendering/world3d/Gizmo3D.js +512 -0
- package/dist/rendering/world3d/Gltf3D.d.ts +67 -0
- package/dist/rendering/world3d/Gltf3D.js +976 -0
- package/dist/rendering/world3d/GpuParticles3D.d.ts +107 -0
- package/dist/rendering/world3d/GpuParticles3D.js +400 -0
- package/dist/rendering/world3d/Hdr3D.d.ts +33 -0
- package/dist/rendering/world3d/Hdr3D.js +190 -0
- package/dist/rendering/world3d/Jelly3D.d.ts +75 -0
- package/dist/rendering/world3d/Jelly3D.js +266 -0
- package/dist/rendering/world3d/Ktx23D.d.ts +27 -0
- package/dist/rendering/world3d/Ktx23D.js +112 -0
- package/dist/rendering/world3d/Light3D.d.ts +75 -0
- package/dist/rendering/world3d/Light3D.js +93 -0
- package/dist/rendering/world3d/Material3D.d.ts +243 -0
- package/dist/rendering/world3d/Material3D.js +267 -0
- package/dist/rendering/world3d/Mesh3D.d.ts +108 -0
- package/dist/rendering/world3d/Mesh3D.js +323 -0
- package/dist/rendering/world3d/Meshopt3D.d.ts +12 -0
- package/dist/rendering/world3d/Meshopt3D.js +275 -0
- package/dist/rendering/world3d/Navigation3D.d.ts +173 -0
- package/dist/rendering/world3d/Navigation3D.js +971 -0
- package/dist/rendering/world3d/Object3D.d.ts +107 -0
- package/dist/rendering/world3d/Object3D.js +305 -0
- package/dist/rendering/world3d/Particles3D.d.ts +85 -0
- package/dist/rendering/world3d/Particles3D.js +274 -0
- package/dist/rendering/world3d/Physics3D.d.ts +416 -0
- package/dist/rendering/world3d/Physics3D.js +2835 -0
- package/dist/rendering/world3d/PhysicsHull3D.d.ts +35 -0
- package/dist/rendering/world3d/PhysicsHull3D.js +227 -0
- package/dist/rendering/world3d/PhysicsMesh3D.d.ts +39 -0
- package/dist/rendering/world3d/PhysicsMesh3D.js +338 -0
- package/dist/rendering/world3d/PhysicsQueries3D.d.ts +24 -0
- package/dist/rendering/world3d/PhysicsQueries3D.js +323 -0
- package/dist/rendering/world3d/PhysicsRemote3D.d.ts +174 -0
- package/dist/rendering/world3d/PhysicsRemote3D.js +534 -0
- package/dist/rendering/world3d/Ragdoll3D.d.ts +69 -0
- package/dist/rendering/world3d/Ragdoll3D.js +200 -0
- package/dist/rendering/world3d/Raycast3D.d.ts +37 -0
- package/dist/rendering/world3d/Raycast3D.js +246 -0
- package/dist/rendering/world3d/RenderList3D.d.ts +88 -0
- package/dist/rendering/world3d/RenderList3D.js +490 -0
- package/dist/rendering/world3d/Retarget3D.d.ts +20 -0
- package/dist/rendering/world3d/Retarget3D.js +185 -0
- package/dist/rendering/world3d/Serialize3D.d.ts +49 -0
- package/dist/rendering/world3d/Serialize3D.js +607 -0
- package/dist/rendering/world3d/StateMachine3D.d.ts +78 -0
- package/dist/rendering/world3d/StateMachine3D.js +277 -0
- package/dist/rendering/world3d/Terrain3D.d.ts +227 -0
- package/dist/rendering/world3d/Terrain3D.js +803 -0
- package/dist/rendering/world3d/Text3D.d.ts +90 -0
- package/dist/rendering/world3d/Text3D.js +558 -0
- package/dist/rendering/world3d/Texture3D.d.ts +133 -0
- package/dist/rendering/world3d/Texture3D.js +252 -0
- package/dist/rendering/world3d/Trail3D.d.ts +59 -0
- package/dist/rendering/world3d/Trail3D.js +193 -0
- package/dist/rendering/world3d/Vehicle3D.d.ts +97 -0
- package/dist/rendering/world3d/Vehicle3D.js +226 -0
- package/dist/rendering/world3d/VolumetricFog3D.d.ts +55 -0
- package/dist/rendering/world3d/VolumetricFog3D.js +229 -0
- package/dist/rendering/world3d/Water3D.d.ts +163 -0
- package/dist/rendering/world3d/Water3D.js +606 -0
- package/dist/rendering/world3d/core3D.d.ts +34 -0
- package/dist/rendering/world3d/core3D.js +99 -0
- package/dist/rendering/world3d/debug3D.d.ts +64 -0
- package/dist/rendering/world3d/debug3D.js +257 -0
- package/dist/rendering/world3d/decoders3D.d.ts +42 -0
- package/dist/rendering/world3d/decoders3D.js +133 -0
- package/dist/rendering/world3d/geometries3D.d.ts +99 -0
- package/dist/rendering/world3d/geometries3D.js +605 -0
- package/dist/rendering/world3d/helpers3D.d.ts +65 -0
- package/dist/rendering/world3d/helpers3D.js +177 -0
- package/dist/rendering/world3d/index.d.ts +91 -0
- package/dist/rendering/world3d/index.js +56 -0
- package/dist/rendering/world3d/math3D.d.ts +78 -0
- package/dist/rendering/world3d/math3D.js +640 -0
- package/dist/rendering/world3d/primitives3D.d.ts +60 -0
- package/dist/rendering/world3d/primitives3D.js +196 -0
- package/dist/resources.d.ts +8 -0
- package/dist/resources.js +6 -0
- package/dist/saveStore.d.ts +56 -0
- package/dist/saveStore.js +163 -0
- package/dist/semanticList.d.ts +122 -0
- package/dist/semanticList.js +174 -0
- package/dist/semanticTree.d.ts +10 -0
- package/dist/semanticTree.js +532 -0
- package/dist/semanticTypes.d.ts +167 -0
- package/dist/semanticTypes.js +2 -0
- package/dist/semantics.d.ts +6 -0
- package/dist/semantics.js +5 -0
- package/dist/sequencePlayback.d.ts +19 -0
- package/dist/sequencePlayback.js +391 -0
- package/dist/sequencePlaybackTypes.d.ts +21 -0
- package/dist/sequencePlaybackTypes.js +2 -0
- package/dist/sequenceTargetClaims.d.ts +10 -0
- package/dist/sequenceTargetClaims.js +31 -0
- package/dist/srgbBytes.d.ts +3 -0
- package/dist/srgbBytes.js +64 -0
- package/dist/startEngine.d.ts +5 -0
- package/dist/startEngine.js +31 -0
- package/dist/surfaceOwnership.d.ts +3 -0
- package/dist/surfaceOwnership.js +15 -0
- package/dist/text.d.ts +23 -0
- package/dist/text.js +4 -0
- package/dist/textField.d.ts +6 -0
- package/dist/textField.js +6 -0
- package/dist/tileMapDraw.d.ts +7 -0
- package/dist/tileMapDraw.js +310 -0
- package/dist/tiledImport.d.ts +9 -0
- package/dist/tiledImport.js +357 -0
- package/dist/tilemap.d.ts +5 -0
- package/dist/tilemap.js +5 -0
- package/dist/tilemapTypes.d.ts +169 -0
- package/dist/tilemapTypes.js +2 -0
- package/dist/tween.d.ts +15 -0
- package/dist/tween.js +329 -0
- package/dist/tweenTypes.d.ts +27 -0
- package/dist/tweenTypes.js +2 -0
- package/dist/ui/controlKeys.d.ts +109 -0
- package/dist/ui/controlKeys.js +249 -0
- package/dist/ui/controls.d.ts +52 -0
- package/dist/ui/controls.js +288 -0
- package/dist/ui/editing.d.ts +3 -0
- package/dist/ui/editing.js +3 -0
- package/dist/ui/index.d.ts +19 -0
- package/dist/ui/index.js +11 -0
- package/dist/ui/keyboardFocus.d.ts +32 -0
- package/dist/ui/keyboardFocus.js +146 -0
- package/dist/ui/layerTypes.d.ts +91 -0
- package/dist/ui/layerTypes.js +2 -0
- package/dist/ui/layers.d.ts +4 -0
- package/dist/ui/layers.js +586 -0
- package/dist/ui/leafContent.d.ts +21 -0
- package/dist/ui/leafContent.js +136 -0
- package/dist/ui/rangeControl.d.ts +50 -0
- package/dist/ui/rangeControl.js +167 -0
- package/dist/ui/scrollControl.d.ts +72 -0
- package/dist/ui/scrollControl.js +218 -0
- package/dist/ui/stateControls.d.ts +82 -0
- package/dist/ui/stateControls.js +328 -0
- package/dist/ui/textEditor.d.ts +53 -0
- package/dist/ui/textEditor.js +370 -0
- package/dist/ui/textEditorTypes.d.ts +78 -0
- package/dist/ui/textEditorTypes.js +2 -0
- package/dist/ui/textFieldControl.d.ts +96 -0
- package/dist/ui/textFieldControl.js +259 -0
- package/dist/ui/theme.d.ts +59 -0
- package/dist/ui/theme.js +165 -0
- package/dist/ui/types.d.ts +265 -0
- package/dist/ui/types.js +2 -0
- package/dist/ui/uiRoot.d.ts +4 -0
- package/dist/ui/uiRoot.js +1497 -0
- package/dist/ui/uiRootDisplay.d.ts +46 -0
- package/dist/ui/uiRootDisplay.js +148 -0
- package/dist/ui/uiRootModel.d.ts +112 -0
- package/dist/ui/uiRootModel.js +60 -0
- package/dist/ui/virtualList.d.ts +20 -0
- package/dist/ui/virtualList.js +105 -0
- package/dist/video.d.ts +4 -0
- package/dist/video.js +4 -0
- package/dist/videoPlayer.d.ts +4 -0
- package/dist/videoPlayer.js +215 -0
- package/dist/videoTypes.d.ts +74 -0
- package/dist/videoTypes.js +2 -0
- package/dist/web/BrowserAssetBundle.d.ts +39 -0
- package/dist/web/BrowserAssetBundle.js +136 -0
- package/dist/web/BrowserAudio.d.ts +41 -0
- package/dist/web/BrowserAudio.js +473 -0
- package/dist/web/BrowserFrameLoop.d.ts +65 -0
- package/dist/web/BrowserFrameLoop.js +125 -0
- package/dist/web/BrowserGame.d.ts +112 -0
- package/dist/web/BrowserGame.js +352 -0
- package/dist/web/BrowserGamepadInput.d.ts +35 -0
- package/dist/web/BrowserGamepadInput.js +134 -0
- package/dist/web/BrowserHoverInput.d.ts +24 -0
- package/dist/web/BrowserHoverInput.js +266 -0
- package/dist/web/BrowserImageTextures.d.ts +66 -0
- package/dist/web/BrowserImageTextures.js +169 -0
- package/dist/web/BrowserInputActions.d.ts +53 -0
- package/dist/web/BrowserInputActions.js +342 -0
- package/dist/web/BrowserKeyboardInput.d.ts +4 -0
- package/dist/web/BrowserKeyboardInput.js +223 -0
- package/dist/web/BrowserPlay.d.ts +289 -0
- package/dist/web/BrowserPlay.js +1301 -0
- package/dist/web/BrowserPointerInput.d.ts +4 -0
- package/dist/web/BrowserPointerInput.js +511 -0
- package/dist/web/BrowserSemantics.d.ts +34 -0
- package/dist/web/BrowserSemantics.js +418 -0
- package/dist/web/BrowserStatsPanel.d.ts +46 -0
- package/dist/web/BrowserStatsPanel.js +137 -0
- package/dist/web/BrowserStorage.d.ts +33 -0
- package/dist/web/BrowserStorage.js +132 -0
- package/dist/web/BrowserTextEditor.d.ts +49 -0
- package/dist/web/BrowserTextEditor.js +839 -0
- package/dist/web/BrowserTextInput.d.ts +83 -0
- package/dist/web/BrowserTextInput.js +524 -0
- package/dist/web/BrowserTextureProvider.d.ts +52 -0
- package/dist/web/BrowserTextureProvider.js +935 -0
- package/dist/web/BrowserVideo.d.ts +28 -0
- package/dist/web/BrowserVideo.js +211 -0
- package/dist/web/CanvasKitFontSetProvider.d.ts +29 -0
- package/dist/web/CanvasKitFontSetProvider.js +215 -0
- package/dist/web/CanvasKitParagraphProvider.d.ts +169 -0
- package/dist/web/CanvasKitParagraphProvider.js +691 -0
- package/dist/web/CanvasTextRasterProvider.d.ts +4 -0
- package/dist/web/CanvasTextRasterProvider.js +312 -0
- package/dist/web/ManifestByteSource.d.ts +147 -0
- package/dist/web/ManifestByteSource.js +974 -0
- package/dist/web/ManifestFontContentLoader.d.ts +12 -0
- package/dist/web/ManifestFontContentLoader.js +30 -0
- package/dist/web/MouseInput.d.ts +4 -0
- package/dist/web/MouseInput.js +218 -0
- package/dist/web/WebGL2Host.d.ts +5 -0
- package/dist/web/WebGL2Host.js +2672 -0
- package/dist/web/WebGPUHost.d.ts +87 -0
- package/dist/web/WebGPUHost.js +3349 -0
- package/dist/web/audio.d.ts +3 -0
- package/dist/web/audio.js +4 -0
- package/dist/web/canvasKitParagraphGeometry.d.ts +27 -0
- package/dist/web/canvasKitParagraphGeometry.js +83 -0
- package/dist/web/editing.d.ts +5 -0
- package/dist/web/editing.js +4 -0
- package/dist/web/editorFonts.d.ts +50 -0
- package/dist/web/editorFonts.js +297 -0
- package/dist/web/game.d.ts +5 -0
- package/dist/web/game.js +6 -0
- package/dist/web/gamepad.d.ts +3 -0
- package/dist/web/gamepad.js +4 -0
- package/dist/web/hover.d.ts +3 -0
- package/dist/web/hover.js +4 -0
- package/dist/web/image.d.ts +4 -0
- package/dist/web/image.js +4 -0
- package/dist/web/imageProjections2D.d.ts +14 -0
- package/dist/web/imageProjections2D.js +2 -0
- package/dist/web/input.d.ts +6 -0
- package/dist/web/input.js +4 -0
- package/dist/web/keyboard.d.ts +3 -0
- package/dist/web/keyboard.js +3 -0
- package/dist/web/kit.d.ts +10 -0
- package/dist/web/kit.js +7 -0
- package/dist/web/loop.d.ts +3 -0
- package/dist/web/loop.js +4 -0
- package/dist/web/paragraph.d.ts +6 -0
- package/dist/web/paragraph.js +4 -0
- package/dist/web/play.d.ts +5 -0
- package/dist/web/play.js +6 -0
- package/dist/web/playSfx.d.ts +36 -0
- package/dist/web/playSfx.js +112 -0
- package/dist/web/pointer.d.ts +3 -0
- package/dist/web/pointer.js +3 -0
- package/dist/web/prepareSharedSubmission2D.d.ts +27 -0
- package/dist/web/prepareSharedSubmission2D.js +57 -0
- package/dist/web/resources.d.ts +27 -0
- package/dist/web/resources.js +96 -0
- package/dist/web/semantics.d.ts +3 -0
- package/dist/web/semantics.js +4 -0
- package/dist/web/sharedDeviceSession.d.ts +64 -0
- package/dist/web/sharedDeviceSession.js +2 -0
- package/dist/web/sharedEffectShaders.d.ts +9 -0
- package/dist/web/sharedEffectShaders.js +165 -0
- package/dist/web/sharedFrameUpload.d.ts +25 -0
- package/dist/web/sharedFrameUpload.js +2 -0
- package/dist/web/sharedHostDeferred.d.ts +7 -0
- package/dist/web/sharedHostDeferred.js +12 -0
- package/dist/web/sharedRetentionLedger.d.ts +85 -0
- package/dist/web/sharedRetentionLedger.js +391 -0
- package/dist/web/sharedSubmissionStorage2D.d.ts +56 -0
- package/dist/web/sharedSubmissionStorage2D.js +73 -0
- package/dist/web/sharedWebGL2Arena.d.ts +40 -0
- package/dist/web/sharedWebGL2Arena.js +77 -0
- package/dist/web/sharedWebGL2Options.d.ts +30 -0
- package/dist/web/sharedWebGL2Options.js +96 -0
- package/dist/web/sharedWebGL2Shaders.d.ts +20 -0
- package/dist/web/sharedWebGL2Shaders.js +314 -0
- package/dist/web/sharedWebGPUOptions.d.ts +37 -0
- package/dist/web/sharedWebGPUOptions.js +126 -0
- package/dist/web/text.d.ts +3 -0
- package/dist/web/text.js +3 -0
- package/dist/web/textInput.d.ts +3 -0
- package/dist/web/textInput.js +3 -0
- package/dist/web/video.d.ts +3 -0
- package/dist/web/video.js +4 -0
- package/dist/web/webgl2.d.ts +7 -0
- package/dist/web/webgl2.js +4 -0
- package/dist/web/webgl2LayerState.d.ts +50 -0
- package/dist/web/webgl2LayerState.js +102 -0
- package/dist/web/webgl2Native.d.ts +70 -0
- package/dist/web/webgl2Native.js +568 -0
- package/dist/web/webgl2Types.d.ts +132 -0
- package/dist/web/webgl2Types.js +2 -0
- package/dist/web/webgpu.d.ts +6 -0
- package/dist/web/webgpu.js +2 -0
- package/dist/web/webgpuBindingCache.d.ts +26 -0
- package/dist/web/webgpuBindingCache.js +223 -0
- package/dist/web/webgpuBufferPool.d.ts +51 -0
- package/dist/web/webgpuBufferPool.js +58 -0
- package/dist/web/webgpuImageResidency.d.ts +53 -0
- package/dist/web/webgpuImageResidency.js +61 -0
- package/dist/web/webgpuLifetime.d.ts +45 -0
- package/dist/web/webgpuLifetime.js +64 -0
- package/dist/web/webgpuRetentionPool.d.ts +66 -0
- package/dist/web/webgpuRetentionPool.js +84 -0
- package/dist/web/webgpuSharedPass.d.ts +7 -0
- package/dist/web/webgpuSharedPass.js +211 -0
- package/dist/web/webgpuSharedResolvePass.d.ts +3 -0
- package/dist/web/webgpuSharedResolvePass.js +29 -0
- package/dist/web/world3d/Audio3D.d.ts +68 -0
- package/dist/web/world3d/Audio3D.js +212 -0
- package/dist/web/world3d/BrowserPlay3D.d.ts +182 -0
- package/dist/web/world3d/BrowserPlay3D.js +851 -0
- package/dist/web/world3d/FlyControls3D.d.ts +55 -0
- package/dist/web/world3d/FlyControls3D.js +160 -0
- package/dist/web/world3d/FollowControls3D.d.ts +28 -0
- package/dist/web/world3d/FollowControls3D.js +117 -0
- package/dist/web/world3d/OrbitControls3D.d.ts +55 -0
- package/dist/web/world3d/OrbitControls3D.js +187 -0
- package/dist/web/world3d/TransformControls3D.d.ts +34 -0
- package/dist/web/world3d/TransformControls3D.js +125 -0
- package/dist/web/world3d/WebGL2Renderer3D.d.ts +133 -0
- package/dist/web/world3d/WebGL2Renderer3D.js +1173 -0
- package/dist/web/world3d/WebGPURenderer3D.d.ts +110 -0
- package/dist/web/world3d/WebGPURenderer3D.js +1915 -0
- package/dist/web/world3d/World3DView.d.ts +51 -0
- package/dist/web/world3d/World3DView.js +77 -0
- package/dist/web/world3d/app3D.d.ts +136 -0
- package/dist/web/world3d/app3D.js +304 -0
- package/dist/web/world3d/assets3D.d.ts +38 -0
- package/dist/web/world3d/assets3D.js +112 -0
- package/dist/web/world3d/atmosphere3D.d.ts +47 -0
- package/dist/web/world3d/atmosphere3D.js +178 -0
- package/dist/web/world3d/frame3D.d.ts +142 -0
- package/dist/web/world3d/frame3D.js +388 -0
- package/dist/web/world3d/gpuResources3D.d.ts +98 -0
- package/dist/web/world3d/gpuResources3D.js +901 -0
- package/dist/web/world3d/host3D.d.ts +23 -0
- package/dist/web/world3d/host3D.js +61 -0
- package/dist/web/world3d/index.d.ts +38 -0
- package/dist/web/world3d/index.js +23 -0
- package/dist/web/world3d/loaders3D.d.ts +26 -0
- package/dist/web/world3d/loaders3D.js +138 -0
- package/dist/web/world3d/markers3D.d.ts +49 -0
- package/dist/web/world3d/markers3D.js +130 -0
- package/dist/web/world3d/materialWebGL23D.d.ts +34 -0
- package/dist/web/world3d/materialWebGL23D.js +218 -0
- package/dist/web/world3d/overlay3D.d.ts +28 -0
- package/dist/web/world3d/overlay3D.js +170 -0
- package/dist/web/world3d/post3D.d.ts +112 -0
- package/dist/web/world3d/post3D.js +459 -0
- package/dist/web/world3d/postWebGL23D.d.ts +24 -0
- package/dist/web/world3d/postWebGL23D.js +237 -0
- package/dist/web/world3d/postWebGPU3D.d.ts +23 -0
- package/dist/web/world3d/postWebGPU3D.js +255 -0
- package/dist/web/world3d/probe3D.d.ts +14 -0
- package/dist/web/world3d/probe3D.js +66 -0
- package/dist/web/world3d/shaders3D.d.ts +43 -0
- package/dist/web/world3d/shaders3D.js +851 -0
- package/dist/web/world3d/stats3D.d.ts +31 -0
- package/dist/web/world3d/stats3D.js +80 -0
- package/dist/web/world3d/webGL2FrameMetrics3D.d.ts +66 -0
- package/dist/web/world3d/webGL2FrameMetrics3D.js +185 -0
- package/dist/web/world3d/webgpu.d.ts +35 -0
- package/dist/web/world3d/webgpu.js +22 -0
- package/dist/web/world3d/webgpuPacking3D.d.ts +13 -0
- package/dist/web/world3d/webgpuPacking3D.js +85 -0
- package/dist/web/world3d/wgsl3D.d.ts +68 -0
- package/dist/web/world3d/wgsl3D.js +781 -0
- package/package.json +220 -4
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a control is to someone who cannot see the canvas. The set is closed: it is the first
|
|
3
|
+
* control set of the UI, and each role is projected to the page in one known way.
|
|
4
|
+
*/
|
|
5
|
+
export type SemanticRole = 'group' | 'image' | 'text' | 'button' | 'checkbox' | 'switch' | 'radiogroup' | 'radio' | 'listbox' | 'option' | 'list' | 'listitem' | 'scrollbar' | 'slider' | 'spinbutton' | 'progressbar' | 'tablist' | 'tab' | 'tabpanel' | 'menu' | 'menuitem' | 'dialog' | 'textbox' | 'status' | 'alert' | 'grid' | 'row' | 'gridcell' | 'columnheader' | 'tree' | 'treeitem' | 'heading';
|
|
6
|
+
/** What assistive technology may ask of a node: its activation, or the keyboard focus. */
|
|
7
|
+
export type SemanticAction = 'activate' | 'focus';
|
|
8
|
+
export type SemanticChecked = boolean | 'mixed';
|
|
9
|
+
export type SemanticOrientation = 'horizontal' | 'vertical';
|
|
10
|
+
/** How the rows of a grid are ordered by one of its columns. */
|
|
11
|
+
export type SemanticSort = 'ascending' | 'descending' | 'none';
|
|
12
|
+
export type SemanticsState = 'active' | 'closed';
|
|
13
|
+
/** A rectangle in the logical coordinates of the stage, the ones picking uses. */
|
|
14
|
+
export interface SemanticBounds {
|
|
15
|
+
readonly x: number;
|
|
16
|
+
readonly y: number;
|
|
17
|
+
readonly width: number;
|
|
18
|
+
readonly height: number;
|
|
19
|
+
}
|
|
20
|
+
export interface SemanticRange {
|
|
21
|
+
readonly now: number;
|
|
22
|
+
readonly min: number;
|
|
23
|
+
readonly max: number;
|
|
24
|
+
}
|
|
25
|
+
/** How many rows and columns a grid has in all, whether or not all of them are published. */
|
|
26
|
+
export interface SemanticExtent {
|
|
27
|
+
readonly rows: number;
|
|
28
|
+
readonly columns: number;
|
|
29
|
+
}
|
|
30
|
+
/** Where an item stands in its whole set, from one. A virtual list reports the set, not what is realized. */
|
|
31
|
+
export interface SemanticPosition {
|
|
32
|
+
readonly index: number;
|
|
33
|
+
readonly size: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* What a node is at this moment, read from the control that draws it. `describe` returns one of
|
|
37
|
+
* these each time the tree is published, so there is no second copy of the state to keep in step.
|
|
38
|
+
*/
|
|
39
|
+
export interface SemanticDescription {
|
|
40
|
+
readonly bounds: SemanticBounds;
|
|
41
|
+
/** The accessible name. For a `text` node and a `heading` it is the text itself, and for a `status` or an `alert` the message, which may be empty. */
|
|
42
|
+
readonly name?: string;
|
|
43
|
+
/** The text of a `textbox`. */
|
|
44
|
+
readonly value?: string;
|
|
45
|
+
/** A hidden node is left out with everything under it, and what is under it is not asked. */
|
|
46
|
+
readonly hidden?: boolean;
|
|
47
|
+
readonly disabled?: boolean;
|
|
48
|
+
/** Whether the node holds the keyboard focus of the application. At most one node may. */
|
|
49
|
+
readonly focused?: boolean;
|
|
50
|
+
/** `checkbox`, `switch` and `radio`. Only a checkbox may be 'mixed'. */
|
|
51
|
+
readonly checked?: SemanticChecked;
|
|
52
|
+
/** `option` and `tab`, which need it. A `row`, a `gridcell` and a `treeitem` say it where they are what is selected. */
|
|
53
|
+
readonly selected?: boolean;
|
|
54
|
+
/** `button`: whether what it opens is open. `treeitem`: whether what is under it shows; one with nothing under it does not say. */
|
|
55
|
+
readonly expanded?: boolean;
|
|
56
|
+
/** `dialog`: while a modal dialog is published, everything outside it is inert. */
|
|
57
|
+
readonly modal?: boolean;
|
|
58
|
+
/** `textbox`. */
|
|
59
|
+
readonly multiline?: boolean;
|
|
60
|
+
/** `listbox`, `grid` and `tree`: whether several of its options, rows or items may be selected at once. */
|
|
61
|
+
readonly multiple?: boolean;
|
|
62
|
+
/** `grid`: its rows and columns in all. */
|
|
63
|
+
readonly extent?: SemanticExtent;
|
|
64
|
+
/** `treeitem`, which needs it: how deep it is, from one. `heading`: its rank, from one to six. */
|
|
65
|
+
readonly level?: number;
|
|
66
|
+
/** `columnheader`: whether the rows are ordered by this column, and which way. One that does not say cannot be sorted by. */
|
|
67
|
+
readonly sort?: SemanticSort;
|
|
68
|
+
/** `scrollbar`, `slider` and `spinbutton`, which need it, and `progressbar`, which without it shows work of unknown length. */
|
|
69
|
+
readonly range?: SemanticRange;
|
|
70
|
+
/** `scrollbar`, `slider`, `tablist` and `menu`. */
|
|
71
|
+
readonly orientation?: SemanticOrientation;
|
|
72
|
+
/** `scrollbar`: the id of the node it scrolls. `tab`: the id of its panel. The node must be published with it. */
|
|
73
|
+
readonly controls?: string;
|
|
74
|
+
/** `radio`, `option`, `listitem`, `tab` and `menuitem`. For a `row` it is which row of the grid it is, and for a `gridcell` or a `columnheader` which column it is in. */
|
|
75
|
+
readonly position?: SemanticPosition;
|
|
76
|
+
/** Reading order among the nodes of one parent, lowest first. Equal values keep the order of addition. */
|
|
77
|
+
readonly order?: number;
|
|
78
|
+
}
|
|
79
|
+
export interface SemanticNodeOptions {
|
|
80
|
+
/** One to 128 characters, distinct among the nodes of the tree. */
|
|
81
|
+
readonly id: string;
|
|
82
|
+
readonly role: SemanticRole;
|
|
83
|
+
/** The id of the node this one is inside. Without it the node is at the top. */
|
|
84
|
+
readonly parent?: string;
|
|
85
|
+
readonly describe: () => SemanticDescription;
|
|
86
|
+
/** The same activation a completed press or a key reaches. Without it the node cannot be activated. */
|
|
87
|
+
readonly onActivate?: () => void;
|
|
88
|
+
/** Moves the keyboard focus of the application to the control. Without it the node cannot be focused. */
|
|
89
|
+
readonly onFocus?: () => void;
|
|
90
|
+
}
|
|
91
|
+
export interface SemanticNode {
|
|
92
|
+
readonly id: string;
|
|
93
|
+
readonly role: SemanticRole;
|
|
94
|
+
readonly parent: string | undefined;
|
|
95
|
+
/** False once the node, or a node it is inside, was removed. */
|
|
96
|
+
readonly attached: boolean;
|
|
97
|
+
/** Removes the node and everything inside it. The next publication no longer has them. */
|
|
98
|
+
remove(): void;
|
|
99
|
+
}
|
|
100
|
+
/** One published node. Frozen, and the same object from one snapshot to the next while nothing in it changed. */
|
|
101
|
+
export interface SemanticSnapshotNode {
|
|
102
|
+
readonly id: string;
|
|
103
|
+
readonly role: SemanticRole;
|
|
104
|
+
readonly parent: string | undefined;
|
|
105
|
+
readonly name: string;
|
|
106
|
+
readonly bounds: SemanticBounds;
|
|
107
|
+
readonly disabled: boolean;
|
|
108
|
+
readonly focused: boolean;
|
|
109
|
+
/** Outside the modal dialog that is published last. An inert node refuses every action. */
|
|
110
|
+
readonly inert: boolean;
|
|
111
|
+
readonly actions: readonly SemanticAction[];
|
|
112
|
+
readonly value: string | undefined;
|
|
113
|
+
readonly checked: SemanticChecked | undefined;
|
|
114
|
+
readonly selected: boolean | undefined;
|
|
115
|
+
readonly expanded: boolean | undefined;
|
|
116
|
+
readonly modal: boolean | undefined;
|
|
117
|
+
readonly multiline: boolean | undefined;
|
|
118
|
+
readonly multiple: boolean | undefined;
|
|
119
|
+
readonly extent: SemanticExtent | undefined;
|
|
120
|
+
readonly sort: SemanticSort | undefined;
|
|
121
|
+
readonly level: number | undefined;
|
|
122
|
+
readonly range: SemanticRange | undefined;
|
|
123
|
+
readonly orientation: SemanticOrientation | undefined;
|
|
124
|
+
readonly controls: string | undefined;
|
|
125
|
+
readonly position: SemanticPosition | undefined;
|
|
126
|
+
}
|
|
127
|
+
export interface SemanticSnapshot {
|
|
128
|
+
/** Grows by one with every publication that differs from the one before. */
|
|
129
|
+
readonly revision: number;
|
|
130
|
+
/** The layout revision the bounds belong to, as given to `publish`. */
|
|
131
|
+
readonly layoutRevision: number | undefined;
|
|
132
|
+
/** Every published node, a parent before what is inside it, in reading order. */
|
|
133
|
+
readonly nodes: readonly SemanticSnapshotNode[];
|
|
134
|
+
readonly focused: string | undefined;
|
|
135
|
+
}
|
|
136
|
+
export interface UiSemanticsOptions {
|
|
137
|
+
/** Most nodes the tree holds at once. Defaults to 256, and is at most 4,096. */
|
|
138
|
+
readonly maxNodes?: number;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* The semantic tree of a UI the application draws: what each control is, what it is called and
|
|
142
|
+
* what state it is in. It is a description of the same controls, read from them at each
|
|
143
|
+
* publication, and it performs the same activations. It draws nothing and touches no page.
|
|
144
|
+
*/
|
|
145
|
+
export interface UiSemantics {
|
|
146
|
+
readonly state: SemanticsState;
|
|
147
|
+
/** The last publication. Before the first it is revision 0 with no nodes. */
|
|
148
|
+
readonly snapshot: SemanticSnapshot;
|
|
149
|
+
/** Nodes held now, published or not. */
|
|
150
|
+
readonly size: number;
|
|
151
|
+
add(options: SemanticNodeOptions): SemanticNode;
|
|
152
|
+
/**
|
|
153
|
+
* Reads every node and publishes the tree as one snapshot. A failure publishes nothing and the
|
|
154
|
+
* snapshot before it stays. A publication equal to the last returns that snapshot unchanged.
|
|
155
|
+
*/
|
|
156
|
+
publish(layoutRevision?: number): SemanticSnapshot;
|
|
157
|
+
/**
|
|
158
|
+
* Performs an action on a published node. False when the node is not published, was removed,
|
|
159
|
+
* is disabled or inert, or does not offer the action.
|
|
160
|
+
*/
|
|
161
|
+
perform(id: string, action: SemanticAction): boolean;
|
|
162
|
+
/** Told after each publication that differs. The returned function stops it. */
|
|
163
|
+
observe(listener: (snapshot: SemanticSnapshot, previous: SemanticSnapshot) => void): () => void;
|
|
164
|
+
onClose(listener: () => void): () => void;
|
|
165
|
+
dispose(): void;
|
|
166
|
+
}
|
|
167
|
+
//# sourceMappingURL=semanticTypes.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Optional semantic tree of a drawn UI: no page, listener or renderer is loaded by this entry. */
|
|
2
|
+
export { createUiSemantics, semanticBoundsOf } from './semanticTree.js';
|
|
3
|
+
export { createUiListSemantics, semanticBoxOf } from './semanticList.js';
|
|
4
|
+
export type { SemanticListRow, SemanticListSource, UiListSemantics, UiListSemanticsOptions } from './semanticList.js';
|
|
5
|
+
export type { SemanticAction, SemanticBounds, SemanticChecked, SemanticDescription, SemanticExtent, SemanticNode, SemanticNodeOptions, SemanticOrientation, SemanticPosition, SemanticRange, SemanticRole, SemanticSnapshot, SemanticSnapshotNode, SemanticSort, SemanticsState, UiSemantics, UiSemanticsOptions } from './semanticTypes.js';
|
|
6
|
+
//# sourceMappingURL=semantics.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
/** Optional semantic tree of a drawn UI: no page, listener or renderer is loaded by this entry. */
|
|
3
|
+
export { createUiSemantics, semanticBoundsOf } from './semanticTree.js';
|
|
4
|
+
export { createUiListSemantics, semanticBoxOf } from './semanticList.js';
|
|
5
|
+
//# sourceMappingURL=semantics.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Scope } from '@egret/runtime';
|
|
2
|
+
import type { Bitmap, SequenceClip } from '@egret/runtime';
|
|
3
|
+
import type { GameClock } from './gameClockTypes.js';
|
|
4
|
+
import type { SequencePlayback } from './sequencePlaybackTypes.js';
|
|
5
|
+
import type { SequenceTargetClaims } from './sequenceTargetClaims.js';
|
|
6
|
+
export interface SequencePlaybackContext {
|
|
7
|
+
assertOpen(): void;
|
|
8
|
+
isEngineScope(scope: unknown): scope is Scope;
|
|
9
|
+
readonly clock: GameClock;
|
|
10
|
+
readonly claims: SequenceTargetClaims;
|
|
11
|
+
captureCleanup(cause: unknown): void;
|
|
12
|
+
}
|
|
13
|
+
export interface SequencePlaybackOwner {
|
|
14
|
+
create(scope: unknown, bitmap: Bitmap, clip: SequenceClip, options: unknown): SequencePlayback;
|
|
15
|
+
close(): void;
|
|
16
|
+
}
|
|
17
|
+
/** Only private Engine assembly owns inventory and authentic-clock subscriptions. */
|
|
18
|
+
export declare function createSequencePlaybackOwner(context: SequencePlaybackContext): SequencePlaybackOwner;
|
|
19
|
+
//# sourceMappingURL=sequencePlayback.d.ts.map
|
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
import { EgretError, Scope, SequencePlayer } from '@egret/runtime';
|
|
3
|
+
const MAX_PLAYBACKS = 256;
|
|
4
|
+
const playerConstructor = SequencePlayer;
|
|
5
|
+
const playerApply = SequencePlayer.prototype.applyAt;
|
|
6
|
+
const playerDispose = SequencePlayer.prototype.dispose;
|
|
7
|
+
const scopeUse = Scope.prototype.use;
|
|
8
|
+
const scopeState = Object.getOwnPropertyDescriptor(Scope.prototype, 'state').get;
|
|
9
|
+
const apply = Reflect.apply;
|
|
10
|
+
/** A shared receiver-only bridge retains no individual player or resource borrow. */
|
|
11
|
+
function disposeOwnedPlayer() {
|
|
12
|
+
apply(playerDispose, this, []);
|
|
13
|
+
}
|
|
14
|
+
function isTerminal(state) {
|
|
15
|
+
return state === 'completed' || state === 'stopped' || state === 'failed';
|
|
16
|
+
}
|
|
17
|
+
/** Authentic membership and the captured state getter precede payload reads. */
|
|
18
|
+
function assertLifetime(context, scope) {
|
|
19
|
+
context.assertOpen();
|
|
20
|
+
if (!context.isEngineScope(scope))
|
|
21
|
+
throw new EgretError('SEQ_PLAYBACK_SCOPE_INVALID');
|
|
22
|
+
if (apply(scopeState, scope, []) !== 'open')
|
|
23
|
+
throw new EgretError('SCOPE_CLOSED');
|
|
24
|
+
}
|
|
25
|
+
function scopeIsOpen(record) {
|
|
26
|
+
return record.context.isEngineScope(record.scope) && apply(scopeState, record.scope, []) === 'open';
|
|
27
|
+
}
|
|
28
|
+
function admitMode(context, scope, options) {
|
|
29
|
+
if (options === undefined)
|
|
30
|
+
return 'once';
|
|
31
|
+
if (options === null || typeof options !== 'object')
|
|
32
|
+
throw new EgretError('SEQ_PLAYBACK_OPTIONS_INVALID');
|
|
33
|
+
let array;
|
|
34
|
+
try {
|
|
35
|
+
array = Array.isArray(options);
|
|
36
|
+
}
|
|
37
|
+
catch (cause) {
|
|
38
|
+
throw new EgretError('SEQ_PLAYBACK_OPTIONS_INVALID', { cause });
|
|
39
|
+
}
|
|
40
|
+
if (array)
|
|
41
|
+
throw new EgretError('SEQ_PLAYBACK_OPTIONS_INVALID');
|
|
42
|
+
assertLifetime(context, scope);
|
|
43
|
+
let mode;
|
|
44
|
+
try {
|
|
45
|
+
mode = options.mode;
|
|
46
|
+
}
|
|
47
|
+
catch (cause) {
|
|
48
|
+
throw new EgretError('SEQ_PLAYBACK_OPTIONS_INVALID', { cause });
|
|
49
|
+
}
|
|
50
|
+
// A throwing read preserves its own occurrence, including throw undefined.
|
|
51
|
+
assertLifetime(context, scope);
|
|
52
|
+
// The authentic player owns enum validation after its original resource checks.
|
|
53
|
+
return (mode === undefined ? 'once' : mode);
|
|
54
|
+
}
|
|
55
|
+
function captureSecondary(context, cause) {
|
|
56
|
+
// Cleanup recording must not prevent the original Engine close barriers.
|
|
57
|
+
try {
|
|
58
|
+
context.captureCleanup(cause);
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
/* A recording failure cannot replace an already chosen primary cause. */
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/** Terminal identity is committed before cleanup; every acquired entry is attempted. */
|
|
65
|
+
function retire(record, terminal, preservePrimary = false) {
|
|
66
|
+
if (isTerminal(record.state))
|
|
67
|
+
return;
|
|
68
|
+
record.state = terminal;
|
|
69
|
+
const subscription = record.subscription;
|
|
70
|
+
const player = record.player;
|
|
71
|
+
const target = record.target;
|
|
72
|
+
const owner = record.owner;
|
|
73
|
+
const claims = record.claims;
|
|
74
|
+
record.subscription = undefined;
|
|
75
|
+
record.player = undefined;
|
|
76
|
+
record.target = undefined;
|
|
77
|
+
record.clip = undefined;
|
|
78
|
+
record.owner = undefined;
|
|
79
|
+
record.claims = undefined;
|
|
80
|
+
// Scope/context remain only lifecycle authority; this is no physical-GC claim.
|
|
81
|
+
let failed = false;
|
|
82
|
+
let firstFailure;
|
|
83
|
+
function attempt(cleanup) {
|
|
84
|
+
try {
|
|
85
|
+
cleanup();
|
|
86
|
+
}
|
|
87
|
+
catch (cause) {
|
|
88
|
+
if (!failed) {
|
|
89
|
+
failed = true;
|
|
90
|
+
firstFailure = cause;
|
|
91
|
+
}
|
|
92
|
+
captureSecondary(record.context, cause);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
if (target !== undefined && claims !== undefined)
|
|
96
|
+
attempt(() => {
|
|
97
|
+
// An old Scope's historical handle must never remove a newer target claim.
|
|
98
|
+
claims.release(target, record);
|
|
99
|
+
});
|
|
100
|
+
if (owner !== undefined)
|
|
101
|
+
attempt(() => {
|
|
102
|
+
owner.delete(record);
|
|
103
|
+
});
|
|
104
|
+
if (subscription !== undefined)
|
|
105
|
+
attempt(() => {
|
|
106
|
+
subscription.dispose();
|
|
107
|
+
});
|
|
108
|
+
if (player !== undefined)
|
|
109
|
+
attempt(() => {
|
|
110
|
+
apply(playerDispose, player, []);
|
|
111
|
+
});
|
|
112
|
+
if (failed && !preservePrimary)
|
|
113
|
+
throw firstFailure;
|
|
114
|
+
}
|
|
115
|
+
function assertControl(record) {
|
|
116
|
+
assertLifetime(record.context, record.scope);
|
|
117
|
+
if (record.operationBusy)
|
|
118
|
+
throw new EgretError('SEQ_PLAYBACK_REENTRANT');
|
|
119
|
+
if (isTerminal(record.state))
|
|
120
|
+
throw new EgretError('SEQ_PLAYBACK_TERMINAL');
|
|
121
|
+
}
|
|
122
|
+
/** A stopped transaction cannot commit observations or reacquire a registration. */
|
|
123
|
+
function canCommit(record, expected) {
|
|
124
|
+
if (record.state !== expected || isTerminal(record.state))
|
|
125
|
+
return false;
|
|
126
|
+
record.context.assertOpen();
|
|
127
|
+
if (!scopeIsOpen(record)) {
|
|
128
|
+
retire(record, 'stopped');
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
return true;
|
|
132
|
+
}
|
|
133
|
+
function makeTickHandler(record) {
|
|
134
|
+
return (tick) => advancePlayback(record, tick);
|
|
135
|
+
}
|
|
136
|
+
function activate(record, expected, elapsed) {
|
|
137
|
+
record.operationBusy = true;
|
|
138
|
+
let applying = false;
|
|
139
|
+
let acquired;
|
|
140
|
+
try {
|
|
141
|
+
// A clock-capacity refusal leaves the idle/paused record available for retry.
|
|
142
|
+
acquired = record.context.clock.onTick(record.scope, makeTickHandler(record));
|
|
143
|
+
if (!canCommit(record, expected)) {
|
|
144
|
+
acquired.dispose();
|
|
145
|
+
acquired = undefined;
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
record.subscription = acquired;
|
|
149
|
+
acquired = undefined;
|
|
150
|
+
applying = true;
|
|
151
|
+
const sample = apply(playerApply, record.player, [elapsed]);
|
|
152
|
+
if (!canCommit(record, expected))
|
|
153
|
+
return;
|
|
154
|
+
const anchor = record.context.clock.elapsedSeconds;
|
|
155
|
+
// Crop success and lifetime confirmation precede all handle observations.
|
|
156
|
+
record.lastSample = sample;
|
|
157
|
+
record.elapsedSeconds = elapsed;
|
|
158
|
+
record.runBase = elapsed;
|
|
159
|
+
record.anchor = anchor;
|
|
160
|
+
record.state = 'running';
|
|
161
|
+
}
|
|
162
|
+
catch (cause) {
|
|
163
|
+
if (acquired !== undefined) {
|
|
164
|
+
try {
|
|
165
|
+
acquired.dispose();
|
|
166
|
+
}
|
|
167
|
+
catch (cleanupCause) {
|
|
168
|
+
captureSecondary(record.context, cleanupCause);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
if (applying)
|
|
172
|
+
retire(record, 'failed', true);
|
|
173
|
+
else if (record.subscription !== undefined) {
|
|
174
|
+
const subscription = record.subscription;
|
|
175
|
+
record.subscription = undefined;
|
|
176
|
+
try {
|
|
177
|
+
subscription.dispose();
|
|
178
|
+
}
|
|
179
|
+
catch (cleanupCause) {
|
|
180
|
+
captureSecondary(record.context, cleanupCause);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
throw cause;
|
|
184
|
+
}
|
|
185
|
+
finally {
|
|
186
|
+
record.operationBusy = false;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
function startPlayback(record) {
|
|
190
|
+
assertControl(record);
|
|
191
|
+
if (record.state !== 'idle')
|
|
192
|
+
throw new EgretError('SEQ_PLAYBACK_ALREADY_STARTED');
|
|
193
|
+
activate(record, 'idle', 0);
|
|
194
|
+
}
|
|
195
|
+
function pausePlayback(record) {
|
|
196
|
+
assertControl(record);
|
|
197
|
+
if (record.state === 'idle')
|
|
198
|
+
throw new EgretError('SEQ_PLAYBACK_NOT_STARTED');
|
|
199
|
+
if (record.state !== 'running')
|
|
200
|
+
return;
|
|
201
|
+
record.operationBusy = true;
|
|
202
|
+
record.state = 'paused';
|
|
203
|
+
const subscription = record.subscription;
|
|
204
|
+
record.subscription = undefined;
|
|
205
|
+
try {
|
|
206
|
+
subscription?.dispose();
|
|
207
|
+
}
|
|
208
|
+
finally {
|
|
209
|
+
record.operationBusy = false;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
function resumePlayback(record) {
|
|
213
|
+
assertControl(record);
|
|
214
|
+
if (record.state === 'idle')
|
|
215
|
+
throw new EgretError('SEQ_PLAYBACK_NOT_STARTED');
|
|
216
|
+
if (record.state === 'paused')
|
|
217
|
+
activate(record, 'paused', record.elapsedSeconds);
|
|
218
|
+
}
|
|
219
|
+
function advancePlayback(record, tick) {
|
|
220
|
+
if (record.state !== 'running')
|
|
221
|
+
return undefined;
|
|
222
|
+
record.operationBusy = true;
|
|
223
|
+
try {
|
|
224
|
+
record.context.assertOpen();
|
|
225
|
+
// Cancellation enters closing before reverse cleanup can reach this handle.
|
|
226
|
+
if (!scopeIsOpen(record)) {
|
|
227
|
+
retire(record, 'stopped');
|
|
228
|
+
return undefined;
|
|
229
|
+
}
|
|
230
|
+
const delta = tick.elapsedSeconds - record.anchor;
|
|
231
|
+
if (delta <= 0)
|
|
232
|
+
return undefined;
|
|
233
|
+
if (!Number.isFinite(delta))
|
|
234
|
+
throw new EgretError('SEQ_PLAYBACK_TIME_RANGE');
|
|
235
|
+
const final = record.mode === 'once' && delta >= record.durationSeconds - record.runBase;
|
|
236
|
+
// Cap once before addition; looping never silently loses a positive interval.
|
|
237
|
+
const elapsed = final ? record.durationSeconds : record.runBase + delta;
|
|
238
|
+
if (!final && (!Number.isFinite(elapsed) || elapsed <= record.elapsedSeconds))
|
|
239
|
+
throw new EgretError('SEQ_PLAYBACK_TIME_RANGE');
|
|
240
|
+
const sample = apply(playerApply, record.player, [elapsed]);
|
|
241
|
+
if (!canCommit(record, 'running'))
|
|
242
|
+
return undefined;
|
|
243
|
+
record.elapsedSeconds = elapsed;
|
|
244
|
+
record.lastSample = sample;
|
|
245
|
+
if (final)
|
|
246
|
+
retire(record, 'completed');
|
|
247
|
+
return undefined;
|
|
248
|
+
}
|
|
249
|
+
catch (cause) {
|
|
250
|
+
retire(record, 'failed', true);
|
|
251
|
+
// The authentic clock alone supplies CLOCK_CALLBACK_FAILED and diagnostics.
|
|
252
|
+
throw cause;
|
|
253
|
+
}
|
|
254
|
+
finally {
|
|
255
|
+
record.operationBusy = false;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
/** Every operation checks the exact frozen facade, including observation getters. */
|
|
259
|
+
function makeHandle(record) {
|
|
260
|
+
function assertReceiver(receiver) {
|
|
261
|
+
if (receiver !== handle)
|
|
262
|
+
throw new EgretError('SEQ_PLAYBACK_INVALID');
|
|
263
|
+
}
|
|
264
|
+
const handle = Object.freeze({
|
|
265
|
+
get state() {
|
|
266
|
+
assertReceiver(this);
|
|
267
|
+
return record.state;
|
|
268
|
+
},
|
|
269
|
+
get isDisposed() {
|
|
270
|
+
assertReceiver(this);
|
|
271
|
+
return isTerminal(record.state);
|
|
272
|
+
},
|
|
273
|
+
get elapsedSeconds() {
|
|
274
|
+
assertReceiver(this);
|
|
275
|
+
return record.elapsedSeconds;
|
|
276
|
+
},
|
|
277
|
+
get lastSample() {
|
|
278
|
+
assertReceiver(this);
|
|
279
|
+
return record.lastSample;
|
|
280
|
+
},
|
|
281
|
+
start() {
|
|
282
|
+
assertReceiver(this);
|
|
283
|
+
startPlayback(record);
|
|
284
|
+
},
|
|
285
|
+
pause() {
|
|
286
|
+
assertReceiver(this);
|
|
287
|
+
pausePlayback(record);
|
|
288
|
+
},
|
|
289
|
+
resume() {
|
|
290
|
+
assertReceiver(this);
|
|
291
|
+
resumePlayback(record);
|
|
292
|
+
},
|
|
293
|
+
stop() {
|
|
294
|
+
assertReceiver(this);
|
|
295
|
+
retire(record, 'stopped');
|
|
296
|
+
},
|
|
297
|
+
dispose() {
|
|
298
|
+
assertReceiver(this);
|
|
299
|
+
retire(record, 'stopped');
|
|
300
|
+
}
|
|
301
|
+
});
|
|
302
|
+
return handle;
|
|
303
|
+
}
|
|
304
|
+
/** Only private Engine assembly owns inventory and authentic-clock subscriptions. */
|
|
305
|
+
export function createSequencePlaybackOwner(context) {
|
|
306
|
+
const records = new Set();
|
|
307
|
+
const claims = context.claims;
|
|
308
|
+
let creating = false;
|
|
309
|
+
return Object.freeze({
|
|
310
|
+
create(scope, bitmap, clip, options) {
|
|
311
|
+
assertLifetime(context, scope);
|
|
312
|
+
if (creating)
|
|
313
|
+
throw new EgretError('SEQ_PLAYBACK_CREATION_REENTRANT');
|
|
314
|
+
if (claims.size >= MAX_PLAYBACKS)
|
|
315
|
+
throw new EgretError('SEQ_PLAYBACK_LIMIT');
|
|
316
|
+
creating = true;
|
|
317
|
+
let player;
|
|
318
|
+
let record;
|
|
319
|
+
try {
|
|
320
|
+
const mode = admitMode(context, scope, options);
|
|
321
|
+
player = new playerConstructor(bitmap, clip, mode);
|
|
322
|
+
// Seal before the first intrinsic Scope adoption, including late cleanup.
|
|
323
|
+
Object.defineProperty(player, 'dispose', {
|
|
324
|
+
value: disposeOwnedPlayer,
|
|
325
|
+
enumerable: false,
|
|
326
|
+
writable: false,
|
|
327
|
+
configurable: false
|
|
328
|
+
});
|
|
329
|
+
assertLifetime(context, scope);
|
|
330
|
+
// An option getter may have admitted the other profile after the first capacity check.
|
|
331
|
+
if (claims.size >= MAX_PLAYBACKS)
|
|
332
|
+
throw new EgretError('SEQ_PLAYBACK_LIMIT');
|
|
333
|
+
if (claims.has(bitmap))
|
|
334
|
+
throw new EgretError('SEQ_PLAYBACK_TARGET_BUSY');
|
|
335
|
+
record = {
|
|
336
|
+
context,
|
|
337
|
+
scope,
|
|
338
|
+
mode,
|
|
339
|
+
durationSeconds: clip.durationSeconds,
|
|
340
|
+
player,
|
|
341
|
+
target: bitmap,
|
|
342
|
+
clip,
|
|
343
|
+
owner: undefined,
|
|
344
|
+
claims: undefined,
|
|
345
|
+
subscription: undefined,
|
|
346
|
+
state: 'idle',
|
|
347
|
+
elapsedSeconds: 0,
|
|
348
|
+
lastSample: undefined,
|
|
349
|
+
runBase: 0,
|
|
350
|
+
anchor: 0,
|
|
351
|
+
operationBusy: false
|
|
352
|
+
};
|
|
353
|
+
player = undefined; // The mutable record is now the sole cleanup borrow.
|
|
354
|
+
const handle = makeHandle(record);
|
|
355
|
+
apply(scopeUse, scope, [record.player]);
|
|
356
|
+
apply(scopeUse, scope, [handle]);
|
|
357
|
+
assertLifetime(context, scope);
|
|
358
|
+
if (isTerminal(record.state))
|
|
359
|
+
throw new EgretError('SEQ_PLAYBACK_TERMINAL');
|
|
360
|
+
// Store rollback authority before callback-free claim/inventory publication.
|
|
361
|
+
record.claims = claims;
|
|
362
|
+
record.owner = records;
|
|
363
|
+
claims.acquire(bitmap, record);
|
|
364
|
+
records.add(record);
|
|
365
|
+
return handle;
|
|
366
|
+
}
|
|
367
|
+
catch (cause) {
|
|
368
|
+
if (record !== undefined)
|
|
369
|
+
retire(record, 'stopped', true);
|
|
370
|
+
else if (player !== undefined) {
|
|
371
|
+
try {
|
|
372
|
+
apply(playerDispose, player, []);
|
|
373
|
+
}
|
|
374
|
+
catch (cleanupCause) {
|
|
375
|
+
captureSecondary(context, cleanupCause);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
throw cause;
|
|
379
|
+
}
|
|
380
|
+
finally {
|
|
381
|
+
creating = false;
|
|
382
|
+
}
|
|
383
|
+
},
|
|
384
|
+
close() {
|
|
385
|
+
// Secondary faults are collected per record; no record can block clock close.
|
|
386
|
+
for (const record of records)
|
|
387
|
+
retire(record, 'stopped', true);
|
|
388
|
+
}
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
//# sourceMappingURL=sequencePlayback.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Disposable } from '@egret/contracts';
|
|
2
|
+
import type { SequencePlaybackMode, SequenceSample } from '@egret/runtime';
|
|
3
|
+
export type SequencePlaybackState = 'idle' | 'running' | 'paused' | 'completed' | 'stopped' | 'failed';
|
|
4
|
+
export interface SequencePlaybackOptions {
|
|
5
|
+
readonly mode?: SequencePlaybackMode;
|
|
6
|
+
}
|
|
7
|
+
declare const sequencePlaybackBrand: unique symbol;
|
|
8
|
+
export interface SequencePlayback extends Disposable {
|
|
9
|
+
readonly [sequencePlaybackBrand]: true;
|
|
10
|
+
readonly state: SequencePlaybackState;
|
|
11
|
+
readonly isDisposed: boolean;
|
|
12
|
+
readonly elapsedSeconds: number;
|
|
13
|
+
readonly lastSample: SequenceSample | undefined;
|
|
14
|
+
start(): void;
|
|
15
|
+
pause(): void;
|
|
16
|
+
resume(): void;
|
|
17
|
+
stop(): void;
|
|
18
|
+
dispose(): void;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=sequencePlaybackTypes.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Bitmap } from '@egret/runtime';
|
|
2
|
+
/** Private Engine-owned claims shared by the original and optional playback profiles. */
|
|
3
|
+
export interface SequenceTargetClaims {
|
|
4
|
+
readonly size: number;
|
|
5
|
+
has(target: Bitmap): boolean;
|
|
6
|
+
acquire(target: Bitmap, token: object): void;
|
|
7
|
+
release(target: Bitmap, token: object): void;
|
|
8
|
+
}
|
|
9
|
+
export declare function createSequenceTargetClaims(): SequenceTargetClaims;
|
|
10
|
+
//# sourceMappingURL=sequenceTargetClaims.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
import { EgretError } from '@egret/runtime';
|
|
3
|
+
export function createSequenceTargetClaims() {
|
|
4
|
+
const targets = new WeakMap();
|
|
5
|
+
let size = 0;
|
|
6
|
+
return Object.freeze({
|
|
7
|
+
get size() {
|
|
8
|
+
return size;
|
|
9
|
+
},
|
|
10
|
+
has(target) {
|
|
11
|
+
return targets.has(target);
|
|
12
|
+
},
|
|
13
|
+
acquire(target, token) {
|
|
14
|
+
// Admission is callback-free; refusal never replaces a previous claimant.
|
|
15
|
+
if (size >= 256)
|
|
16
|
+
throw new EgretError('ANIMATION_LIMIT');
|
|
17
|
+
if (targets.has(target))
|
|
18
|
+
throw new EgretError('ANIMATION_TARGET_BUSY');
|
|
19
|
+
targets.set(target, token);
|
|
20
|
+
size++;
|
|
21
|
+
},
|
|
22
|
+
release(target, token) {
|
|
23
|
+
// A historical handle cannot retire a newer claimant of the same Bitmap.
|
|
24
|
+
if (targets.get(target) !== token)
|
|
25
|
+
return;
|
|
26
|
+
targets.delete(target);
|
|
27
|
+
size--;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=sequenceTargetClaims.js.map
|