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,42 @@
|
|
|
1
|
+
import type { DeepReadonly } from '../core/session/types.js';
|
|
2
|
+
declare const EventDefsBrand: unique symbol;
|
|
3
|
+
/** A type-witness descriptor for one game event's payload. */
|
|
4
|
+
export interface GameEventDescriptor<TPayload> {
|
|
5
|
+
/** @internal Payload witness — no runtime value. */
|
|
6
|
+
readonly __payload?: TPayload;
|
|
7
|
+
}
|
|
8
|
+
/** A map from event name to its payload type. */
|
|
9
|
+
export type GameEventMap = Record<string, unknown>;
|
|
10
|
+
/** A map from event name to its descriptor (the authored declaration). */
|
|
11
|
+
export type GameEventDefinitions<TMap extends GameEventMap> = {
|
|
12
|
+
readonly [K in keyof TMap]: GameEventDescriptor<TMap[K]>;
|
|
13
|
+
};
|
|
14
|
+
/** Branded event definitions — nominal identity for scene/game binding. */
|
|
15
|
+
export type BrandedGameEventDefs<T extends Record<string, GameEventDescriptor<unknown>>> = T & {
|
|
16
|
+
readonly [EventDefsBrand]?: T;
|
|
17
|
+
};
|
|
18
|
+
/** Infer the payload map from a descriptor map. */
|
|
19
|
+
export type InferGameEventMap<TDefs extends Record<string, GameEventDescriptor<unknown>>> = {
|
|
20
|
+
[K in keyof TDefs as K extends string ? K : never]: TDefs[K] extends GameEventDescriptor<infer P> ? P : never;
|
|
21
|
+
};
|
|
22
|
+
/** One committed event envelope. Identity is `(tick, ordinal)` within a session. */
|
|
23
|
+
export interface GameEventEnvelope<TName extends string, TPayload> {
|
|
24
|
+
readonly name: TName;
|
|
25
|
+
readonly payload: DeepReadonly<TPayload>;
|
|
26
|
+
readonly tick: number;
|
|
27
|
+
readonly scene: string;
|
|
28
|
+
readonly sceneTick: number;
|
|
29
|
+
readonly ordinal: number;
|
|
30
|
+
}
|
|
31
|
+
/** Type-erased envelope for storage and delivery. */
|
|
32
|
+
export type AnyGameEventEnvelope = GameEventEnvelope<string, unknown>;
|
|
33
|
+
/** An emitter scoped to one fixed tick and one scene. */
|
|
34
|
+
export interface GameEventEmitter<TMap extends GameEventMap> {
|
|
35
|
+
emit<TName extends keyof TMap & string>(name: TName, payload: TMap[TName]): void;
|
|
36
|
+
}
|
|
37
|
+
/** Listener for one event name. May be sync or async; rejections are observed without awaiting. */
|
|
38
|
+
export type GameEventListener<TPayload> = (event: GameEventEnvelope<string, TPayload>) => void | Promise<void>;
|
|
39
|
+
/** Infer the listener payload for a given game definition's event map. */
|
|
40
|
+
export type GameEventPayloadFor<TMap extends GameEventMap, TName extends keyof TMap & string> = TMap[TName];
|
|
41
|
+
export {};
|
|
42
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":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,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,qDAAqD;AACrD,MAAM,MAAM,oBAAoB,GAAG,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEtE,yDAAyD;AACzD,MAAM,WAAW,gBAAgB,CAAC,IAAI,SAAS,YAAY;IACzD,IAAI,CAAC,KAAK,SAAS,MAAM,IAAI,GAAG,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;CAClF;AAED,mGAAmG;AACnG,MAAM,MAAM,iBAAiB,CAAC,QAAQ,IAAI,CACxC,KAAK,EAAE,iBAAiB,CAAC,MAAM,EAAE,QAAQ,CAAC,KACvC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAE1B,0EAA0E;AAC1E,MAAM,MAAM,mBAAmB,CAAC,IAAI,SAAS,YAAY,EAAE,KAAK,SAAS,MAAM,IAAI,GAAG,MAAM,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Subpath entry for `rn-gamekit/events`.
|
|
3
|
+
*
|
|
4
|
+
* Typed event definitions, envelopes, payload limits, seeding, and errors.
|
|
5
|
+
* Does not expose internal validation helpers or effect consumers.
|
|
6
|
+
*/
|
|
7
|
+
export { GameEventError } from './events/errors.js';
|
|
8
|
+
export { defineGameEvents, gameEvent } from './events/defineGameEvents.js';
|
|
9
|
+
export { seedGameEvent } from './events/seed.js';
|
|
10
|
+
export { PAYLOAD_LIMITS } from './events/payload.js';
|
|
11
|
+
export type { AnyGameEventEnvelope, GameEventDefinitions, GameEventDescriptor, GameEventEmitter, GameEventEnvelope, GameEventListener, GameEventMap, InferGameEventMap, } from './events/types.js';
|
|
12
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/events.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAiB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,8BAA2B,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAe,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAkB,CAAC;AAClD,YAAY,EACV,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,iBAAiB,GAClB,MAAM,mBAAgB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure geometry helpers (T11.1): AABB centers, translation, expansion, and
|
|
3
|
+
* union, plus vector arithmetic. All functions validate their inputs,
|
|
4
|
+
* preserve them untouched, and return fresh immutable values.
|
|
5
|
+
*/
|
|
6
|
+
import type { Aabb2D, Point2D, Vector2D } from './types.js';
|
|
7
|
+
/** Center of an AABB. */
|
|
8
|
+
export declare function aabbCenter2D(aabb: Aabb2D): Point2D;
|
|
9
|
+
/** Translate an AABB by a delta vector, returning a new AABB. */
|
|
10
|
+
export declare function translateAabb2D(aabb: Aabb2D, delta: Vector2D): Aabb2D;
|
|
11
|
+
/**
|
|
12
|
+
* Expand an AABB symmetrically (or per-axis) by the given amounts.
|
|
13
|
+
*
|
|
14
|
+
* A negative inset shrinks the AABB. The expanded result keeps the same
|
|
15
|
+
* width/height semantics; `inset` is the margin added on each side.
|
|
16
|
+
*/
|
|
17
|
+
export declare function expandAabb2D(aabb: Aabb2D, inset: number | Vector2D): Aabb2D;
|
|
18
|
+
/** The smallest AABB containing both inputs (bounding union). */
|
|
19
|
+
export declare function unionAabb2D(first: Aabb2D, second: Aabb2D): Aabb2D;
|
|
20
|
+
/** Component-wise vector addition. */
|
|
21
|
+
export declare function addVector2D(first: Vector2D, second: Vector2D): Vector2D;
|
|
22
|
+
/** Component-wise vector subtraction (`first - second`). */
|
|
23
|
+
export declare function subtractVector2D(first: Vector2D, second: Vector2D): Vector2D;
|
|
24
|
+
/** Scale a vector by a finite scalar. */
|
|
25
|
+
export declare function scaleVector2D(vector: Vector2D, scalar: number): Vector2D;
|
|
26
|
+
/** Euclidean length of a vector. */
|
|
27
|
+
export declare function lengthVector2D(vector: Vector2D): number;
|
|
28
|
+
/**
|
|
29
|
+
* Normalize a vector to unit length. The zero vector is returned unchanged
|
|
30
|
+
* (never NaN); callers that need a fallback direction choose it explicitly.
|
|
31
|
+
*/
|
|
32
|
+
export declare function normalizeVector2D(vector: Vector2D): Vector2D;
|
|
33
|
+
/** Euclidean distance between two points. */
|
|
34
|
+
export declare function distancePoint2D(first: Point2D, second: Point2D): number;
|
|
35
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/geometry/helpers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAS,CAAC;AAQzD,yBAAyB;AACzB,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAMlD;AAED,iEAAiE;AACjE,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,GAAG,MAAM,CASrE;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,CAgB3E;AAYD,iEAAiE;AACjE,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAajE;AAED,sCAAsC;AACtC,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,GAAG,QAAQ,CAIvE;AAED,4DAA4D;AAC5D,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,GAAG,QAAQ,CAI5E;AAED,yCAAyC;AACzC,wBAAgB,aAAa,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,QAAQ,CAUxE;AAED,oCAAoC;AACpC,wBAAgB,cAAc,CAAC,MAAM,EAAE,QAAQ,GAAG,MAAM,CAGvD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,QAAQ,GAAG,QAAQ,CAO5D;AAED,6CAA6C;AAC7C,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,CAIvE"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type { Aabb2D, Circle2D, Point2D, Segment2D, Vector2D } from './types.js';
|
|
2
|
+
export { GeometryError, type GeometryErrorCode } from './validation.js';
|
|
3
|
+
export { aabbCenter2D, addVector2D, distancePoint2D, expandAabb2D, lengthVector2D, normalizeVector2D, scaleVector2D, subtractVector2D, translateAabb2D, unionAabb2D, } from './helpers.js';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/geometry/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,YAAS,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,KAAK,iBAAiB,EAAE,MAAM,iBAAc,CAAC;AACrE,OAAO,EACL,YAAY,EACZ,WAAW,EACX,eAAe,EACf,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,WAAW,GACZ,MAAM,cAAW,CAAC"}
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical 2D geometry values (T11.1).
|
|
3
|
+
*
|
|
4
|
+
* All shapes are immutable plain data in Gamekit's logical world
|
|
5
|
+
* coordinates (positive x right, positive y down). `Aabb2D.x/y` identify the
|
|
6
|
+
* minimum/top-left corner. Width, height, and radius are finite and
|
|
7
|
+
* nonnegative; malformed values throw `GeometryError` at the public
|
|
8
|
+
* operation boundary and never masquerade as "no collision".
|
|
9
|
+
*/
|
|
1
10
|
/** A plain 2D point in logical/world or surface coordinate space. */
|
|
2
11
|
export interface Point2D {
|
|
3
12
|
/** Horizontal coordinate. */
|
|
@@ -5,4 +14,44 @@ export interface Point2D {
|
|
|
5
14
|
/** Vertical coordinate. */
|
|
6
15
|
readonly y: number;
|
|
7
16
|
}
|
|
17
|
+
/** A plain 2D vector (translation, displacement, or direction). */
|
|
18
|
+
export interface Vector2D {
|
|
19
|
+
/** Horizontal component. */
|
|
20
|
+
readonly x: number;
|
|
21
|
+
/** Vertical component. */
|
|
22
|
+
readonly y: number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* An axis-aligned rectangle in logical world units.
|
|
26
|
+
*
|
|
27
|
+
* `x`/`y` are the top-left corner (the minimum corner in Gamekit's
|
|
28
|
+
* positive-down convention). Shape-compatible with the viewport `Rect`
|
|
29
|
+
* type: any `Rect` is also a valid `Aabb2D` by shape, and vice versa.
|
|
30
|
+
*/
|
|
31
|
+
export interface Aabb2D {
|
|
32
|
+
/** Left edge. */
|
|
33
|
+
readonly x: number;
|
|
34
|
+
/** Top edge. */
|
|
35
|
+
readonly y: number;
|
|
36
|
+
/** Width, finite and nonnegative. */
|
|
37
|
+
readonly width: number;
|
|
38
|
+
/** Height, finite and nonnegative. */
|
|
39
|
+
readonly height: number;
|
|
40
|
+
}
|
|
41
|
+
/** A circle in logical world units. */
|
|
42
|
+
export interface Circle2D {
|
|
43
|
+
/** Center x. */
|
|
44
|
+
readonly x: number;
|
|
45
|
+
/** Center y. */
|
|
46
|
+
readonly y: number;
|
|
47
|
+
/** Radius, finite and nonnegative. */
|
|
48
|
+
readonly radius: number;
|
|
49
|
+
}
|
|
50
|
+
/** A directed segment (ray-style query input). */
|
|
51
|
+
export interface Segment2D {
|
|
52
|
+
/** Segment start point. */
|
|
53
|
+
readonly start: Point2D;
|
|
54
|
+
/** Segment end point. */
|
|
55
|
+
readonly end: Point2D;
|
|
56
|
+
}
|
|
8
57
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/geometry/types.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,MAAM,WAAW,OAAO;IACtB,6BAA6B;IAC7B,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,2BAA2B;IAC3B,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/geometry/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,qEAAqE;AACrE,MAAM,WAAW,OAAO;IACtB,6BAA6B;IAC7B,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,2BAA2B;IAC3B,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,mEAAmE;AACnE,MAAM,WAAW,QAAQ;IACvB,4BAA4B;IAC5B,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,0BAA0B;IAC1B,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,MAAM;IACrB,iBAAiB;IACjB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB;IAChB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,qCAAqC;IACrC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,sCAAsC;IACtC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,uCAAuC;AACvC,MAAM,WAAW,QAAQ;IACvB,gBAAgB;IAChB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB;IAChB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,kDAAkD;AAClD,MAAM,WAAW,SAAS;IACxB,2BAA2B;IAC3B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,yBAAyB;IACzB,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;CACvB"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Geometry validation and structured errors (T11.1).
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the package's structured-error style (`GameAssetError`): a stable
|
|
5
|
+
* machine-readable code plus the offending field. Validation happens at
|
|
6
|
+
* public operation boundaries; helpers never coerce or reorder malformed
|
|
7
|
+
* values into valid shapes.
|
|
8
|
+
*
|
|
9
|
+
* Numeric policy (GS-GEOMETRY-01): validators require the declared
|
|
10
|
+
* structural shape (a null/array/scalar argument fails with
|
|
11
|
+
* GEOMETRY_INVALID_SHAPE, never a TypeError) and finite components within
|
|
12
|
+
* ordinary game-world magnitudes. Derived-value overflow from extreme
|
|
13
|
+
* finite inputs is out of contract: helpers do not re-validate results,
|
|
14
|
+
* and zero-length normalization of an overflowing length stays a zero
|
|
15
|
+
* vector by the existing defined behavior.
|
|
16
|
+
*/
|
|
17
|
+
import type { Aabb2D, Circle2D, Point2D, Segment2D, Vector2D } from './types.js';
|
|
18
|
+
/** Stable error codes for geometry and collision input. */
|
|
19
|
+
export type GeometryErrorCode = 'GEOMETRY_INVALID_NUMBER' | 'GEOMETRY_INVALID_SIZE' | 'GEOMETRY_INVALID_BITS' | 'GEOMETRY_INVALID_SEGMENT' | 'GEOMETRY_INVALID_SHAPE' | 'GEOMETRY_DUPLICATE_ID' | 'GEOMETRY_SPATIAL_INDEX_RANGE';
|
|
20
|
+
/** A structured geometry or collision input failure. */
|
|
21
|
+
export declare class GeometryError extends Error {
|
|
22
|
+
/** Stable machine-readable code. */
|
|
23
|
+
readonly code: GeometryErrorCode;
|
|
24
|
+
/** Field path within the value that caused the failure. */
|
|
25
|
+
readonly field: string;
|
|
26
|
+
constructor(code: GeometryErrorCode, field: string, message: string);
|
|
27
|
+
}
|
|
28
|
+
/** Assert a finite number (rejects NaN and ±Infinity). */
|
|
29
|
+
export declare function assertFiniteNumber(value: number, field: string): void;
|
|
30
|
+
/** Assert a finite, nonnegative size (width, height, radius). */
|
|
31
|
+
export declare function assertNonnegativeSize(value: number, field: string): void;
|
|
32
|
+
/** Assert an unsigned 32-bit integer (collision filters and bit masks). */
|
|
33
|
+
export declare function assertUnsigned32Bits(value: number, field: string): void;
|
|
34
|
+
/** Validate a point or vector component pair. */
|
|
35
|
+
export declare function assertValidPoint2D(point: Point2D, name?: string): void;
|
|
36
|
+
/** Validate a vector (same shape as a point, distinct naming). */
|
|
37
|
+
export declare function assertValidVector2D(vector: Vector2D, name?: string): void;
|
|
38
|
+
/** Validate an AABB: finite corner, finite nonnegative size. */
|
|
39
|
+
export declare function assertValidAabb2D(aabb: Aabb2D, name?: string): void;
|
|
40
|
+
/** Validate a circle: finite center, finite nonnegative radius. */
|
|
41
|
+
export declare function assertValidCircle2D(circle: Circle2D, name?: string): void;
|
|
42
|
+
/** Validate a segment: finite endpoints that are not both degenerate checks. */
|
|
43
|
+
export declare function assertValidSegment2D(segment: Segment2D, name?: string): void;
|
|
44
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1 @@
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EAAmE;AACnE,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,SAAW,GAAG,IAAI,CAK3E;AACD,gFAAgF;AAChF,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,SAAY,GAAG,IAAI,CAW/E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geometry.d.ts","sourceRoot":"","sources":["../../../src/geometry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,cAAc,qBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createGameHaptics.d.ts","sourceRoot":"","sources":["../../../../src/haptics/createGameHaptics.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,WAAW,EAA+B,MAAM,YAAS,CAAC;AAyClG,wBAAgB,iBAAiB,CAAC,OAAO,CAAC,EAAE,wBAAwB,GAAG,WAAW,CA0KjF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/haptics/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,gBAAiB,SAAQ,KAAK;IAChC,IAAI,SAAsB;gBACvB,OAAO,EAAE,MAAM;CAG5B;AAED,wBAAgB,8BAA8B,IAAI,gBAAgB,CAIjE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/haptics/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAqB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAU,CAAC;AAC5C,YAAY,EAAE,wBAAwB,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAS,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Injectable resolver for the optional `react-native-pulsar` peer
|
|
3
|
+
* (GS-HAPTICS-02).
|
|
4
|
+
*
|
|
5
|
+
* The adapter surface is the package's PUBLIC entry — `Presets`,
|
|
6
|
+
* `Settings.getHapticsSupportLevel()`, and the `HapticSupport` enum —
|
|
7
|
+
* verified against installed react-native-pulsar 1.7.0. No TurboModule
|
|
8
|
+
* digging, no private root functions: capability queries go through the
|
|
9
|
+
* single Settings adapter, and a missing method fails closed downstream.
|
|
10
|
+
*/
|
|
11
|
+
export type LoadedPulsar = {
|
|
12
|
+
Presets: {
|
|
13
|
+
System: Record<string, () => void>;
|
|
14
|
+
};
|
|
15
|
+
Settings: {
|
|
16
|
+
getHapticsSupportLevel(): number;
|
|
17
|
+
};
|
|
18
|
+
HapticSupport?: Record<string, number>;
|
|
19
|
+
};
|
|
20
|
+
export declare function __setPulsarLoader(fn: (() => LoadedPulsar) | null): void;
|
|
21
|
+
export declare function loadPulsar(): LoadedPulsar;
|
|
22
|
+
//# sourceMappingURL=resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../../../src/haptics/resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE;QACP,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC,CAAC;KACpC,CAAC;IACF,QAAQ,EAAE;QACR,sBAAsB,IAAI,MAAM,CAAC;KAClC,CAAC;IACF,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACxC,CAAC;AAIF,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,CAAC,MAAM,YAAY,CAAC,GAAG,IAAI,GAAG,IAAI,CAEvE;AAED,wBAAgB,UAAU,IAAI,YAAY,CA+BzC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { GameLifecycleSource } from '../core/session/types.js';
|
|
2
|
+
export type HapticPreset = 'impact' | 'selection' | 'success' | 'warning' | 'error' | 'light' | 'medium' | 'heavy';
|
|
3
|
+
export interface HapticsResult {
|
|
4
|
+
readonly played: boolean;
|
|
5
|
+
readonly reason?: 'unsupported' | 'muted' | 'throttled' | 'disposed' | 'paused' | 'error';
|
|
6
|
+
}
|
|
7
|
+
export interface GameHaptics {
|
|
8
|
+
play(preset: HapticPreset): HapticsResult;
|
|
9
|
+
isSupported(preset: HapticPreset): boolean;
|
|
10
|
+
setMuted(muted: boolean): void;
|
|
11
|
+
isMuted(): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Public pause gate (T20.7, GS-HAPTICS-01): while paused, `play` drops
|
|
14
|
+
* transient requests with reason `'paused'`. Independent from the
|
|
15
|
+
* lifecycle gate, AppState backgrounding, and mute — any one alone
|
|
16
|
+
* suppresses feedback, and clearing one never clears another.
|
|
17
|
+
*/
|
|
18
|
+
setPaused(paused: boolean): void;
|
|
19
|
+
/**
|
|
20
|
+
* Follow a session lifecycle source (T20.3/T20.7, GS-HAPTICS-01): applies
|
|
21
|
+
* the source's current status immediately, then pauses on every
|
|
22
|
+
* non-running transition and resumes on `'running'`. Returns a detach
|
|
23
|
+
* function. Detaching removes only this source's gate (manual pause is
|
|
24
|
+
* untouched). AppState backgrounding stays independent.
|
|
25
|
+
*/
|
|
26
|
+
bindLifecycle(source: GameLifecycleSource): () => void;
|
|
27
|
+
dispose(): void;
|
|
28
|
+
}
|
|
29
|
+
export interface CreateGameHapticsOptions {
|
|
30
|
+
readonly muted?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Monotonic clock for the throttle budget (GS-HAPTICS-03). Defaults to
|
|
33
|
+
* `Date.now`; inject a controlled clock for deterministic tests.
|
|
34
|
+
*/
|
|
35
|
+
readonly now?: () => number;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/haptics/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAAuB,CAAC;AAEjE,MAAM,MAAM,YAAY,GACpB,QAAQ,GACR,WAAW,GACX,SAAS,GACT,SAAS,GACT,OAAO,GACP,OAAO,GACP,QAAQ,GACR,OAAO,CAAC;AAEZ,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,OAAO,GAAG,WAAW,GAAG,UAAU,GAAG,QAAQ,GAAG,OAAO,CAAC;CAC3F;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,MAAM,EAAE,YAAY,GAAG,aAAa,CAAC;IAC1C,WAAW,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC;IAC3C,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IAC/B,OAAO,IAAI,OAAO,CAAC;IACnB;;;;;OAKG;IACH,SAAS,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACjC;;;;;;OAMG;IACH,aAAa,CAAC,MAAM,EAAE,mBAAmB,GAAG,MAAM,IAAI,CAAC;IACvD,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CAC7B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Subpath entry for `rn-gamekit/haptics`.
|
|
3
|
+
* Importing `rn-gamekit` or `rn-gamekit/react` must not load this module.
|
|
4
|
+
*/
|
|
5
|
+
export { createGameHaptics } from './haptics/createGameHaptics.js';
|
|
6
|
+
export { GameHapticsError } from './haptics/errors.js';
|
|
7
|
+
export type { CreateGameHapticsOptions, GameHaptics, HapticPreset, HapticsResult } from './haptics/types.js';
|
|
8
|
+
//# sourceMappingURL=haptics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"haptics.d.ts","sourceRoot":"","sources":["../../../src/haptics.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAA6B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAkB,CAAC;AACpD,YAAY,EAAE,wBAAwB,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAiB,CAAC"}
|
|
@@ -1,16 +1,24 @@
|
|
|
1
|
+
export { clampCameraBounds2D, createCamera2D, filterCameraVisible2D, followCamera2D, getCameraVisibleBounds2D, interpolateCamera2D, intersectsCameraView2D, logicalToWorld2D, sampleCameraShake2D, surfaceToWorld2D, worldToLogical2D, worldToSurface2D, } from './camera2d.js';
|
|
2
|
+
export type { Camera2D, CameraCut2D, CameraShakeOptions2D, CameraViewShape2D, FollowCamera2DOptions2D, } from './camera2d.js';
|
|
1
3
|
export { createGameSession } from './core/session/createGameSession.js';
|
|
4
|
+
export { GameEventError } from './events/errors.js';
|
|
5
|
+
export { defineGameEvents, gameEvent } from './events/defineGameEvents.js';
|
|
6
|
+
export { seedGameEvent } from './events/seed.js';
|
|
7
|
+
export type { AnyGameEventEnvelope, GameEventDefinitions, GameEventDescriptor, GameEventEmitter, GameEventEnvelope, GameEventMap, InferGameEventMap, } from './events/types.js';
|
|
2
8
|
export { GameSessionDisposedError, GameSessionLifecycleError } from './core/session/types.js';
|
|
3
9
|
export type { ButtonState, InputController, InputFrame, PointerState, } from './core/input/types.js';
|
|
4
10
|
export type { DeepReadonly, CommitFrame, GameRenderFrame, GameSession, GameSessionStatus, GameSubscription, } from './core/session/types.js';
|
|
5
11
|
export { advanceSpriteAnimation, pauseSpriteAnimation, playSpriteAnimation, resetSpriteAnimation, resumeSpriteAnimation, setSpriteAnimationSpeed, startSpriteAnimation, } from './sprites/spriteAnimationState.js';
|
|
6
|
-
export { sampleSpriteClipFrame, sampleSpriteClipFrameName, spriteClipDurationMs, } from './sprites/sampleSpriteClip.js';
|
|
12
|
+
export { sampleSpriteClipFrame, sampleSpriteClipFrameName, spriteClipDurationMs, spriteFrameNameForClip, } from './sprites/sampleSpriteClip.js';
|
|
7
13
|
export type { SpriteAnimationState, SpriteClipNames } from './sprites/spriteAnimationState.js';
|
|
8
14
|
export { defineAssets, image, spriteSheet } from './assets/defineAssets.js';
|
|
9
15
|
export { GameAssetError } from './assets/errors.js';
|
|
10
16
|
export type { AssetDescriptor, AssetGroup, AssetGroupMap, AssetSourceHandle, BrandedAssetDescriptor, GameAssetLease, GameAssetManifest, ImageDescriptor, LoadedAssets, LoadedImage, LoadedSpriteSheet, ManifestOf, SpriteAnimationMode, SpriteClip, SpriteFrameRect, SpriteSheetDescriptor, } from './assets/types.js';
|
|
11
17
|
export { defineGame } from './definition/defineGame.js';
|
|
12
18
|
export type { ButtonInputAction, GameDefinition, InputAction, InputMap, PointerInputAction, SceneDefinitionMarker, SceneMap, } from './definition/types.js';
|
|
13
|
-
export
|
|
19
|
+
export { PAYLOAD_LIMITS } from './events/payload.js';
|
|
20
|
+
export * from './geometry.js';
|
|
21
|
+
export * from './collision2d.js';
|
|
14
22
|
export { defineScene } from './scene/defineScene.js';
|
|
15
23
|
export type { SceneDefinition, SceneSnapshot, SceneSnapshotContext, SceneTransitionController, SceneUpdate, } from './scene/types.js';
|
|
16
24
|
export { containsSurfacePoint, resolveViewport2D, surfaceToWorld, worldToSurface, } from './viewport2d/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAkC,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,MAAM,yBAAsB,CAAC;AAC3F,YAAY,EACV,WAAW,EACX,eAAe,EACf,UAAU,EACV,YAAY,GACb,MAAM,uBAAoB,CAAC;AAC5B,YAAY,EACV,YAAY,EACZ,WAAW,EACX,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,yBAAsB,CAAC;AAC9B,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,mCAAgC,CAAC;AACxC,OAAO,EACL,qBAAqB,EACrB,yBAAyB,EACzB,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,qBAAqB,EACrB,cAAc,EACd,wBAAwB,EACxB,mBAAmB,EACnB,sBAAsB,EACtB,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,eAAY,CAAC;AACpB,YAAY,EACV,QAAQ,EACR,WAAW,EACX,oBAAoB,EACpB,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,eAAY,CAAC;AACpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAkC,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAiB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,8BAA2B,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAe,CAAC;AAC9C,YAAY,EACV,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,iBAAiB,GAClB,MAAM,mBAAgB,CAAC;AACxB,OAAO,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,MAAM,yBAAsB,CAAC;AAC3F,YAAY,EACV,WAAW,EACX,eAAe,EACf,UAAU,EACV,YAAY,GACb,MAAM,uBAAo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B,EACpB,iBAAiB,EACjB,cAAc,EACd,cAAc,GACf,MAAM,uBAAc,CAAC;AACtB,YAAY,EACV,WAAW,EACX,IAAI,EACJ,kBAAkB,EAClB,WAAW,EACX,QAAQ,EACR,YAAY,GACb,MAAM,uBAAc,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ParticleEffectDefinitionInput, ParticleSystem, ParticleSystemOptions } from './types.js';
|
|
2
|
+
export declare function createParticleSystem<TEffects extends Record<string, ParticleEffectDefinitionInput>>(options: ParticleSystemOptions & {
|
|
3
|
+
effects: TEffects;
|
|
4
|
+
}): ParticleSystem<TEffects>;
|
|
5
|
+
//# sourceMappingURL=createParticleSystem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createParticleSystem.d.ts","sourceRoot":"","sources":["../../../../src/particles/createParticleSystem.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAMV,6BAA6B,EAG7B,cAAc,EACd,qBAAqB,EACtB,MAAM,YAAS,CAAC;AAiEjB,wBAAgB,oBAAoB,CAClC,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,6BAA6B,CAAC,EAE9D,OAAO,EAAE,qBAAqB,GAAG;IAAE,OAAO,EAAE,QAAQ,CAAA;CAAE,GACrD,cAAc,CAAC,QAAQ,CAAC,CAqa1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defineParticleEffect.d.ts","sourceRoot":"","sources":["../../../../src/particles/defineParticleEffect.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,wBAAwB,EACxB,6BAA6B,EAG9B,MAAM,YAAS,CAAC;AA8CjB,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,6BAA6B,GAAG,wBAAwB,CA+GjG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/particles/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,aAAc,SAAQ,KAAK;IAC7B,IAAI,SAAmB;gBACpB,OAAO,EAAE,MAAM;CAG5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/particles/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAS,CAAC;AACxB,cAAc,aAAU,CAAC;AACzB,cAAc,2BAAwB,CAAC;AACvC,cAAc,2BAAwB,CAAC;AACvC,cAAc,eAAY,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { ParticleEffectDefinition } from './types.js';
|
|
2
|
+
import type { Point2D } from '../geometry/types.js';
|
|
3
|
+
/** Deterministic PRNG (mulberry32). Documented, schedule-independent. */
|
|
4
|
+
export declare function createRng(seed: number): () => number;
|
|
5
|
+
export declare function hashSeed(seed: number): number;
|
|
6
|
+
export declare function sampleRange(rng: () => number, range: {
|
|
7
|
+
min: number;
|
|
8
|
+
max: number;
|
|
9
|
+
}): number;
|
|
10
|
+
/** Internal sampled seed values for one new particle slot. */
|
|
11
|
+
export interface SampledInitial {
|
|
12
|
+
readonly active: boolean;
|
|
13
|
+
readonly age: number;
|
|
14
|
+
readonly lifetime: number;
|
|
15
|
+
readonly origin: Point2D;
|
|
16
|
+
readonly position: Point2D;
|
|
17
|
+
readonly velocity: Point2D;
|
|
18
|
+
readonly rotation: number;
|
|
19
|
+
readonly rotationSpeed: number;
|
|
20
|
+
readonly scaleStart: number;
|
|
21
|
+
readonly scaleEnd: number;
|
|
22
|
+
readonly scale: number;
|
|
23
|
+
readonly opacity: number;
|
|
24
|
+
readonly color: string;
|
|
25
|
+
readonly spawnSequence: number;
|
|
26
|
+
readonly effect: string;
|
|
27
|
+
}
|
|
28
|
+
export declare function sampleInitialSlot(rng: () => number, def: ParticleEffectDefinition, origin: Point2D, spawnSequence: number, effectName: string): SampledInitial;
|
|
29
|
+
/** The pure sampler's input view of a particle's age-independent fields. */
|
|
30
|
+
export interface AgeSource {
|
|
31
|
+
readonly lifetime: number;
|
|
32
|
+
readonly origin: Point2D;
|
|
33
|
+
readonly velocity: Point2D;
|
|
34
|
+
readonly rotation: number;
|
|
35
|
+
readonly rotationSpeed: number;
|
|
36
|
+
readonly scaleStart: number;
|
|
37
|
+
readonly scaleEnd: number;
|
|
38
|
+
}
|
|
39
|
+
export interface SampledTransform {
|
|
40
|
+
readonly x: number;
|
|
41
|
+
readonly y: number;
|
|
42
|
+
readonly rotation: number;
|
|
43
|
+
readonly scale: number;
|
|
44
|
+
readonly opacity: number;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Closed-form sampling from active age (never accumulated):
|
|
48
|
+
* position = origin + v·age + ½·a·age². Positions follow the CENTER anchor
|
|
49
|
+
* convention for every particle kind (T15-F5).
|
|
50
|
+
*/
|
|
51
|
+
export declare function sampleSlotAtAge(slot: AgeSource, def: ParticleEffectDefinition, age: number): SampledTransform;
|
|
52
|
+
/** Floating-point equality tolerance for deterministic comparisons. */
|
|
53
|
+
export declare const PARTICLE_TOLERANCE = 0.0001;
|
|
54
|
+
//# sourceMappingURL=sampling.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sampling.d.ts","sourceRoot":"","sources":["../../../../src/particles/sampling.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAS,CAAC;AACxD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAmB,CAAC;AAEjD,yEAAyE;AACzE,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,MAAM,CASpD;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAK7C;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,MAAM,EAAE,KAAK,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAG1F;AAED,8DAA8D;AAC9D,MA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