rn-gamekit 0.1.0 → 0.2.1
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/CHANGELOG.md +75 -0
- package/README.md +97 -16
- package/lib/module/assets/defineAssets.js +28 -3
- package/lib/module/assets/defineAssets.js.map +1 -1
- package/lib/module/assets.js +11 -0
- package/lib/module/assets.js.map +1 -0
- package/lib/module/audio/createGameAudio.js +784 -0
- package/lib/module/audio/createGameAudio.js.map +1 -0
- package/lib/module/audio/errors.js +12 -0
- package/lib/module/audio/errors.js.map +1 -0
- package/lib/module/audio/index.js +5 -0
- package/lib/module/audio/index.js.map +1 -0
- package/lib/module/audio/resolver.js +37 -0
- package/lib/module/audio/resolver.js.map +1 -0
- package/lib/module/audio/types.js +4 -0
- package/lib/module/audio/types.js.map +1 -0
- package/lib/module/audio.js +9 -0
- package/lib/module/audio.js.map +1 -0
- package/lib/module/camera2d/bounds.js +59 -0
- package/lib/module/camera2d/bounds.js.map +1 -0
- package/lib/module/camera2d/extents.js +25 -0
- package/lib/module/camera2d/extents.js.map +1 -0
- package/lib/module/camera2d/follow.js +138 -0
- package/lib/module/camera2d/follow.js.map +1 -0
- package/lib/module/camera2d/index.js +20 -0
- package/lib/module/camera2d/index.js.map +1 -0
- package/lib/module/camera2d/interpolation.js +98 -0
- package/lib/module/camera2d/interpolation.js.map +1 -0
- package/lib/module/camera2d/shake.js +85 -0
- package/lib/module/camera2d/shake.js.map +1 -0
- package/lib/module/camera2d/transform.js +151 -0
- package/lib/module/camera2d/transform.js.map +1 -0
- package/lib/module/camera2d/types.js +4 -0
- package/lib/module/camera2d/types.js.map +1 -0
- package/lib/module/camera2d/validation.js +98 -0
- package/lib/module/camera2d/validation.js.map +1 -0
- package/lib/module/camera2d/visibility.js +138 -0
- package/lib/module/camera2d/visibility.js.map +1 -0
- package/lib/module/camera2d.js +9 -0
- package/lib/module/camera2d.js.map +1 -0
- package/lib/module/collision2d/colliders.js +266 -0
- package/lib/module/collision2d/colliders.js.map +1 -0
- package/lib/module/collision2d/debug.js +105 -0
- package/lib/module/collision2d/debug.js.map +1 -0
- package/lib/module/collision2d/filters.js +40 -0
- package/lib/module/collision2d/filters.js.map +1 -0
- package/lib/module/collision2d/index.js +12 -0
- package/lib/module/collision2d/index.js.map +1 -0
- package/lib/module/collision2d/intersections.js +67 -0
- package/lib/module/collision2d/intersections.js.map +1 -0
- package/lib/module/collision2d/manifolds.js +218 -0
- package/lib/module/collision2d/manifolds.js.map +1 -0
- package/lib/module/collision2d/segments.js +187 -0
- package/lib/module/collision2d/segments.js.map +1 -0
- package/lib/module/collision2d/spatialHash.js +167 -0
- package/lib/module/collision2d/spatialHash.js.map +1 -0
- package/lib/module/collision2d/sweeps.js +255 -0
- package/lib/module/collision2d/sweeps.js.map +1 -0
- package/lib/module/collision2d.js +9 -0
- package/lib/module/collision2d.js.map +1 -0
- package/lib/module/core/input/buttonPad.js +214 -0
- package/lib/module/core/input/buttonPad.js.map +1 -0
- package/lib/module/core/input/createInputBuffer.js +66 -14
- package/lib/module/core/input/createInputBuffer.js.map +1 -1
- package/lib/module/core/session/createGameSession.js +454 -50
- package/lib/module/core/session/createGameSession.js.map +1 -1
- package/lib/module/core/session/deepFreeze.js +92 -2
- package/lib/module/core/session/deepFreeze.js.map +1 -1
- package/lib/module/core/session/types.js +12 -0
- package/lib/module/core/session/types.js.map +1 -1
- package/lib/module/definition/defineGame.js +23 -0
- package/lib/module/definition/defineGame.js.map +1 -1
- package/lib/module/events/defineGameEvents.js +46 -0
- package/lib/module/events/defineGameEvents.js.map +1 -0
- package/lib/module/events/errors.js +16 -0
- package/lib/module/events/errors.js.map +1 -0
- package/lib/module/events/index.js +7 -0
- package/lib/module/events/index.js.map +1 -0
- package/lib/module/events/payload.js +219 -0
- package/lib/module/events/payload.js.map +1 -0
- package/lib/module/events/seed.js +33 -0
- package/lib/module/events/seed.js.map +1 -0
- package/lib/module/events/types.js +4 -0
- package/lib/module/events/types.js.map +1 -0
- package/lib/module/events.js +13 -0
- package/lib/module/events.js.map +1 -0
- package/lib/module/geometry/helpers.js +140 -0
- package/lib/module/geometry/helpers.js.map +1 -0
- package/lib/module/geometry/index.js +5 -0
- package/lib/module/geometry/index.js.map +1 -0
- package/lib/module/geometry/validation.js +104 -0
- package/lib/module/geometry/validation.js.map +1 -0
- package/lib/module/geometry.js +9 -0
- package/lib/module/geometry.js.map +1 -0
- package/lib/module/haptics/createGameHaptics.js +214 -0
- package/lib/module/haptics/createGameHaptics.js.map +1 -0
- package/lib/module/haptics/errors.js +12 -0
- package/lib/module/haptics/errors.js.map +1 -0
- package/lib/module/haptics/index.js +5 -0
- package/lib/module/haptics/index.js.map +1 -0
- package/lib/module/haptics/resolver.js +37 -0
- package/lib/module/haptics/resolver.js.map +1 -0
- package/lib/module/haptics/types.js +4 -0
- package/lib/module/haptics/types.js.map +1 -0
- package/lib/module/haptics.js +9 -0
- package/lib/module/haptics.js.map +1 -0
- package/lib/module/index.js +8 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/particles/createParticleSystem.js +481 -0
- package/lib/module/particles/createParticleSystem.js.map +1 -0
- package/lib/module/particles/defineParticleEffect.js +178 -0
- package/lib/module/particles/defineParticleEffect.js.map +1 -0
- package/lib/module/particles/errors.js +9 -0
- package/lib/module/particles/errors.js.map +1 -0
- package/lib/module/particles/index.js +8 -0
- package/lib/module/particles/index.js.map +1 -0
- package/lib/module/particles/sampling.js +121 -0
- package/lib/module/particles/sampling.js.map +1 -0
- package/lib/module/particles/types.js +4 -0
- package/lib/module/particles/types.js.map +1 -0
- package/lib/module/particles.js +4 -0
- package/lib/module/particles.js.map +1 -0
- package/lib/module/react/GameButtonPad.js +344 -0
- package/lib/module/react/GameButtonPad.js.map +1 -0
- package/lib/module/react/GamePointerInput.js +74 -16
- package/lib/module/react/GamePointerInput.js.map +1 -1
- package/lib/module/react/GameView.js +139 -60
- package/lib/module/react/GameView.js.map +1 -1
- package/lib/module/react/assets/createGameAssetStore.js +145 -95
- package/lib/module/react/assets/createGameAssetStore.js.map +1 -1
- package/lib/module/react/assets/useGameAssets.js +60 -35
- package/lib/module/react/assets/useGameAssets.js.map +1 -1
- package/lib/module/react/bindAppLifecycle.js +46 -17
- package/lib/module/react/bindAppLifecycle.js.map +1 -1
- package/lib/module/react/bindGameSession.js +13 -2
- package/lib/module/react/bindGameSession.js.map +1 -1
- package/lib/module/react/camera2d/GameLayer2D.js +50 -0
- package/lib/module/react/camera2d/GameLayer2D.js.map +1 -0
- package/lib/module/react/camera2d/defineGameCamera2D.js +30 -0
- package/lib/module/react/camera2d/defineGameCamera2D.js.map +1 -0
- package/lib/module/react/camera2d/usePresentedCameraBinding.js +177 -0
- package/lib/module/react/camera2d/usePresentedCameraBinding.js.map +1 -0
- package/lib/module/react/cleanupList.js +38 -0
- package/lib/module/react/cleanupList.js.map +1 -0
- package/lib/module/react/lifecycleSource.js +49 -0
- package/lib/module/react/lifecycleSource.js.map +1 -0
- package/lib/module/react/particles/ParticleView.js +308 -0
- package/lib/module/react/particles/ParticleView.js.map +1 -0
- package/lib/module/react/particles/culling.js +115 -0
- package/lib/module/react/particles/culling.js.map +1 -0
- package/lib/module/react/particles/index.js +7 -0
- package/lib/module/react/particles/index.js.map +1 -0
- package/lib/module/react/particles/spriteXForm.js +45 -0
- package/lib/module/react/particles/spriteXForm.js.map +1 -0
- package/lib/module/react/particles/useParticlePresentation.js +204 -0
- package/lib/module/react/particles/useParticlePresentation.js.map +1 -0
- package/lib/module/react/pointerBinding.js +55 -17
- package/lib/module/react/pointerBinding.js.map +1 -1
- package/lib/module/react/pointerCamera.js +28 -0
- package/lib/module/react/pointerCamera.js.map +1 -0
- package/lib/module/react/pointerCoalescer.js +16 -9
- package/lib/module/react/pointerCoalescer.js.map +1 -1
- package/lib/module/react/sprites/GameSprite.js +5 -17
- package/lib/module/react/sprites/GameSprite.js.map +1 -1
- package/lib/module/react/sprites/GameWorld2D.js +112 -9
- package/lib/module/react/sprites/GameWorld2D.js.map +1 -1
- package/lib/module/react/sprites/Sprite.js +48 -63
- package/lib/module/react/sprites/Sprite.js.map +1 -1
- package/lib/module/react/sprites/SpriteBatch.js +53 -28
- package/lib/module/react/sprites/SpriteBatch.js.map +1 -1
- package/lib/module/react/sprites/batchVisibility.js +58 -0
- package/lib/module/react/sprites/batchVisibility.js.map +1 -0
- package/lib/module/react/sprites/spriteSelection.js +103 -0
- package/lib/module/react/sprites/spriteSelection.js.map +1 -0
- package/lib/module/react/sprites/spriteTransform.js +46 -25
- package/lib/module/react/sprites/spriteTransform.js.map +1 -1
- package/lib/module/react/tilemap/TileMapLayer2D.js +217 -0
- package/lib/module/react/tilemap/TileMapLayer2D.js.map +1 -0
- package/lib/module/react/tilemap/tilePresentation.js +374 -0
- package/lib/module/react/tilemap/tilePresentation.js.map +1 -0
- package/lib/module/react/useGameSession.js +70 -0
- package/lib/module/react/useGameSession.js.map +1 -0
- package/lib/module/react/useGameSessionStatus.js +46 -0
- package/lib/module/react/useGameSessionStatus.js.map +1 -0
- package/lib/module/react/viewportBinding.js +5 -1
- package/lib/module/react/viewportBinding.js.map +1 -1
- package/lib/module/react.js +12 -1
- package/lib/module/react.js.map +1 -1
- package/lib/module/scene/defineScene.js +17 -0
- package/lib/module/scene/defineScene.js.map +1 -1
- package/lib/module/sprites/sampleSpriteClip.js +66 -6
- package/lib/module/sprites/sampleSpriteClip.js.map +1 -1
- package/lib/module/sprites/spriteAnimationState.js +10 -20
- package/lib/module/sprites/spriteAnimationState.js.map +1 -1
- package/lib/module/sprites.js +11 -0
- package/lib/module/sprites.js.map +1 -0
- package/lib/module/storage/adapters/asyncStorage.js +57 -0
- package/lib/module/storage/adapters/asyncStorage.js.map +1 -0
- package/lib/module/storage/adapters/memory.js +50 -0
- package/lib/module/storage/adapters/memory.js.map +1 -0
- package/lib/module/storage/errors.js +34 -0
- package/lib/module/storage/errors.js.map +1 -0
- package/lib/module/storage/index.js +11 -0
- package/lib/module/storage/index.js.map +1 -0
- package/lib/module/storage/schema.js +151 -0
- package/lib/module/storage/schema.js.map +1 -0
- package/lib/module/storage/serialization.js +249 -0
- package/lib/module/storage/serialization.js.map +1 -0
- package/lib/module/storage/store.js +387 -0
- package/lib/module/storage/store.js.map +1 -0
- package/lib/module/storage/types.js +16 -0
- package/lib/module/storage/types.js.map +1 -0
- package/lib/module/storage/validation.js +111 -0
- package/lib/module/storage/validation.js.map +1 -0
- package/lib/module/storage.js +4 -0
- package/lib/module/storage.js.map +1 -0
- package/lib/module/testing.js +4 -0
- package/lib/module/testing.js.map +1 -1
- package/lib/module/tilemap/chunkStats.js +27 -0
- package/lib/module/tilemap/chunkStats.js.map +1 -0
- package/lib/module/tilemap/definitions.js +308 -0
- package/lib/module/tilemap/definitions.js.map +1 -0
- package/lib/module/tilemap/errors.js +13 -0
- package/lib/module/tilemap/errors.js.map +1 -0
- package/lib/module/tilemap/index.js +10 -0
- package/lib/module/tilemap/index.js.map +1 -0
- package/lib/module/tilemap/movement.js +379 -0
- package/lib/module/tilemap/movement.js.map +1 -0
- package/lib/module/tilemap/queries.js +114 -0
- package/lib/module/tilemap/queries.js.map +1 -0
- package/lib/module/tilemap/tiledAdapter.js +141 -0
- package/lib/module/tilemap/tiledAdapter.js.map +1 -0
- package/lib/module/tilemap/types.js +4 -0
- package/lib/module/tilemap/types.js.map +1 -0
- package/lib/module/tilemap.js +4 -0
- package/lib/module/tilemap.js.map +1 -0
- package/lib/typescript/src/assets/defineAssets.d.ts +1 -1
- package/lib/typescript/src/assets/defineAssets.d.ts.map +1 -1
- package/lib/typescript/src/assets.d.ts +11 -0
- package/lib/typescript/src/assets.d.ts.map +1 -0
- package/lib/typescript/src/audio/createGameAudio.d.ts +5 -0
- package/lib/typescript/src/audio/createGameAudio.d.ts.map +1 -0
- package/lib/typescript/src/audio/errors.d.ts +6 -0
- package/lib/typescript/src/audio/errors.d.ts.map +1 -0
- package/lib/typescript/src/audio/index.d.ts +4 -0
- package/lib/typescript/src/audio/index.d.ts.map +1 -0
- package/lib/typescript/src/audio/resolver.d.ts +44 -0
- package/lib/typescript/src/audio/resolver.d.ts.map +1 -0
- package/lib/typescript/src/audio/types.d.ts +42 -0
- package/lib/typescript/src/audio/types.d.ts.map +1 -0
- package/lib/typescript/src/audio.d.ts +8 -0
- package/lib/typescript/src/audio.d.ts.map +1 -0
- package/lib/typescript/src/camera2d/bounds.d.ts +25 -0
- package/lib/typescript/src/camera2d/bounds.d.ts.map +1 -0
- package/lib/typescript/src/camera2d/extents.d.ts +17 -0
- package/lib/typescript/src/camera2d/extents.d.ts.map +1 -0
- package/lib/typescript/src/camera2d/follow.d.ts +24 -0
- package/lib/typescript/src/camera2d/follow.d.ts.map +1 -0
- package/lib/typescript/src/camera2d/index.d.ts +19 -0
- package/lib/typescript/src/camera2d/index.d.ts.map +1 -0
- package/lib/typescript/src/camera2d/interpolation.d.ts +17 -0
- package/lib/typescript/src/camera2d/interpolation.d.ts.map +1 -0
- package/lib/typescript/src/camera2d/shake.d.ts +20 -0
- package/lib/typescript/src/camera2d/shake.d.ts.map +1 -0
- package/lib/typescript/src/camera2d/transform.d.ts +44 -0
- package/lib/typescript/src/camera2d/transform.d.ts.map +1 -0
- package/lib/typescript/src/camera2d/types.d.ts +74 -0
- package/lib/typescript/src/camera2d/types.d.ts.map +1 -0
- package/lib/typescript/src/camera2d/validation.d.ts +30 -0
- package/lib/typescript/src/camera2d/validation.d.ts.map +1 -0
- package/lib/typescript/src/camera2d/visibility.d.ts +47 -0
- package/lib/typescript/src/camera2d/visibility.d.ts.map +1 -0
- package/lib/typescript/src/camera2d.d.ts +7 -0
- package/lib/typescript/src/camera2d.d.ts.map +1 -0
- package/lib/typescript/src/collision2d/colliders.d.ts +120 -0
- package/lib/typescript/src/collision2d/colliders.d.ts.map +1 -0
- package/lib/typescript/src/collision2d/debug.d.ts +67 -0
- package/lib/typescript/src/collision2d/debug.d.ts.map +1 -0
- package/lib/typescript/src/collision2d/filters.d.ts +28 -0
- package/lib/typescript/src/collision2d/filters.d.ts.map +1 -0
- package/lib/typescript/src/collision2d/index.d.ts +17 -0
- package/lib/typescript/src/collision2d/index.d.ts.map +1 -0
- package/lib/typescript/src/collision2d/intersections.d.ts +24 -0
- package/lib/typescript/src/collision2d/intersections.d.ts.map +1 -0
- package/lib/typescript/src/collision2d/manifolds.d.ts +39 -0
- package/lib/typescript/src/collision2d/manifolds.d.ts.map +1 -0
- package/lib/typescript/src/collision2d/segments.d.ts +24 -0
- package/lib/typescript/src/collision2d/segments.d.ts.map +1 -0
- package/lib/typescript/src/collision2d/spatialHash.d.ts +50 -0
- package/lib/typescript/src/collision2d/spatialHash.d.ts.map +1 -0
- package/lib/typescript/src/collision2d/sweeps.d.ts +60 -0
- package/lib/typescript/src/collision2d/sweeps.d.ts.map +1 -0
- package/lib/typescript/src/collision2d.d.ts +7 -0
- package/lib/typescript/src/collision2d.d.ts.map +1 -0
- package/lib/typescript/src/core/input/buttonPad.d.ts +59 -0
- package/lib/typescript/src/core/input/buttonPad.d.ts.map +1 -0
- package/lib/typescript/src/core/input/createInputBuffer.d.ts +1 -1
- package/lib/typescript/src/core/input/createInputBuffer.d.ts.map +1 -1
- package/lib/typescript/src/core/input/types.d.ts +7 -0
- package/lib/typescript/src/core/input/types.d.ts.map +1 -1
- package/lib/typescript/src/core/session/createGameSession.d.ts +4 -2
- package/lib/typescript/src/core/session/createGameSession.d.ts.map +1 -1
- package/lib/typescript/src/core/session/deepFreeze.d.ts +21 -1
- package/lib/typescript/src/core/session/deepFreeze.d.ts.map +1 -1
- package/lib/typescript/src/core/session/diagnostics.d.ts +2 -0
- package/lib/typescript/src/core/session/diagnostics.d.ts.map +1 -1
- package/lib/typescript/src/core/session/types.d.ts +69 -4
- package/lib/typescript/src/core/session/types.d.ts.map +1 -1
- package/lib/typescript/src/definition/defineGame.d.ts +12 -1
- package/lib/typescript/src/definition/defineGame.d.ts.map +1 -1
- package/lib/typescript/src/definition/types.d.ts +10 -1
- package/lib/typescript/src/definition/types.d.ts.map +1 -1
- package/lib/typescript/src/events/defineGameEvents.d.ts +26 -0
- package/lib/typescript/src/events/defineGameEvents.d.ts.map +1 -0
- package/lib/typescript/src/events/errors.d.ts +12 -0
- package/lib/typescript/src/events/errors.d.ts.map +1 -0
- package/lib/typescript/src/events/index.d.ts +6 -0
- package/lib/typescript/src/events/index.d.ts.map +1 -0
- package/lib/typescript/src/events/payload.d.ts +21 -0
- package/lib/typescript/src/events/payload.d.ts.map +1 -0
- package/lib/typescript/src/events/seed.d.ts +3 -0
- package/lib/typescript/src/events/seed.d.ts.map +1 -0
- package/lib/typescript/src/events/types.d.ts +42 -0
- package/lib/typescript/src/events/types.d.ts.map +1 -0
- package/lib/typescript/src/events.d.ts +12 -0
- package/lib/typescript/src/events.d.ts.map +1 -0
- package/lib/typescript/src/geometry/helpers.d.ts +35 -0
- package/lib/typescript/src/geometry/helpers.d.ts.map +1 -0
- package/lib/typescript/src/geometry/index.d.ts +4 -0
- package/lib/typescript/src/geometry/index.d.ts.map +1 -0
- package/lib/typescript/src/geometry/types.d.ts +49 -0
- package/lib/typescript/src/geometry/types.d.ts.map +1 -1
- package/lib/typescript/src/geometry/validation.d.ts +44 -0
- package/lib/typescript/src/geometry/validation.d.ts.map +1 -0
- package/lib/typescript/src/geometry.d.ts +7 -0
- package/lib/typescript/src/geometry.d.ts.map +1 -0
- package/lib/typescript/src/haptics/createGameHaptics.d.ts +3 -0
- package/lib/typescript/src/haptics/createGameHaptics.d.ts.map +1 -0
- package/lib/typescript/src/haptics/errors.d.ts +6 -0
- package/lib/typescript/src/haptics/errors.d.ts.map +1 -0
- package/lib/typescript/src/haptics/index.d.ts +4 -0
- package/lib/typescript/src/haptics/index.d.ts.map +1 -0
- package/lib/typescript/src/haptics/resolver.d.ts +22 -0
- package/lib/typescript/src/haptics/resolver.d.ts.map +1 -0
- package/lib/typescript/src/haptics/types.d.ts +37 -0
- package/lib/typescript/src/haptics/types.d.ts.map +1 -0
- package/lib/typescript/src/haptics.d.ts +8 -0
- package/lib/typescript/src/haptics.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +10 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/particles/createParticleSystem.d.ts +5 -0
- package/lib/typescript/src/particles/createParticleSystem.d.ts.map +1 -0
- package/lib/typescript/src/particles/defineParticleEffect.d.ts +3 -0
- package/lib/typescript/src/particles/defineParticleEffect.d.ts.map +1 -0
- package/lib/typescript/src/particles/errors.d.ts +5 -0
- package/lib/typescript/src/particles/errors.d.ts.map +1 -0
- package/lib/typescript/src/particles/index.d.ts +6 -0
- package/lib/typescript/src/particles/index.d.ts.map +1 -0
- package/lib/typescript/src/particles/sampling.d.ts +54 -0
- package/lib/typescript/src/particles/sampling.d.ts.map +1 -0
- package/lib/typescript/src/particles/types.d.ts +292 -0
- package/lib/typescript/src/particles/types.d.ts.map +1 -0
- package/lib/typescript/src/particles.d.ts +2 -0
- package/lib/typescript/src/particles.d.ts.map +1 -0
- package/lib/typescript/src/react/GameButtonPad.d.ts +84 -0
- package/lib/typescript/src/react/GameButtonPad.d.ts.map +1 -0
- package/lib/typescript/src/react/GamePointerInput.d.ts.map +1 -1
- package/lib/typescript/src/react/GameView.d.ts +27 -1
- package/lib/typescript/src/react/GameView.d.ts.map +1 -1
- package/lib/typescript/src/react/assets/createGameAssetStore.d.ts.map +1 -1
- package/lib/typescript/src/react/assets/useGameAssets.d.ts.map +1 -1
- package/lib/typescript/src/react/bindAppLifecycle.d.ts +7 -1
- package/lib/typescript/src/react/bindAppLifecycle.d.ts.map +1 -1
- package/lib/typescript/src/react/bindGameSession.d.ts.map +1 -1
- package/lib/typescript/src/react/camera2d/GameLayer2D.d.ts +24 -0
- package/lib/typescript/src/react/camera2d/GameLayer2D.d.ts.map +1 -0
- package/lib/typescript/src/react/camera2d/defineGameCamera2D.d.ts +44 -0
- package/lib/typescript/src/react/camera2d/defineGameCamera2D.d.ts.map +1 -0
- package/lib/typescript/src/react/camera2d/usePresentedCameraBinding.d.ts +22 -0
- package/lib/typescript/src/react/camera2d/usePresentedCameraBinding.d.ts.map +1 -0
- package/lib/typescript/src/react/cleanupList.d.ts +21 -0
- package/lib/typescript/src/react/cleanupList.d.ts.map +1 -0
- package/lib/typescript/src/react/instrumentation.d.ts +33 -3
- package/lib/typescript/src/react/instrumentation.d.ts.map +1 -1
- package/lib/typescript/src/react/lifecycleSource.d.ts +21 -0
- package/lib/typescript/src/react/lifecycleSource.d.ts.map +1 -0
- package/lib/typescript/src/react/particles/ParticleView.d.ts +65 -0
- package/lib/typescript/src/react/particles/ParticleView.d.ts.map +1 -0
- package/lib/typescript/src/react/particles/culling.d.ts +70 -0
- package/lib/typescript/src/react/particles/culling.d.ts.map +1 -0
- package/lib/typescript/src/react/particles/index.d.ts +7 -0
- package/lib/typescript/src/react/particles/index.d.ts.map +1 -0
- package/lib/typescript/src/react/particles/spriteXForm.d.ts +28 -0
- package/lib/typescript/src/react/particles/spriteXForm.d.ts.map +1 -0
- package/lib/typescript/src/react/particles/useParticlePresentation.d.ts +48 -0
- package/lib/typescript/src/react/particles/useParticlePresentation.d.ts.map +1 -0
- package/lib/typescript/src/react/pointerBinding.d.ts +38 -8
- package/lib/typescript/src/react/pointerBinding.d.ts.map +1 -1
- package/lib/typescript/src/react/pointerCamera.d.ts +20 -0
- package/lib/typescript/src/react/pointerCamera.d.ts.map +1 -0
- package/lib/typescript/src/react/pointerCoalescer.d.ts +17 -1
- package/lib/typescript/src/react/pointerCoalescer.d.ts.map +1 -1
- package/lib/typescript/src/react/sprites/GameSprite.d.ts +3 -10
- package/lib/typescript/src/react/sprites/GameSprite.d.ts.map +1 -1
- package/lib/typescript/src/react/sprites/GameWorld2D.d.ts +51 -6
- package/lib/typescript/src/react/sprites/GameWorld2D.d.ts.map +1 -1
- package/lib/typescript/src/react/sprites/Sprite.d.ts.map +1 -1
- package/lib/typescript/src/react/sprites/SpriteBatch.d.ts +22 -1
- package/lib/typescript/src/react/sprites/SpriteBatch.d.ts.map +1 -1
- package/lib/typescript/src/react/sprites/batchVisibility.d.ts +28 -0
- package/lib/typescript/src/react/sprites/batchVisibility.d.ts.map +1 -0
- package/lib/typescript/src/react/sprites/spriteSelection.d.ts +58 -0
- package/lib/typescript/src/react/sprites/spriteSelection.d.ts.map +1 -0
- package/lib/typescript/src/react/sprites/spriteTransform.d.ts +27 -12
- package/lib/typescript/src/react/sprites/spriteTransform.d.ts.map +1 -1
- package/lib/typescript/src/react/tilemap/TileMapLayer2D.d.ts +69 -0
- package/lib/typescript/src/react/tilemap/TileMapLayer2D.d.ts.map +1 -0
- package/lib/typescript/src/react/tilemap/tilePresentation.d.ts +217 -0
- package/lib/typescript/src/react/tilemap/tilePresentation.d.ts.map +1 -0
- package/lib/typescript/src/react/useGameSession.d.ts +48 -0
- package/lib/typescript/src/react/useGameSession.d.ts.map +1 -0
- package/lib/typescript/src/react/useGameSessionStatus.d.ts +23 -0
- package/lib/typescript/src/react/useGameSessionStatus.d.ts.map +1 -0
- package/lib/typescript/src/react/viewportBinding.d.ts +5 -1
- package/lib/typescript/src/react/viewportBinding.d.ts.map +1 -1
- package/lib/typescript/src/react.d.ts +18 -1
- package/lib/typescript/src/react.d.ts.map +1 -1
- package/lib/typescript/src/scene/defineScene.d.ts +22 -2
- package/lib/typescript/src/scene/defineScene.d.ts.map +1 -1
- package/lib/typescript/src/scene/types.d.ts +24 -4
- package/lib/typescript/src/scene/types.d.ts.map +1 -1
- package/lib/typescript/src/sprites/sampleSpriteClip.d.ts +26 -2
- package/lib/typescript/src/sprites/sampleSpriteClip.d.ts.map +1 -1
- package/lib/typescript/src/sprites/spriteAnimationState.d.ts +6 -7
- package/lib/typescript/src/sprites/spriteAnimationState.d.ts.map +1 -1
- package/lib/typescript/src/sprites.d.ts +10 -0
- package/lib/typescript/src/sprites.d.ts.map +1 -0
- package/lib/typescript/src/storage/adapters/asyncStorage.d.ts +18 -0
- package/lib/typescript/src/storage/adapters/asyncStorage.d.ts.map +1 -0
- package/lib/typescript/src/storage/adapters/memory.d.ts +16 -0
- package/lib/typescript/src/storage/adapters/memory.d.ts.map +1 -0
- package/lib/typescript/src/storage/errors.d.ts +37 -0
- package/lib/typescript/src/storage/errors.d.ts.map +1 -0
- package/lib/typescript/src/storage/index.d.ts +11 -0
- package/lib/typescript/src/storage/index.d.ts.map +1 -0
- package/lib/typescript/src/storage/schema.d.ts +22 -0
- package/lib/typescript/src/storage/schema.d.ts.map +1 -0
- package/lib/typescript/src/storage/serialization.d.ts +23 -0
- package/lib/typescript/src/storage/serialization.d.ts.map +1 -0
- package/lib/typescript/src/storage/store.d.ts +3 -0
- package/lib/typescript/src/storage/store.d.ts.map +1 -0
- package/lib/typescript/src/storage/types.d.ts +69 -0
- package/lib/typescript/src/storage/types.d.ts.map +1 -0
- package/lib/typescript/src/storage/validation.d.ts +24 -0
- package/lib/typescript/src/storage/validation.d.ts.map +1 -0
- package/lib/typescript/src/storage.d.ts +2 -0
- package/lib/typescript/src/storage.d.ts.map +1 -0
- package/lib/typescript/src/testing.d.ts +1 -0
- package/lib/typescript/src/testing.d.ts.map +1 -1
- package/lib/typescript/src/tilemap/chunkStats.d.ts +14 -0
- package/lib/typescript/src/tilemap/chunkStats.d.ts.map +1 -0
- package/lib/typescript/src/tilemap/definitions.d.ts +38 -0
- package/lib/typescript/src/tilemap/definitions.d.ts.map +1 -0
- package/lib/typescript/src/tilemap/errors.d.ts +7 -0
- package/lib/typescript/src/tilemap/errors.d.ts.map +1 -0
- package/lib/typescript/src/tilemap/index.d.ts +8 -0
- package/lib/typescript/src/tilemap/index.d.ts.map +1 -0
- package/lib/typescript/src/tilemap/movement.d.ts +52 -0
- package/lib/typescript/src/tilemap/movement.d.ts.map +1 -0
- package/lib/typescript/src/tilemap/queries.d.ts +21 -0
- package/lib/typescript/src/tilemap/queries.d.ts.map +1 -0
- package/lib/typescript/src/tilemap/tiledAdapter.d.ts +32 -0
- package/lib/typescript/src/tilemap/tiledAdapter.d.ts.map +1 -0
- package/lib/typescript/src/tilemap/types.d.ts +127 -0
- package/lib/typescript/src/tilemap/types.d.ts.map +1 -0
- package/lib/typescript/src/tilemap.d.ts +2 -0
- package/lib/typescript/src/tilemap.d.ts.map +1 -0
- package/package.json +100 -10
- package/src/assets/defineAssets.ts +31 -5
- package/src/assets.ts +27 -0
- package/src/audio/createGameAudio.ts +749 -0
- package/src/audio/errors.ts +12 -0
- package/src/audio/index.ts +9 -0
- package/src/audio/resolver.ts +74 -0
- package/src/audio/types.ts +47 -0
- package/src/audio.ts +13 -0
- package/src/camera2d/bounds.ts +69 -0
- package/src/camera2d/extents.ts +25 -0
- package/src/camera2d/follow.ts +165 -0
- package/src/camera2d/index.ts +29 -0
- package/src/camera2d/interpolation.ts +113 -0
- package/src/camera2d/shake.ts +90 -0
- package/src/camera2d/transform.ts +148 -0
- package/src/camera2d/types.ts +73 -0
- package/src/camera2d/validation.ts +126 -0
- package/src/camera2d/visibility.ts +181 -0
- package/src/camera2d.ts +6 -0
- package/src/collision2d/colliders.ts +292 -0
- package/src/collision2d/debug.ts +133 -0
- package/src/collision2d/filters.ts +48 -0
- package/src/collision2d/index.ts +74 -0
- package/src/collision2d/intersections.ts +82 -0
- package/src/collision2d/manifolds.ts +191 -0
- package/src/collision2d/segments.ts +176 -0
- package/src/collision2d/spatialHash.ts +211 -0
- package/src/collision2d/sweeps.ts +269 -0
- package/src/collision2d.ts +6 -0
- package/src/core/input/buttonPad.ts +235 -0
- package/src/core/input/createInputBuffer.ts +95 -14
- package/src/core/input/types.ts +7 -0
- package/src/core/session/createGameSession.ts +480 -53
- package/src/core/session/deepFreeze.ts +104 -3
- package/src/core/session/diagnostics.ts +2 -0
- package/src/core/session/types.ts +77 -4
- package/src/definition/defineGame.ts +61 -3
- package/src/definition/types.ts +10 -0
- package/src/events/defineGameEvents.ts +46 -0
- package/src/events/errors.ts +14 -0
- package/src/events/index.ts +14 -0
- package/src/events/payload.ts +234 -0
- package/src/events/seed.ts +33 -0
- package/src/events/types.ts +53 -0
- package/src/events.ts +20 -0
- package/src/geometry/helpers.ts +136 -0
- package/src/geometry/index.ts +14 -0
- package/src/geometry/types.ts +54 -0
- package/src/geometry/validation.ts +131 -0
- package/src/geometry.ts +6 -0
- package/src/haptics/createGameHaptics.ts +214 -0
- package/src/haptics/errors.ts +12 -0
- package/src/haptics/index.ts +3 -0
- package/src/haptics/resolver.ts +58 -0
- package/src/haptics/types.ts +48 -0
- package/src/haptics.ts +7 -0
- package/src/index.ts +37 -1
- package/src/particles/createParticleSystem.ts +505 -0
- package/src/particles/defineParticleEffect.ts +164 -0
- package/src/particles/errors.ts +6 -0
- package/src/particles/index.ts +5 -0
- package/src/particles/sampling.ts +141 -0
- package/src/particles/types.ts +327 -0
- package/src/particles.ts +1 -0
- package/src/react/GameButtonPad.tsx +436 -0
- package/src/react/GamePointerInput.tsx +73 -8
- package/src/react/GameView.tsx +160 -61
- package/src/react/assets/createGameAssetStore.ts +140 -107
- package/src/react/assets/useGameAssets.ts +63 -31
- package/src/react/bindAppLifecycle.ts +55 -19
- package/src/react/bindGameSession.ts +12 -2
- package/src/react/camera2d/GameLayer2D.tsx +43 -0
- package/src/react/camera2d/defineGameCamera2D.ts +59 -0
- package/src/react/camera2d/usePresentedCameraBinding.ts +185 -0
- package/src/react/cleanupList.ts +48 -0
- package/src/react/instrumentation.ts +31 -3
- package/src/react/lifecycleSource.ts +58 -0
- package/src/react/particles/ParticleView.tsx +358 -0
- package/src/react/particles/culling.ts +145 -0
- package/src/react/particles/index.ts +6 -0
- package/src/react/particles/spriteXForm.ts +72 -0
- package/src/react/particles/useParticlePresentation.ts +261 -0
- package/src/react/pointerBinding.ts +74 -16
- package/src/react/pointerCamera.ts +33 -0
- package/src/react/pointerCoalescer.ts +36 -10
- package/src/react/sprites/GameSprite.tsx +4 -33
- package/src/react/sprites/GameWorld2D.tsx +113 -7
- package/src/react/sprites/Sprite.tsx +51 -72
- package/src/react/sprites/SpriteBatch.tsx +74 -22
- package/src/react/sprites/batchVisibility.ts +76 -0
- package/src/react/sprites/spriteSelection.ts +133 -0
- package/src/react/sprites/spriteTransform.ts +46 -26
- package/src/react/tilemap/TileMapLayer2D.tsx +274 -0
- package/src/react/tilemap/tilePresentation.ts +491 -0
- package/src/react/useGameSession.ts +90 -0
- package/src/react/useGameSessionStatus.ts +53 -0
- package/src/react/viewportBinding.ts +5 -1
- package/src/react.ts +18 -1
- package/src/scene/defineScene.ts +47 -5
- package/src/scene/types.ts +37 -3
- package/src/sprites/sampleSpriteClip.ts +82 -14
- package/src/sprites/spriteAnimationState.ts +29 -25
- package/src/sprites.ts +22 -0
- package/src/storage/adapters/asyncStorage.ts +77 -0
- package/src/storage/adapters/memory.ts +58 -0
- package/src/storage/errors.ts +88 -0
- package/src/storage/index.ts +18 -0
- package/src/storage/schema.ts +147 -0
- package/src/storage/serialization.ts +248 -0
- package/src/storage/store.ts +380 -0
- package/src/storage/types.ts +76 -0
- package/src/storage/validation.ts +102 -0
- package/src/storage.ts +1 -0
- package/src/testing.ts +4 -0
- package/src/tilemap/chunkStats.ts +24 -0
- package/src/tilemap/definitions.ts +327 -0
- package/src/tilemap/errors.ts +11 -0
- package/src/tilemap/index.ts +10 -0
- package/src/tilemap/movement.ts +368 -0
- package/src/tilemap/queries.ts +136 -0
- package/src/tilemap/tiledAdapter.ts +165 -0
- package/src/tilemap/types.ts +119 -0
- package/src/tilemap.ts +1 -0
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
import type { Point2D } from '../geometry/types.js';
|
|
2
|
+
export type ParticleSpace = 'world' | 'screen';
|
|
3
|
+
export type ParticleOverflow = 'drop-new' | 'recycle-oldest';
|
|
4
|
+
export type ParticleKind = 'sprite' | 'shape';
|
|
5
|
+
export type ShapeKind = 'circle' | 'rectangle';
|
|
6
|
+
export interface Range {
|
|
7
|
+
readonly min: number;
|
|
8
|
+
readonly max: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* One author-input endpoint of an explicit scale envelope (T20.1): a fixed
|
|
12
|
+
* scalar or a `{ min, max }` sampling range for deterministic per-particle
|
|
13
|
+
* variation. `defineParticleEffect` normalizes scalars into frozen fixed
|
|
14
|
+
* ranges (T20A-R3).
|
|
15
|
+
*/
|
|
16
|
+
export type ParticleScaleEndpointInput = number | Range;
|
|
17
|
+
/**
|
|
18
|
+
* Author-input scale envelope (T20.1): scale begins at `start` and ends at
|
|
19
|
+
* `end`, interpolated linearly from active age. Mutually exclusive with the
|
|
20
|
+
* legacy `scaleOverLife` range; the runtime rejects definitions that carry
|
|
21
|
+
* both (T20A-R3 keeps that check in the type layer as well).
|
|
22
|
+
*/
|
|
23
|
+
export interface ParticleScaleEnvelopeInput {
|
|
24
|
+
readonly start: ParticleScaleEndpointInput;
|
|
25
|
+
readonly end: ParticleScaleEndpointInput;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Normalized envelope endpoint (T20A-R3): always a frozen `{ min, max }`
|
|
29
|
+
* range — scalar author inputs never appear on a normalized definition.
|
|
30
|
+
*/
|
|
31
|
+
export type ParticleScaleEndpoint = Range;
|
|
32
|
+
/**
|
|
33
|
+
* Normalized explicit scale envelope (T20.1): scale begins at `start` and
|
|
34
|
+
* ends at `end`, interpolated linearly from active age. Both endpoints are
|
|
35
|
+
* sampled independently (start first, then end) so shrinking, growth, and
|
|
36
|
+
* fixed scales are all directly expressible. Endpoints are non-negative and
|
|
37
|
+
* finite; zero collapses the particle to a point. Negative scale has no
|
|
38
|
+
* defined rendering semantics and is rejected at definition time (T20A-R1).
|
|
39
|
+
* Mutually exclusive with the legacy `scaleOverLife` range.
|
|
40
|
+
*/
|
|
41
|
+
export interface ParticleScaleEnvelope {
|
|
42
|
+
readonly start: ParticleScaleEndpoint;
|
|
43
|
+
readonly end: ParticleScaleEndpoint;
|
|
44
|
+
}
|
|
45
|
+
export interface SpriteParticleConfig {
|
|
46
|
+
readonly kind: 'sprite';
|
|
47
|
+
readonly sheet: string;
|
|
48
|
+
readonly frame: string;
|
|
49
|
+
readonly size: {
|
|
50
|
+
readonly width: number;
|
|
51
|
+
readonly height: number;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
export interface ShapeParticleConfig {
|
|
55
|
+
readonly kind: 'shape';
|
|
56
|
+
readonly shape: ShapeKind;
|
|
57
|
+
readonly radius?: number;
|
|
58
|
+
readonly width?: number;
|
|
59
|
+
readonly height?: number;
|
|
60
|
+
readonly color?: string;
|
|
61
|
+
}
|
|
62
|
+
export type ParticleConfig = SpriteParticleConfig | ShapeParticleConfig;
|
|
63
|
+
export interface ParticleEffectDefinitionFields {
|
|
64
|
+
readonly capacity: number;
|
|
65
|
+
readonly space: ParticleSpace;
|
|
66
|
+
readonly overflow: ParticleOverflow;
|
|
67
|
+
readonly particle: ParticleConfig;
|
|
68
|
+
readonly burst: {
|
|
69
|
+
readonly count: number;
|
|
70
|
+
};
|
|
71
|
+
readonly lifetimeSeconds: Range;
|
|
72
|
+
readonly speed: Range;
|
|
73
|
+
readonly direction?: Range;
|
|
74
|
+
readonly gravity: Point2D;
|
|
75
|
+
readonly fadeOut: boolean;
|
|
76
|
+
readonly rotation?: Range;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Normalized effect definition (T20A-R3): the scale fields are an exclusive
|
|
80
|
+
* union — a normalized definition carries the explicit `scale` envelope, the
|
|
81
|
+
* legacy `scaleOverLife` range, or neither, never both. Declared as a flat
|
|
82
|
+
* union (not an intersection) so normalized definitions remain assignable to
|
|
83
|
+
* the author-input type at every call site.
|
|
84
|
+
*/
|
|
85
|
+
interface NormalizedExplicitScale extends ParticleEffectDefinitionFields {
|
|
86
|
+
readonly scale: ParticleScaleEnvelope;
|
|
87
|
+
readonly scaleOverLife?: undefined;
|
|
88
|
+
}
|
|
89
|
+
interface NormalizedLegacyScale extends ParticleEffectDefinitionFields {
|
|
90
|
+
readonly scale?: undefined;
|
|
91
|
+
readonly scaleOverLife: Range;
|
|
92
|
+
}
|
|
93
|
+
interface NormalizedNoScale extends ParticleEffectDefinitionFields {
|
|
94
|
+
readonly scale?: undefined;
|
|
95
|
+
readonly scaleOverLife?: undefined;
|
|
96
|
+
}
|
|
97
|
+
export type ParticleEffectDefinition = NormalizedExplicitScale | NormalizedLegacyScale | NormalizedNoScale;
|
|
98
|
+
/**
|
|
99
|
+
* Authoring shape for `defineParticleEffect` (T20A-R3): identical to the
|
|
100
|
+
* normalized definition except that scale envelope endpoints accept scalars,
|
|
101
|
+
* and legacy versus explicit scale authoring is an exclusive union — a
|
|
102
|
+
* definition carrying both `scale` and `scaleOverLife` fails to compile.
|
|
103
|
+
* The runtime boundary still validates every JavaScript input.
|
|
104
|
+
*/
|
|
105
|
+
export type ParticleEffectDefinitionInput = Omit<ParticleEffectDefinition, 'scale' | 'scaleOverLife'> & ({
|
|
106
|
+
readonly scale?: ParticleScaleEnvelopeInput | undefined;
|
|
107
|
+
readonly scaleOverLife?: undefined;
|
|
108
|
+
} | {
|
|
109
|
+
readonly scale?: undefined;
|
|
110
|
+
readonly scaleOverLife?: Range | undefined;
|
|
111
|
+
});
|
|
112
|
+
export interface ParticleEmitCommand {
|
|
113
|
+
/** Center position of the burst origin (the anchor convention for every kind). */
|
|
114
|
+
readonly position: Point2D;
|
|
115
|
+
readonly seed: number;
|
|
116
|
+
}
|
|
117
|
+
export interface ParticleSystemOptions {
|
|
118
|
+
/**
|
|
119
|
+
* Raw author definitions or already-normalized definitions. Every value is
|
|
120
|
+
* validated, cloned, and frozen at the system boundary (T15-F6).
|
|
121
|
+
*/
|
|
122
|
+
readonly effects: Record<string, ParticleEffectDefinitionInput>;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Frozen diagnostic counters. Semantics are per particle:
|
|
126
|
+
* - `emitted`: particles actually placed into a slot this burst (fresh OR
|
|
127
|
+
* recycled).
|
|
128
|
+
* - `dropped`: particles never placed — overflow under `drop-new`, plus every
|
|
129
|
+
* particle of a burst rejected while paused.
|
|
130
|
+
* - `recycled`: placed particles whose slot was previously occupied.
|
|
131
|
+
*/
|
|
132
|
+
export interface ParticleDiagnostics {
|
|
133
|
+
readonly active: number;
|
|
134
|
+
readonly emitted: number;
|
|
135
|
+
readonly dropped: number;
|
|
136
|
+
readonly recycled: number;
|
|
137
|
+
}
|
|
138
|
+
/** A frozen, sampled view of one active particle (safe for consumers). */
|
|
139
|
+
export interface ParticleSlotSnapshot {
|
|
140
|
+
readonly active: boolean;
|
|
141
|
+
readonly age: number;
|
|
142
|
+
readonly lifetime: number;
|
|
143
|
+
readonly origin: Point2D;
|
|
144
|
+
readonly position: Point2D;
|
|
145
|
+
readonly velocity: Point2D;
|
|
146
|
+
readonly rotation: number;
|
|
147
|
+
readonly scale: number;
|
|
148
|
+
readonly opacity: number;
|
|
149
|
+
readonly color: string;
|
|
150
|
+
readonly spawnSequence: number;
|
|
151
|
+
readonly effect: string;
|
|
152
|
+
}
|
|
153
|
+
export interface ParticleSystem<TEffects extends Record<string, ParticleEffectDefinitionInput> = Record<string, ParticleEffectDefinition>> {
|
|
154
|
+
/** Validate + place a burst. Throws for unknown effect or malformed command, even while paused. */
|
|
155
|
+
emit<K extends keyof TEffects & string>(effect: K, command: ParticleEmitCommand): void;
|
|
156
|
+
/** Advance the clock; a no-op while paused. */
|
|
157
|
+
update(deltaSeconds: number): void;
|
|
158
|
+
pause(): void;
|
|
159
|
+
resume(): void;
|
|
160
|
+
dispose(): void;
|
|
161
|
+
getDiagnostics(effect?: keyof TEffects & string): ParticleDiagnostics;
|
|
162
|
+
/**
|
|
163
|
+
* Frozen snapshots of active slots. Mutating the returned objects can never
|
|
164
|
+
* affect controller state (T15-F6).
|
|
165
|
+
*/
|
|
166
|
+
getActiveParticles(effect: keyof TEffects & string): readonly ParticleSlotSnapshot[];
|
|
167
|
+
/** Session-lifecycle helpers: idempotent transitions that never throw on already-paused/running. */
|
|
168
|
+
pauseIfRunning(): void;
|
|
169
|
+
resumeIfPaused(): void;
|
|
170
|
+
/** 'running' | 'paused' | 'disposed' — read once per decision point. */
|
|
171
|
+
readonly status: 'running' | 'paused' | 'disposed';
|
|
172
|
+
/**
|
|
173
|
+
* Typed presentation binding for renderers (T15-F6): exposes frozen
|
|
174
|
+
* definitions plus fixed-capacity sample buffers without revealing pool
|
|
175
|
+
* internals. One binding per renderer generation; creating it does not
|
|
176
|
+
* start any clock.
|
|
177
|
+
*/
|
|
178
|
+
bindPresentation(): ParticlePresentationBinding;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* The exclusive presentation-clock lease (T15-RF3).
|
|
182
|
+
*
|
|
183
|
+
* Exactly one owner may drive the clock. While a driver is held, public
|
|
184
|
+
* `tick()` calls are rejected so ad-hoc callers can never double-advance
|
|
185
|
+
* the system. The driver exposes an idle probe and a wake listener so the
|
|
186
|
+
* scheduler can fully stop while nothing is active and resume on the next
|
|
187
|
+
* accepted emission.
|
|
188
|
+
*/
|
|
189
|
+
export interface ParticleDriverHandle {
|
|
190
|
+
/** Advance + resample. No-op while the owning system is paused/disposed. */
|
|
191
|
+
step(deltaSeconds: number): void;
|
|
192
|
+
/** True when every pool slot is inactive (scheduler may stop). */
|
|
193
|
+
isIdle(): boolean;
|
|
194
|
+
/** Observe emissions that may end an idle period; pass null to clear. */
|
|
195
|
+
setWakeListener(listener: (() => void) | null): void;
|
|
196
|
+
/** Release the exclusive lease; idempotent. */
|
|
197
|
+
release(): void;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* The renderer-facing half of a particle system (T15-F1/F2/F6).
|
|
201
|
+
*
|
|
202
|
+
* A binding owns sampled, fixed-capacity buffers per effect. React views
|
|
203
|
+
* are readers: they never advance the system. The clock itself is held by
|
|
204
|
+
* exactly one driver acquired through `acquireDriver()`.
|
|
205
|
+
*/
|
|
206
|
+
export interface ParticlePresentationBinding {
|
|
207
|
+
/** Generation of the owning system at bind time. */
|
|
208
|
+
readonly systemGeneration: number;
|
|
209
|
+
/** The frozen, validated definition for one effect. Throws when unknown. */
|
|
210
|
+
definition(effect: string): ParticleEffectDefinition;
|
|
211
|
+
/** All bound effect names (stable order). */
|
|
212
|
+
readonly effects: readonly string[];
|
|
213
|
+
/**
|
|
214
|
+
* Manual advance for headless tests and custom drivers. Throws while a
|
|
215
|
+
* driver owns the clock (T15-RF3); otherwise advances the active clock and
|
|
216
|
+
* expires slots. A no-op while paused.
|
|
217
|
+
*/
|
|
218
|
+
tick(deltaSeconds: number): void;
|
|
219
|
+
/** Acquire the exclusive presentation clock. Throws while another owner holds it. */
|
|
220
|
+
acquireDriver(): ParticleDriverHandle;
|
|
221
|
+
/** Whether a driver currently holds the exclusive clock. */
|
|
222
|
+
readonly driverOwned: boolean;
|
|
223
|
+
/** Monotonic revision of the EMISSION REGISTRY (bumped on membership changes). */
|
|
224
|
+
readonly registryRevision: number;
|
|
225
|
+
/** Current accumulated ACTIVE time (freezes while paused). */
|
|
226
|
+
readonly activeClock: number;
|
|
227
|
+
/** Number of active slots summed over all effects (idle probe). */
|
|
228
|
+
readonly activeCount: number;
|
|
229
|
+
/**
|
|
230
|
+
* Deeply frozen per-emission init records for one effect — the diagnostics/
|
|
231
|
+
* readback surface. Positions derive analytically from activeClock.
|
|
232
|
+
*/
|
|
233
|
+
emissions(effect: string): readonly ParticleEmissionRecord[];
|
|
234
|
+
/** Build the bounded UI-runtime registry (frozen). Called on membership changes. */
|
|
235
|
+
buildUiRegistry(): ParticleUiRegistry;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Structural mirror of the React-layer frame snapshot, declared here so the
|
|
239
|
+
* particle types stay renderer-agnostic.
|
|
240
|
+
*/
|
|
241
|
+
export interface ParticleFrameSnapshotLike {
|
|
242
|
+
readonly revision: number;
|
|
243
|
+
readonly effects: Readonly<Record<string, {
|
|
244
|
+
readonly x: number[];
|
|
245
|
+
readonly y: number[];
|
|
246
|
+
readonly rotation: number[];
|
|
247
|
+
readonly scale: number[];
|
|
248
|
+
readonly opacity: number[];
|
|
249
|
+
readonly visible: number[];
|
|
250
|
+
readonly capacity: number;
|
|
251
|
+
}>>;
|
|
252
|
+
}
|
|
253
|
+
/** Fixed-capacity presentation buffers for one effect (T15-F2). */
|
|
254
|
+
export interface ParticleSlotBuffers {
|
|
255
|
+
readonly x: Float32Array;
|
|
256
|
+
readonly y: Float32Array;
|
|
257
|
+
readonly rotation: Float32Array;
|
|
258
|
+
readonly scale: Float32Array;
|
|
259
|
+
readonly opacity: Float32Array;
|
|
260
|
+
readonly visible: Uint8Array;
|
|
261
|
+
readonly capacity: number;
|
|
262
|
+
}
|
|
263
|
+
/** Initial state for one emitted particle, in ACTIVE-time coordinates. */
|
|
264
|
+
export interface ParticleEmissionRecord {
|
|
265
|
+
/** ACTIVE-clock time at which this particle was born. */
|
|
266
|
+
readonly bornAt: number;
|
|
267
|
+
readonly originX: number;
|
|
268
|
+
readonly originY: number;
|
|
269
|
+
readonly vx: number;
|
|
270
|
+
readonly vy: number;
|
|
271
|
+
readonly rotation: number;
|
|
272
|
+
readonly rotationSpeed: number;
|
|
273
|
+
readonly scaleStart: number;
|
|
274
|
+
readonly scaleEnd: number;
|
|
275
|
+
readonly lifetime: number;
|
|
276
|
+
readonly spawnSequence: number;
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* What the presentation layer transfers across the runtime boundary
|
|
280
|
+
* (T15-SF1): bounded per-emission init records plus the scalar clock.
|
|
281
|
+
* Transforms are computed analytically on the UI runtime.
|
|
282
|
+
*/
|
|
283
|
+
export interface ParticleUiRegistry {
|
|
284
|
+
readonly registryRevision: number;
|
|
285
|
+
readonly activeClock: number;
|
|
286
|
+
readonly effects: Readonly<Record<string, {
|
|
287
|
+
readonly capacity: number;
|
|
288
|
+
readonly particles: readonly ParticleEmissionRecord[];
|
|
289
|
+
}>>;
|
|
290
|
+
}
|
|
291
|
+
export {};
|
|
292
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/particles/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA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M,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,QAAQ,CACxB,MAAM,CAAC,MAAM,EAAE;QAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,SAAS,EAAE,SAAS,sBAAsB,EAAE,CAAA;KAAE,CAAC,CACrG,CAAC;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"particles.d.ts","sourceRoot":"","sources":["../../../src/particles.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAmB,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Multitouch button pad (T20).
|
|
3
|
+
*
|
|
4
|
+
* The React surface over the headless button-pad controller
|
|
5
|
+
* (`core/input/buttonPad`): compose any number of {@link GameButton} zones
|
|
6
|
+
* inside a {@link GameButtonPad}; every active pointer is mapped to the zone
|
|
7
|
+
* it covers and press/release edges flow into the session's declared button
|
|
8
|
+
* actions. Unlike RN `Pressable`, simultaneous fingers on different buttons
|
|
9
|
+
* all register — hold left/right and jump at the same time.
|
|
10
|
+
*
|
|
11
|
+
* Semantics carried over from the reference implementation:
|
|
12
|
+
* - Release edges ALWAYS fire on touch up/cancel, so edge-triggered actions
|
|
13
|
+
* (a jump pulse) re-arm for the next press.
|
|
14
|
+
* - A finger sliding between zones reassigns: release + press.
|
|
15
|
+
* - Unmount releases every held action; no input outlives the pad.
|
|
16
|
+
*
|
|
17
|
+
* GS-INPUT-03: zones measure into pad coordinates (never parent-relative),
|
|
18
|
+
* every mounted zone has an owner identity with idempotent cleanup, and
|
|
19
|
+
* terminal cleanup never touches a disposed session.
|
|
20
|
+
* GS-INPUT-04: one invalidation policy — pause, session replacement, and
|
|
21
|
+
* unmount bump an ownership generation stamped onto every scheduled RN
|
|
22
|
+
* callback; stale callbacks die at ingress, pad ownership clears, and a
|
|
23
|
+
* fresh down is required before moves can acquire again.
|
|
24
|
+
*/
|
|
25
|
+
import { type ReactNode } from 'react';
|
|
26
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
27
|
+
import type { InputMap } from '../definition/types.js';
|
|
28
|
+
import type { SceneMap } from '../definition/types.js';
|
|
29
|
+
import type { GameSession } from '../core/session/types.js';
|
|
30
|
+
/** Declared button action names of an input map. */
|
|
31
|
+
export type ButtonActionName<TInput extends InputMap> = {
|
|
32
|
+
[TName in Extract<keyof TInput, string>]: TInput[TName] extends {
|
|
33
|
+
readonly type: 'button';
|
|
34
|
+
} ? TName : never;
|
|
35
|
+
}[Extract<keyof TInput, string>];
|
|
36
|
+
export interface GameButtonPadProps<TScenes extends SceneMap, TInput extends InputMap> {
|
|
37
|
+
/** The session whose input buffer receives button presses. */
|
|
38
|
+
readonly game: GameSession<TScenes, TInput>;
|
|
39
|
+
/** One or more {@link GameButton} zones (any layout). */
|
|
40
|
+
readonly children?: ReactNode;
|
|
41
|
+
/**
|
|
42
|
+
* Container style layered over the default full-surface overlay. The pad
|
|
43
|
+
* never draws and never blocks touches outside mounted GameButtons.
|
|
44
|
+
*/
|
|
45
|
+
readonly style?: StyleProp<ViewStyle>;
|
|
46
|
+
/** Extra hit area around every zone, in dp. Default 0. */
|
|
47
|
+
readonly hitSlop?: number;
|
|
48
|
+
/** Test id for the pad container. */
|
|
49
|
+
readonly testID?: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Map simultaneous multitouch zones onto declared button actions.
|
|
53
|
+
*
|
|
54
|
+
* The pad is an INVISIBLE FULL-SURFACE OVERLAY: it draws nothing and its
|
|
55
|
+
* empty areas let touches pass through (`pointerEvents="box-none"`), so you
|
|
56
|
+
* can render whatever React children you like underneath and position each
|
|
57
|
+
* {@link GameButton} anywhere on screen — flex rows, corners, one thumb-zone
|
|
58
|
+
* per side — with ordinary styles. Only the measured bounds of mounted
|
|
59
|
+
* {@link GameButton} components capture touches; every other point falls
|
|
60
|
+
* through to the content below.
|
|
61
|
+
*/
|
|
62
|
+
export declare function GameButtonPad<TScenes extends SceneMap, TInput extends InputMap>({ game, children, style, hitSlop, testID, }: GameButtonPadProps<TScenes, TInput>): import("react").JSX.Element;
|
|
63
|
+
export interface GameButtonProps {
|
|
64
|
+
/** The declared button action this zone presses. */
|
|
65
|
+
readonly action: string;
|
|
66
|
+
/** Zone content (label, icon, art). */
|
|
67
|
+
readonly children?: ReactNode;
|
|
68
|
+
/** Zone layout + presentation styles. */
|
|
69
|
+
readonly style?: StyleProp<ViewStyle>;
|
|
70
|
+
/** Test id for end-to-end tests. */
|
|
71
|
+
readonly testID?: string;
|
|
72
|
+
/** Accessibility role announced to the OS. */
|
|
73
|
+
readonly accessibilityRole?: 'button';
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* One touch zone of the pad. Layout it however you like; its measured
|
|
77
|
+
* bounds become the multitouch hit area for `action`, in pad coordinates.
|
|
78
|
+
*
|
|
79
|
+
* GS-INPUT-03: the zone registers on layout (provisional, parent-relative)
|
|
80
|
+
* and re-resolves into pad space through native measurement whenever
|
|
81
|
+
* available; unmount and action replacement release the zone exactly once.
|
|
82
|
+
*/
|
|
83
|
+
export declare function GameButton({ action, children, style, testID, accessibilityRole }: GameButtonProps): import("react").JSX.Element;
|
|
84
|
+
//# sourceMappingURL=GameButtonPad.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GameButtonPad.d.ts","sourceRoot":"","sources":["../../../../src/react/GameButtonPad.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAAuB,CAA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AAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,8CAA8C;IAC9C,QAAQ,CAAC,iBAAiB,CAAC,EAAE,QAAQ,CAAC;CACvC;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,iBAAiB,EAAE,EAAE,eAAe,+BAsBjG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GamePointerInput.d.ts","sourceRoot":"","sources":["../../../../src/react/GamePointerInput.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GamePointerInput.d.ts","sourceRoot":"","sources":["../../../../src/react/GamePointerInput.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,QAAQ,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,wBAAqB,CAAC;AAClF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAAuB,CAAC;AAUzD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,sBAAmB,CAAC;AAYpE,qDAAqD;AACrD,KAAK,iBAAiB,CAAC,MAAM,SAAS,QAAQ,IAAI;KAC/C,KAAK,IAAI,OAAO,CAAC,MAAM,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,SAAS,kBAAkB,GAAG,KAAK,GAAG,KAAK;CACnG,CAAC,OAAO,CAAC,MAAM,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAQjC,wEAAwE;AACxE,MAAM,WAAW,qBAAqB,CAAC,OAAO,SAAS,QAAQ,EAAE,MAAM,SAAS,QAAQ;IACtF,8DAA8D;IAC9D,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC5C,6CAA6C;IAC7C,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC3C,mEAAmE;IACnE,QAAQ,CAAC,eAAe,CAAC,EAAE,0BAA0B,CAAC;CACvD;AA+ED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,SAAS,QAAQ,EAAE,MAAM,SAAS,QAAQ,EAAE,EAClF,IAAI,EACJ,MAAM,EACN,eAAe,GAChB,EAAE,qBAAqB,CAAC,OAAO,EAAE,MAAM,CAAC,+BAmYxC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { type ComponentType, type ReactNode } from 'react';
|
|
2
2
|
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
3
3
|
import { type SharedValue } from 'react-native-reanimated';
|
|
4
|
+
import type { CameraCut2D } from '../camera2d.js';
|
|
4
5
|
import type { InputMap, SceneMap } from '../definition/types.js';
|
|
5
6
|
import type { AssetGroupMap, LoadedAssets } from '../assets/types.js';
|
|
6
7
|
import type { CommitFrame, GameSession } from '../core/session/types.js';
|
|
7
8
|
import type { ResolvedViewport2D } from '../viewport2d/index.js';
|
|
9
|
+
import type { GameCamera2DDefinition } from './camera2d/defineGameCamera2D.js';
|
|
8
10
|
import type { GameViewInstrumentation } from './instrumentation.js';
|
|
9
11
|
import { type ViewportBinding } from './viewportBinding.js';
|
|
10
12
|
/** Stable imperative values supplied to a Skia renderer component. */
|
|
@@ -18,6 +20,12 @@ export interface GameRendererProps<TScenes extends SceneMap, TAssets extends Ass
|
|
|
18
20
|
readonly alpha: SharedValue<number>;
|
|
19
21
|
/** Latest resolved viewport shared with the input adapter. */
|
|
20
22
|
readonly viewport: SharedValue<ResolvedViewport2D | undefined>;
|
|
23
|
+
/**
|
|
24
|
+
* The presented camera cut (T12.3), present only when the game opts in
|
|
25
|
+
* via `camera2D`. Undefined until the first committed camera; camera
|
|
26
|
+
* movement never re-renders React.
|
|
27
|
+
*/
|
|
28
|
+
readonly camera?: SharedValue<CameraCut2D | undefined>;
|
|
21
29
|
/** The stable loaded asset lease (T7.5); shape-only renderers omit it. */
|
|
22
30
|
readonly assets?: LoadedAssets<TAssets>;
|
|
23
31
|
}
|
|
@@ -34,6 +42,13 @@ export interface GameViewProps<TScenes extends SceneMap, TInput extends InputMap
|
|
|
34
42
|
readonly presentationKey?: string | number;
|
|
35
43
|
/** The stable loaded asset lease; shape-only games omit it. */
|
|
36
44
|
readonly assets?: LoadedAssets<TAssets>;
|
|
45
|
+
/**
|
|
46
|
+
* Optional static camera binding (T12.3). When absent, the exact current
|
|
47
|
+
* viewport path is preserved. GameView owns the presented camera; the
|
|
48
|
+
* renderer receives it as a prop and the pointer adapter discovers it
|
|
49
|
+
* from the mounted surface.
|
|
50
|
+
*/
|
|
51
|
+
readonly camera2D?: GameCamera2DDefinition<CommitFrame<TScenes>>;
|
|
37
52
|
/** Stable Skia renderer component for the session's scene snapshots. */
|
|
38
53
|
readonly renderer: ComponentType<GameRendererProps<TScenes, TAssets>>;
|
|
39
54
|
/** Optional measurement callbacks for the Performance Lab (F1). */
|
|
@@ -57,5 +72,16 @@ export interface GameViewport {
|
|
|
57
72
|
readonly viewport: SharedValue<ResolvedViewport2D | undefined>;
|
|
58
73
|
}
|
|
59
74
|
export declare const GameViewportContext: import("react").Context<GameViewport | null>;
|
|
60
|
-
|
|
75
|
+
/**
|
|
76
|
+
* Context supplying the presented camera to pointer input children.
|
|
77
|
+
*
|
|
78
|
+
* The shared value is owned by `GameView` (fed by the per-session
|
|
79
|
+
* presentation), so renderer and pointer adapter observe the same camera
|
|
80
|
+
* generation. `undefined` when the game has no camera.
|
|
81
|
+
*/
|
|
82
|
+
export interface GameCameraSurface {
|
|
83
|
+
readonly presented: SharedValue<CameraCut2D | undefined> | undefined;
|
|
84
|
+
}
|
|
85
|
+
export declare const GameCameraContext: import("react").Context<GameCameraSurface | null>;
|
|
86
|
+
export declare function GameView<TScenes extends SceneMap, TInput extends InputMap, TAssets extends AssetGroupMap = AssetGroupMap>({ game, presentationKey, assets, renderer: Renderer, children, style, instrumentation, camera2D, }: GameViewProps<TScenes, TInput, TAssets>): import("react").JSX.Element;
|
|
61
87
|
//# sourceMappingURL=GameView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GameView.d.ts","sourceRoot":"","sources":["../../../../src/react/GameView.tsx"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,aAAa,
|
|
1
|
+
{"version":3,"file":"GameView.d.ts","sourceRoot":"","sources":["../../../../src/react/GameView.tsx"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,aAAa,EAElB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAoC,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAG7F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,wBAAqB,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAiB,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,0BAAuB,CAAC;AACtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAe,CAAC;AAExD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kCAA+B,CAAC;AAM5E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAmB,CAAC;AACjE,OAAO,EAAsB,KAAK,eAAe,EAAE,MAAM,sBAAmB,CAAC;AAE7E,sEAAsE;AACtE,MAAM,WAAW,iBAAiB,CAChC,OAAO,SAAS,QAAQ,EACxB,OAAO,SAAS,aAAa,GAAG,aAAa;IAE7C,kEAAkE;IAClE,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;IAClD;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACpC,8DA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AkB,GAAG,SAAS,CAAC,CAAC;CAChE;AAED,eAAO,MAAM,mBAAmB,8CAA2C,CAAC;AAE5E;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC,WAAW,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC;CACtE;AAED,eAAO,MAAM,iBAAiB,mDAAgD,CAAC;AAyM/E,wBAAgB,QAAQ,CACtB,OAAO,SAAS,QAAQ,EACxB,MAAM,SAAS,QAAQ,EACvB,OAAO,SAAS,aAAa,GAAG,aAAa,EAC7C,EACA,IAAI,EACJ,eAAe,EACf,MAAM,EACN,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EACR,KAAK,EACL,eAAe,EACf,QAAQ,GACT,EAAE,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,+BA0EzC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createGameAssetStore.d.ts","sourceRoot":"","sources":["../../../../../src/react/assets/createGameAssetStore.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createGameAssetStore.d.ts","sourceRoot":"","sources":["../../../../../src/react/assets/createGameAssetStore.ts"],"names":[],"mappings":"AAiCA,OAAO,KAAK,EACV,aAAa,EAEb,cAAc,EAOf,MAAM,uBAAoB,CAAC;AAI5B,gFAAgF;AAChF,MAAM,WAAW,iBAAiB;IAChC,+BAA+B;IAC/B,KAAK,IAAI,MAAM,CAAC;IAChB,gCAAgC;IAChC,MAAM,IAAI,MAAM,CAAC;IACjB,4DAA4D;IAC5D,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,uDAAuD;AACvD,MAAM,WAAW,cAAc;IAC7B,+DAA+D;IAC/D,QAAQ,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACtD,yDAAyD;IACzD,QAAQ,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAC9D;AAED,yCAAyC;AACzC,MAAM,WAAW,cAAc;IAC7B,iEAAiE;IACjE,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,sEAAsE;IACtE,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;IAC9B,4EAA4E;IAC5E,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CAClD;AAkED,wBAAgB,wBAAwB,CAAC,SAAS,SAAS,aAAa,EACtE,QAAQ,EAAE,SAAS,EACnB,SAAS,EAAE,cAAc,GACxB;IACD,QAAQ,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC;IAClF,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,MAAM,OAAO,CAAC;CACpC,CAuVA;AAED,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGameAssets.d.ts","sourceRoot":"","sources":["../../../../../src/react/assets/useGameAssets.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useGameAssets.d.ts","sourceRoot":"","sources":["../../../../../src/react/assets/useGameAssets.ts"],"names":[],"mappings":"AA4BA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,uBAAoB,CAAC;AACtF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAAwB,CAAC;AAE7D,wEAAwE;AACxE,MAAM,WAAW,SAAS,CAAC,SAAS,SAAS,aAAa;IACxD,QAAQ,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE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AAC,CA6G5B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GameSessionStatus } from '../core/session/types.js';
|
|
1
|
+
import type { GameSessionStatus, GameSubscription } from '../core/session/types.js';
|
|
2
2
|
/** Minimal AppState-like source used to keep this seam platform-neutral. */
|
|
3
3
|
export interface AppLifecycleSource {
|
|
4
4
|
/** The current app state, read synchronously at bind time. */
|
|
@@ -15,6 +15,12 @@ export interface AppLifecycleSession {
|
|
|
15
15
|
pause(): void;
|
|
16
16
|
/** Resume a paused session. */
|
|
17
17
|
resume(): void;
|
|
18
|
+
/**
|
|
19
|
+
* Optional status observation (T10.6): when present, the binder also
|
|
20
|
+
* guards against an external `start()` while the host is inactive, so a
|
|
21
|
+
* frame loop can never escape into the background.
|
|
22
|
+
*/
|
|
23
|
+
addStatusListener?(listener: (status: GameSessionStatus) => void): GameSubscription;
|
|
18
24
|
}
|
|
19
25
|
/**
|
|
20
26
|
* Pause a running session when the app becomes inactive or backgrounded and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bindAppLifecycle.d.ts","sourceRoot":"","sources":["../../../../src/react/bindAppLifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"bindAppLifecycle.d.ts","sourceRoot":"","sources":["../../../../src/react/bindAppLifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,0BAAuB,CAAC;AAGjF,4EAA4E;AAC5E,MAAM,WAAW,kBAAkB;IACjC,8DAA8D;IAC9D,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACjD,gBAAgB,CACd,KAAK,EAAE,QAAQ,EACf,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC/B;QAAE,MAAM,IAAI,IAAI,CAAA;KAAE,CAAC;CACvB;AAED,0DAA0D;AAC1D,MAAM,WAAW,mBAAmB;IAClC,uCAAuC;IACvC,SAAS,IAAI,iBAAiB,CAAC;IAC/B,wDAAwD;IACxD,KAAK,IAAI,IAAI,CAAC;IACd,+BAA+B;IAC/B,MAAM,IAAI,IAAI,CAAC;IACf;;;;OAIG;IACH,iBAAiB,CAAC,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,GAAG,gBAAgB,CAAC;CACrF;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,kBAAkB,EAC1B,OAAO,EAAE,mBAAmB,GAC3B,MAAM,IAAI,CAsEZ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bindGameSession.d.ts","sourceRoot":"","sources":["../../../../src/react/bindGameSession.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,wBAAqB,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,0BAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"bindGameSession.d.ts","sourceRoot":"","sources":["../../../../src/react/bindGameSession.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,wBAAqB,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,0BAAuB,CAAC;AAGtE;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,OAAO,SAAS,QAAQ,EAAE,MAAM,SAAS,QAAQ,EAC/E,IAAI,EAAE,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,EAClC,OAAO,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,KAAK,IAAI,GAC7C,MAAM,IAAI,CAiCZ"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `GameLayer2D` — an ordered parallax layer (T12.5).
|
|
3
|
+
*
|
|
4
|
+
* A small rendering primitive, not a scene graph: the layer draws its
|
|
5
|
+
* children with the presented camera whose center contribution is scaled
|
|
6
|
+
* per axis by the parallax factor. JSX order is render order; no z-index
|
|
7
|
+
* scheduler exists.
|
|
8
|
+
*
|
|
9
|
+
* Frozen policy: parallax scales only the camera center contribution. Zoom
|
|
10
|
+
* and rotation apply fully at every factor; factor 1 is the primary layer,
|
|
11
|
+
* factor 0 is camera-fixed on that axis. The correction is a pure
|
|
12
|
+
* translation relative to the parent camera, so layers never double-apply
|
|
13
|
+
* zoom or rotation.
|
|
14
|
+
*/
|
|
15
|
+
import type { ReactNode } from 'react';
|
|
16
|
+
export declare function GameLayer2D({ parallax, children, }: {
|
|
17
|
+
/** Per-axis parallax factor; defaults to the primary layer `{ x: 1, y: 1 }`. */
|
|
18
|
+
readonly parallax?: {
|
|
19
|
+
readonly x: number;
|
|
20
|
+
readonly y: number;
|
|
21
|
+
};
|
|
22
|
+
readonly children: ReactNode;
|
|
23
|
+
}): import("react").JSX.Element;
|
|
24
|
+
//# sourceMappingURL=GameLayer2D.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GameLayer2D.d.ts","sourceRoot":"","sources":["../../../../../src/react/camera2d/GameLayer2D.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAYvC,wBAAgB,WAAW,CAAC,EAC1B,QAAyB,EACzB,QAAQ,GACT,EAAE;IACD,gFAAgF;IAChF,QAAQ,CAAC,QAAQ,CAAC,EAAE;QAAE,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/D,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;CAC9B,+BASA"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Camera2D definition (T12.3).
|
|
3
|
+
*
|
|
4
|
+
* A static, declarative camera binding: `select` reads the authored camera
|
|
5
|
+
* from committed frames, and the optional `cut` predicate signals an
|
|
6
|
+
* explicit cut (teleports, respawns) where interpolation must snap. The
|
|
7
|
+
* binding is owned by `GameView` and never by the renderer or the pointer
|
|
8
|
+
* adapter, so both consume the same presented generation.
|
|
9
|
+
*/
|
|
10
|
+
import type { Camera2D } from '../../camera2d.js';
|
|
11
|
+
/** Failure context for a camera selector/cut/validation failure (GS-CAMERA-02). */
|
|
12
|
+
export interface GameCameraErrorInfo {
|
|
13
|
+
/** Which stage of the commit transaction failed. */
|
|
14
|
+
readonly phase: 'select' | 'cut' | 'validate';
|
|
15
|
+
/** The original thrown value, preserved verbatim. */
|
|
16
|
+
readonly error: unknown;
|
|
17
|
+
/** The scene whose commit failed. */
|
|
18
|
+
readonly scene: string;
|
|
19
|
+
}
|
|
20
|
+
/** The static camera definition supplied to `GameView`. */
|
|
21
|
+
export interface GameCamera2DDefinition<TFrame> {
|
|
22
|
+
/**
|
|
23
|
+
* Read the authored camera from a committed frame. Runs once per commit
|
|
24
|
+
* on the JS runtime; returning the same value keeps the camera static.
|
|
25
|
+
*/
|
|
26
|
+
readonly select: (frame: TFrame) => Camera2D;
|
|
27
|
+
/**
|
|
28
|
+
* Optional explicit cut signal evaluated per commit. Returning true
|
|
29
|
+
* snaps presentation (no interpolation into the new camera), joining the
|
|
30
|
+
* automatic cuts for scene transitions, session replacement, and
|
|
31
|
+
* binding-generation changes.
|
|
32
|
+
*/
|
|
33
|
+
readonly cut?: (frame: TFrame) => boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Optional failure reporter (GS-CAMERA-02). Invoked at most once per
|
|
36
|
+
* failure episode with the failing phase and scene; a successful commit
|
|
37
|
+
* resets deduplication. Failures without a reporter keep the last valid
|
|
38
|
+
* presentation silently.
|
|
39
|
+
*/
|
|
40
|
+
readonly onError?: (info: GameCameraErrorInfo) => void;
|
|
41
|
+
}
|
|
42
|
+
/** Validate and return a camera definition. */
|
|
43
|
+
export declare function defineGameCamera2D<TFrame>(definition: GameCamera2DDefinition<TFrame>): GameCamera2DDefinition<TFrame>;
|
|
44
|
+
//# sourceMappingURL=defineGameCamera2D.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defineGameCamera2D.d.ts","sourceRoot":"","sources":["../../../../../src/react/camera2d/defineGameCamera2D.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAgB,CAAC;AAE/C,mFAAmF;AACnF,MAAM,WAAW,mBAAmB;IAClC,oDAAoD;IACpD,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,KAAK,GAAG,UAAU,CAAC;IAC9C,qDAAqD;IACrD,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,qCAAqC;IACrC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,2DAA2D;AAC3D,MAAM,WAAW,sBAAsB,CAAC,MAAM;IAC5C;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,QAAQ,CAAC;IAC7C;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;IAC1C;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,mBAAmB,KAAK,IAAI,CAAC;CACxD;AAED,+CAA+C;AAC/C,wBAAgB,kBAAkB,CAAC,MAAM,EACvC,UAAU,EAAE,sBAAsB,CAAC,MAAM,CAAC,GACzC,sBAAsB,CAAC,MAAM,CAAC,CAWhC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type SharedValue } from 'react-native-reanimated';
|
|
2
|
+
import { type CameraCut2D } from '../../camera2d.js';
|
|
3
|
+
import type { CommitFrame } from '../../core/session/types.js';
|
|
4
|
+
import type { SceneMap } from '../../definition/types.js';
|
|
5
|
+
import type { GameCamera2DDefinition } from './defineGameCamera2D.js';
|
|
6
|
+
/** A UI-side camera binding for one session presentation. */
|
|
7
|
+
export interface PresentedCameraBinding<TScenes extends SceneMap> {
|
|
8
|
+
/** Evaluate the selector against one committed frame (JS runtime). */
|
|
9
|
+
commit(frame: CommitFrame<TScenes>): void;
|
|
10
|
+
/** Advance presentation by the current alpha (UI runtime worklet). */
|
|
11
|
+
present(alpha: number): void;
|
|
12
|
+
/** Drop the current state; the presented value stays as-is. */
|
|
13
|
+
dispose(): void;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Create the camera binding for one presentation.
|
|
17
|
+
*
|
|
18
|
+
* The `presented` shared value is owned by `GameView` so the pointer
|
|
19
|
+
* adapter (a sibling of the renderer) reads the same generation.
|
|
20
|
+
*/
|
|
21
|
+
export declare function usePresentedCameraBinding<TScenes extends SceneMap>(definition: GameCamera2DDefinition<CommitFrame<TScenes>> | undefined, presented: SharedValue<CameraCut2D | undefined>): PresentedCameraBinding<TScenes>;
|
|
22
|
+
//# sourceMappingURL=usePresentedCameraBinding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePresentedCameraBinding.d.ts","sourceRoot":"","sources":["../../../../../src/react/camera2d/usePresentedCameraBinding.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAkB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3E,OAAO,EAA6B,KAAK,WAAW,EAAE,MAAM,mBAAgB,CAAC;AAE7E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAsB,CAAC;AAEnE,6DAA6D;AAC7D,MAAM,WAAW,sBAAsB,CAAC,OAAO,SAAS,QAAQ;IAC9D,sEAAsE;IACtE,MAAM,CAAC,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;IAC1C,sEAAsE;IACtE,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,+DAA+D;IAC/D,OAAO,IAAI,IAAI,CAAC;CACjB;AAMD;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,SAAS,QAAQ,EAChE,UAAU,EAAE,sBAAsB,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,GAAG,SAAS,EACpE,SAAS,EAAE,WAAW,CAAC,WAAW,GAAG,SAAS,CAAC,GAC9C,sBAAsB,CAAC,OAAO,CAAC,CAoIjC"}
|