@adobe/data 0.8.5 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blob/download-handle.d.ts +4 -0
- package/dist/blob/download-handle.js +2 -0
- package/dist/blob/download-handle.js.map +1 -0
- package/dist/blob/upload-handle.d.ts +4 -0
- package/dist/blob/upload-handle.js +2 -0
- package/dist/blob/upload-handle.js.map +1 -0
- package/dist/ecs/database/calculate-system-order.d.ts +18 -0
- package/dist/ecs/database/calculate-system-order.js +113 -0
- package/dist/ecs/database/calculate-system-order.js.map +1 -0
- package/dist/ecs/database/calculate-system-order.test.d.ts +1 -0
- package/dist/ecs/database/calculate-system-order.test.js +168 -0
- package/dist/ecs/database/calculate-system-order.test.js.map +1 -0
- package/dist/ecs/database/create-database.d.ts +6 -6
- package/dist/ecs/database/create-database.js +38 -10
- package/dist/ecs/database/create-database.js.map +1 -1
- package/dist/ecs/database/create-database.test.js +55 -11
- package/dist/ecs/database/create-database.test.js.map +1 -1
- package/dist/ecs/database/create-plugin.d.ts +67 -0
- package/dist/ecs/database/create-plugin.js +47 -0
- package/dist/ecs/database/create-plugin.js.map +1 -0
- package/dist/ecs/database/create-plugin.test.d.ts +1 -0
- package/dist/ecs/database/create-plugin.test.js +435 -0
- package/dist/ecs/database/create-plugin.test.js.map +1 -0
- package/dist/ecs/database/database-schema/create-database-schema.d.ts +3 -3
- package/dist/ecs/database/database-schema/create-database-schema.js +7 -3
- package/dist/ecs/database/database-schema/create-database-schema.js.map +1 -1
- package/dist/ecs/database/database-schema/database-schema.d.ts +4 -3
- package/dist/ecs/database/database.d.ts +60 -18
- package/dist/ecs/database/database.js +47 -1
- package/dist/ecs/database/database.js.map +1 -1
- package/dist/ecs/database/database.test.d.ts +1 -0
- package/dist/ecs/database/database.test.js +200 -0
- package/dist/ecs/database/database.test.js.map +1 -0
- package/dist/ecs/database/index.d.ts +1 -1
- package/dist/ecs/database/index.js +1 -1
- package/dist/ecs/database/index.js.map +1 -1
- package/dist/ecs/database/observe-dependent-value.test.js +8 -16
- package/dist/ecs/database/observe-dependent-value.test.js.map +1 -1
- package/dist/ecs/database/observe-select-entities.performance.test.js +21 -17
- package/dist/ecs/database/observe-select-entities.performance.test.js.map +1 -1
- package/dist/ecs/database/observe-select-entities.test.js +24 -20
- package/dist/ecs/database/observe-select-entities.test.js.map +1 -1
- package/dist/ecs/database/observed/create-observed-database.js +6 -1
- package/dist/ecs/database/observed/create-observed-database.js.map +1 -1
- package/dist/ecs/database/observed/create-observed-database.test.js +119 -59
- package/dist/ecs/database/observed/create-observed-database.test.js.map +1 -1
- package/dist/ecs/database/observed/observed-database.d.ts +3 -0
- package/dist/ecs/database/public/create-database-from-schema.test.d.ts +1 -0
- package/dist/ecs/database/public/create-database-from-schema.test.js +153 -0
- package/dist/ecs/database/public/create-database-from-schema.test.js.map +1 -0
- package/dist/ecs/database/public/create-database.d.ts +22 -0
- package/dist/ecs/database/public/create-database.js +336 -0
- package/dist/ecs/database/public/create-database.js.map +1 -0
- package/dist/ecs/database/public/create-database.test.d.ts +1 -0
- package/dist/ecs/database/public/create-database.test.js +993 -0
- package/dist/ecs/database/public/create-database.test.js.map +1 -0
- package/dist/ecs/database/public/index.d.ts +1 -0
- package/dist/ecs/database/public/index.js +22 -0
- package/dist/ecs/database/public/index.js.map +1 -0
- package/dist/ecs/database/reconciling/create-reconciling-database.d.ts +2 -9
- package/dist/ecs/database/reconciling/create-reconciling-database.js +87 -118
- package/dist/ecs/database/reconciling/create-reconciling-database.js.map +1 -1
- package/dist/ecs/database/reconciling/create-reconciling-database.test.js +94 -167
- package/dist/ecs/database/reconciling/create-reconciling-database.test.js.map +1 -1
- package/dist/ecs/database/reconciling/reconciling-database.d.ts +5 -2
- package/dist/ecs/database/reconciling/reconciling-entry.d.ts +0 -11
- package/dist/ecs/database/reconciling/reconciling-entry.js +0 -34
- package/dist/ecs/database/reconciling/reconciling-entry.js.map +1 -1
- package/dist/ecs/database/transactional-store/coalesce-actions.d.ts +16 -0
- package/dist/ecs/database/transactional-store/coalesce-actions.js +140 -0
- package/dist/ecs/database/transactional-store/coalesce-actions.js.map +1 -0
- package/dist/ecs/database/transactional-store/coalesce-actions.test.d.ts +1 -0
- package/dist/ecs/database/transactional-store/coalesce-actions.test.js +433 -0
- package/dist/ecs/database/transactional-store/coalesce-actions.test.js.map +1 -0
- package/dist/ecs/database/transactional-store/create-transactional-store.js +18 -2
- package/dist/ecs/database/transactional-store/create-transactional-store.js.map +1 -1
- package/dist/ecs/database/transactional-store/create-transactional-store.test.js +98 -22
- package/dist/ecs/database/transactional-store/create-transactional-store.test.js.map +1 -1
- package/dist/ecs/database/transactional-store/entity-id-preservation.test.d.ts +1 -0
- package/dist/ecs/database/transactional-store/entity-id-preservation.test.js +106 -0
- package/dist/ecs/database/transactional-store/entity-id-preservation.test.js.map +1 -0
- package/dist/ecs/database/transactional-store/transactional-store.d.ts +2 -0
- package/dist/ecs/database/type-inference-example.d.ts +1 -0
- package/dist/ecs/database/type-inference-example.js +2 -0
- package/dist/ecs/database/type-inference-example.js.map +1 -0
- package/dist/ecs/entity/entity.d.ts +8 -0
- package/dist/ecs/entity/entity.js +3 -0
- package/dist/ecs/entity/entity.js.map +1 -0
- package/dist/ecs/entity/u32.d.ts +8 -0
- package/dist/ecs/entity/u32.js +24 -0
- package/dist/ecs/entity/u32.js.map +1 -0
- package/dist/ecs/plugins/index.d.ts +1 -0
- package/dist/ecs/plugins/index.js +23 -0
- package/dist/ecs/plugins/index.js.map +1 -0
- package/dist/ecs/plugins/scheduler/index.d.ts +1 -0
- package/dist/ecs/plugins/scheduler/index.js +23 -0
- package/dist/ecs/plugins/scheduler/index.js.map +1 -0
- package/dist/ecs/plugins/scheduler/scheduler.d.ts +8 -0
- package/dist/ecs/plugins/scheduler/scheduler.js +52 -0
- package/dist/ecs/plugins/scheduler/scheduler.js.map +1 -0
- package/dist/ecs/store/action-functions.d.ts +21 -0
- package/dist/ecs/store/action-functions.js +2 -0
- package/dist/ecs/store/action-functions.js.map +1 -0
- package/dist/ecs/store/constants/functions.d.ts +14 -0
- package/dist/ecs/store/constants/functions.js +31 -0
- package/dist/ecs/store/constants/functions.js.map +1 -0
- package/dist/ecs/store/constants/index.d.ts +2 -0
- package/dist/ecs/store/constants/index.js +24 -0
- package/dist/ecs/store/constants/index.js.map +1 -0
- package/dist/ecs/store/constants/types.d.ts +18 -0
- package/dist/ecs/store/constants/types.js +23 -0
- package/dist/ecs/store/constants/types.js.map +1 -0
- package/dist/ecs/store/create-store-schema-test.js +70 -8
- package/dist/ecs/store/create-store-schema-test.js.map +1 -1
- package/dist/ecs/store/create-store.d.ts +1 -1
- package/dist/ecs/store/create-store.js +74 -24
- package/dist/ecs/store/create-store.js.map +1 -1
- package/dist/ecs/store/create-store.test.js +171 -171
- package/dist/ecs/store/create-store.test.js.map +1 -1
- package/dist/ecs/store/index.d.ts +0 -1
- package/dist/ecs/store/index.js +0 -1
- package/dist/ecs/store/index.js.map +1 -1
- package/dist/ecs/store/public/create-from-schema.d.ts +6 -0
- package/dist/ecs/store/public/create-from-schema.js +26 -0
- package/dist/ecs/store/public/create-from-schema.js.map +1 -0
- package/dist/ecs/store/public/create-store.d.ts +8 -0
- package/dist/ecs/store/public/create-store.js +127 -0
- package/dist/ecs/store/public/create-store.js.map +1 -0
- package/dist/ecs/store/public/create-store.test.d.ts +1 -0
- package/dist/ecs/store/public/create-store.test.js +730 -0
- package/dist/ecs/store/public/create-store.test.js.map +1 -0
- package/dist/ecs/store/public/index.d.ts +3 -0
- package/dist/ecs/store/public/index.js +25 -0
- package/dist/ecs/store/public/index.js.map +1 -0
- package/dist/ecs/store/public/readonly.d.ts +19 -0
- package/dist/ecs/store/public/readonly.js +2 -0
- package/dist/ecs/store/public/readonly.js.map +1 -0
- package/dist/ecs/store/public/schema/create-from-schema.d.ts +6 -0
- package/dist/ecs/store/public/schema/create-from-schema.js +26 -0
- package/dist/ecs/store/public/schema/create-from-schema.js.map +1 -0
- package/dist/ecs/store/public/schema/create.d.ts +10 -0
- package/dist/ecs/store/public/schema/create.js +25 -0
- package/dist/ecs/store/public/schema/create.js.map +1 -0
- package/dist/ecs/store/public/schema/createFromSchema.d.ts +6 -0
- package/dist/ecs/store/public/schema/createFromSchema.js +5 -0
- package/dist/ecs/store/public/schema/createFromSchema.js.map +1 -0
- package/dist/ecs/store/public/schema/public.d.ts +1 -0
- package/dist/ecs/store/public/schema/public.js +23 -0
- package/dist/ecs/store/public/schema/public.js.map +1 -0
- package/dist/ecs/store/public/schema/schema.d.ts +11 -0
- package/dist/ecs/store/public/schema/schema.js +23 -0
- package/dist/ecs/store/public/schema/schema.js.map +1 -0
- package/dist/ecs/store/public/types.d.ts +11 -0
- package/dist/ecs/store/public/types.js +23 -0
- package/dist/ecs/store/public/types.js.map +1 -0
- package/dist/ecs/store/store-schema/create-store-schema-test.d.ts +1 -0
- package/dist/ecs/store/store-schema/create-store-schema-test.js +33 -0
- package/dist/ecs/store/store-schema/create-store-schema-test.js.map +1 -0
- package/dist/ecs/store/store-schema/create-store-schema.d.ts +1 -0
- package/dist/ecs/store/store-schema/create-store-schema.js +45 -0
- package/dist/ecs/store/store-schema/create-store-schema.js.map +1 -0
- package/dist/ecs/store/store-schema/index.d.ts +1 -0
- package/dist/ecs/store/store-schema/index.js +21 -0
- package/dist/ecs/store/store-schema/index.js.map +1 -0
- package/dist/ecs/store/store-schema/store-schema.d.ts +1 -0
- package/dist/ecs/store/store-schema/store-schema.js +57 -0
- package/dist/ecs/store/store-schema/store-schema.js.map +1 -0
- package/dist/ecs/store/store.d.ts +48 -13
- package/dist/ecs/store/store.js +37 -8
- package/dist/ecs/store/store.js.map +1 -1
- package/dist/ecs/store/store.test.d.ts +1 -0
- package/dist/ecs/store/store.test.js +211 -0
- package/dist/ecs/store/store.test.js.map +1 -0
- package/dist/ecs/undo-redo-service/create-undo-redo-service.js +1 -1
- package/dist/ecs/undo-redo-service/create-undo-redo-service.js.map +1 -1
- package/dist/ecs/undo-redo-service/create-undo-redo-service.test.js +10 -6
- package/dist/ecs/undo-redo-service/create-undo-redo-service.test.js.map +1 -1
- package/dist/ecs/world/create-world.d.ts +7 -0
- package/dist/ecs/world/create-world.js +113 -0
- package/dist/ecs/world/create-world.js.map +1 -0
- package/dist/ecs/world/create-world.test.d.ts +1 -0
- package/dist/ecs/world/create-world.test.js +499 -0
- package/dist/ecs/world/create-world.test.js.map +1 -0
- package/dist/ecs/world/index.d.ts +5 -0
- package/dist/ecs/world/index.js +27 -0
- package/dist/ecs/world/index.js.map +1 -0
- package/dist/ecs/world/system-phase.d.ts +5 -0
- package/dist/ecs/world/system-phase.js +14 -0
- package/dist/ecs/world/system-phase.js.map +1 -0
- package/dist/ecs/world/system.d.ts +25 -0
- package/dist/ecs/world/system.js +2 -0
- package/dist/ecs/world/system.js.map +1 -0
- package/dist/ecs/world/world-schema/create-world-schema-test.d.ts +1 -0
- package/dist/ecs/world/world-schema/create-world-schema-test.js +55 -0
- package/dist/ecs/world/world-schema/create-world-schema-test.js.map +1 -0
- package/dist/ecs/world/world-schema/create-world-schema.d.ts +19 -0
- package/dist/ecs/world/world-schema/create-world-schema.js +33 -0
- package/dist/ecs/world/world-schema/create-world-schema.js.map +1 -0
- package/dist/ecs/world/world-schema/index.d.ts +2 -0
- package/dist/ecs/world/world-schema/index.js +24 -0
- package/dist/ecs/world/world-schema/index.js.map +1 -0
- package/dist/ecs/world/world-schema/world-schema.d.ts +18 -0
- package/dist/ecs/world/world-schema/world-schema.js +23 -0
- package/dist/ecs/world/world-schema/world-schema.js.map +1 -0
- package/dist/ecs/world/world.d.ts +11 -0
- package/dist/ecs/world/world.js +2 -0
- package/dist/ecs/world/world.js.map +1 -0
- package/dist/graphics/camera/camera.d.ts +62 -0
- package/dist/graphics/camera/camera.js +17 -0
- package/dist/graphics/camera/camera.js.map +1 -0
- package/dist/graphics/camera/index.d.ts +4 -0
- package/dist/graphics/camera/index.js +5 -0
- package/dist/graphics/camera/index.js.map +1 -0
- package/dist/graphics/camera/screen-to-world-ray.d.ts +12 -0
- package/dist/graphics/camera/screen-to-world-ray.js +49 -0
- package/dist/graphics/camera/screen-to-world-ray.js.map +1 -0
- package/dist/graphics/camera/screen-to-world-ray.test.d.ts +1 -0
- package/dist/graphics/camera/screen-to-world-ray.test.js +171 -0
- package/dist/graphics/camera/screen-to-world-ray.test.js.map +1 -0
- package/dist/graphics/camera/to-view-projection.d.ts +3 -0
- package/dist/graphics/camera/to-view-projection.js +8 -0
- package/dist/graphics/camera/to-view-projection.js.map +1 -0
- package/dist/graphics/camera/world-to-screen.d.ts +12 -0
- package/dist/graphics/camera/world-to-screen.js +38 -0
- package/dist/graphics/camera/world-to-screen.js.map +1 -0
- package/dist/graphics/camera/world-to-screen.test.d.ts +1 -0
- package/dist/graphics/camera/world-to-screen.test.js +124 -0
- package/dist/graphics/camera/world-to-screen.test.js.map +1 -0
- package/dist/graphics/create-struct-gpu-buffer.d.ts +7 -0
- package/dist/graphics/create-struct-gpu-buffer.js +17 -0
- package/dist/graphics/create-struct-gpu-buffer.js.map +1 -0
- package/dist/graphics/extract-wgsl-bindings.d.ts +5 -0
- package/dist/graphics/extract-wgsl-bindings.js +10 -0
- package/dist/graphics/extract-wgsl-bindings.js.map +1 -0
- package/dist/graphics/frame.d.ts +1 -0
- package/dist/graphics/frame.js +15 -0
- package/dist/graphics/frame.js.map +1 -0
- package/dist/graphics/get-web-gpu-device-and-context.d.ts +1 -0
- package/dist/graphics/get-web-gpu-device-and-context.js +24 -0
- package/dist/graphics/get-web-gpu-device-and-context.js.map +1 -0
- package/dist/graphics/graphics-context.d.ts +1 -0
- package/dist/graphics/graphics-context.js +7 -0
- package/dist/graphics/graphics-context.js.map +1 -0
- package/dist/graphics/index.d.ts +5 -0
- package/dist/graphics/index.js +5 -0
- package/dist/graphics/index.js.map +1 -0
- package/dist/graphics/to-gpu-buffer.d.ts +2 -0
- package/dist/graphics/to-gpu-buffer.js +14 -0
- package/dist/graphics/to-gpu-buffer.js.map +1 -0
- package/dist/internal/array-buffer-like/grow.d.ts +1 -0
- package/dist/internal/array-buffer-like/grow.js +9 -0
- package/dist/internal/array-buffer-like/grow.js.map +1 -0
- package/dist/lit/hooks/use-drag-transaction.d.ts +1 -1
- package/dist/math/aabb/aabb.d.ts +3 -52
- package/dist/math/aabb/aabb.js +2 -97
- package/dist/math/aabb/aabb.js.map +1 -1
- package/dist/math/aabb/constants/functions.d.ts +15 -0
- package/dist/math/aabb/constants/functions.js +76 -0
- package/dist/math/aabb/constants/functions.js.map +1 -0
- package/dist/math/aabb/constants/index.d.ts +3 -0
- package/dist/math/aabb/constants/index.js +25 -0
- package/dist/math/aabb/constants/index.js.map +1 -0
- package/dist/math/aabb/constants/layout.d.ts +1 -0
- package/dist/math/aabb/constants/layout.js +25 -0
- package/dist/math/aabb/constants/layout.js.map +1 -0
- package/dist/math/aabb/constants/schema.d.ts +33 -0
- package/dist/math/aabb/constants/schema.js +37 -0
- package/dist/math/aabb/constants/schema.js.map +1 -0
- package/dist/math/aabb/functions.d.ts +1 -0
- package/dist/math/aabb/functions.js +23 -0
- package/dist/math/aabb/functions.js.map +1 -0
- package/dist/math/aabb/lineIntersection.d.ts +10 -0
- package/dist/math/aabb/lineIntersection.js +42 -0
- package/dist/math/aabb/lineIntersection.js.map +1 -0
- package/dist/math/aabb-face/aabb-face.d.ts +3 -53
- package/dist/math/aabb-face/aabb-face.js +1 -135
- package/dist/math/aabb-face/aabb-face.js.map +1 -1
- package/dist/math/aabb-face/aabb-face.test.js +1 -1
- package/dist/math/aabb-face/aabb-face.test.js.map +1 -1
- package/dist/math/aabb-face/constants/functions.d.ts +47 -0
- package/dist/math/aabb-face/constants/functions.js +148 -0
- package/dist/math/aabb-face/constants/functions.js.map +1 -0
- package/dist/math/aabb-face/constants/index.d.ts +2 -0
- package/dist/math/aabb-face/constants/index.js +24 -0
- package/dist/math/aabb-face/constants/index.js.map +1 -0
- package/dist/math/aabb-face/constants/schema.d.ts +5 -0
- package/dist/math/aabb-face/constants/schema.js +27 -0
- package/dist/math/aabb-face/constants/schema.js.map +1 -0
- package/dist/math/aabb-face/face.d.ts +51 -0
- package/dist/math/aabb-face/face.js +110 -0
- package/dist/math/aabb-face/face.js.map +1 -0
- package/dist/math/aabb-face/face.test.d.ts +1 -0
- package/dist/math/aabb-face/face.test.js +94 -0
- package/dist/math/aabb-face/face.test.js.map +1 -0
- package/dist/math/aabb-face/functions.d.ts +47 -0
- package/dist/math/aabb-face/functions.js +148 -0
- package/dist/math/aabb-face/functions.js.map +1 -0
- package/dist/math/aabb-face/index.d.ts +4 -0
- package/dist/math/aabb-face/index.js +23 -0
- package/dist/math/aabb-face/index.js.map +1 -0
- package/dist/math/aabb-face/public.d.ts +2 -0
- package/dist/math/aabb-face/public.js +24 -0
- package/dist/math/aabb-face/public.js.map +1 -0
- package/dist/math/aabb-face/schema.d.ts +5 -0
- package/dist/math/aabb-face/schema.js +27 -0
- package/dist/math/aabb-face/schema.js.map +1 -0
- package/dist/math/box/box.d.ts +50 -0
- package/dist/math/box/box.js +23 -0
- package/dist/math/box/box.js.map +1 -0
- package/dist/math/f32/constants/index.d.ts +1 -0
- package/dist/math/f32/constants/index.js +23 -0
- package/dist/math/f32/constants/index.js.map +1 -0
- package/dist/math/f32/constants/schema.d.ts +5 -0
- package/dist/math/f32/constants/schema.js +24 -0
- package/dist/math/f32/constants/schema.js.map +1 -0
- package/dist/math/f32/f32.d.ts +3 -8
- package/dist/math/f32/f32.js +1 -6
- package/dist/math/f32/f32.js.map +1 -1
- package/dist/math/face/face.d.ts +51 -0
- package/dist/math/face/face.js +110 -0
- package/dist/math/face/face.js.map +1 -0
- package/dist/math/face/face.test.d.ts +1 -0
- package/dist/math/face/face.test.js +94 -0
- package/dist/math/face/face.test.js.map +1 -0
- package/dist/math/i32/constants/index.d.ts +1 -0
- package/dist/math/i32/constants/index.js +23 -0
- package/dist/math/i32/constants/index.js.map +1 -0
- package/dist/math/i32/constants/schema.d.ts +6 -0
- package/dist/math/i32/constants/schema.js +24 -0
- package/dist/math/i32/constants/schema.js.map +1 -0
- package/dist/math/i32/i32.d.ts +3 -9
- package/dist/math/i32/i32.js +1 -6
- package/dist/math/i32/i32.js.map +1 -1
- package/dist/math/line2/constants/functions.d.ts +5 -0
- package/dist/math/line2/constants/functions.js +61 -0
- package/dist/math/line2/constants/functions.js.map +1 -0
- package/dist/math/line2/constants/index.d.ts +3 -0
- package/dist/math/line2/constants/index.js +25 -0
- package/dist/math/line2/constants/index.js.map +1 -0
- package/dist/math/line2/constants/layout.d.ts +1 -0
- package/dist/math/line2/constants/layout.js +25 -0
- package/dist/math/line2/constants/layout.js.map +1 -0
- package/dist/math/line2/constants/schema.d.ts +33 -0
- package/dist/math/line2/constants/schema.js +37 -0
- package/dist/math/line2/constants/schema.js.map +1 -0
- package/dist/math/line2/line2.d.ts +3 -41
- package/dist/math/line2/line2.js +1 -60
- package/dist/math/line2/line2.js.map +1 -1
- package/dist/math/line3/constants/functions.d.ts +17 -0
- package/dist/math/line3/constants/functions.js +70 -0
- package/dist/math/line3/constants/functions.js.map +1 -0
- package/dist/math/line3/constants/index.d.ts +3 -0
- package/dist/math/line3/constants/index.js +25 -0
- package/dist/math/line3/constants/index.js.map +1 -0
- package/dist/math/line3/constants/layout.d.ts +1 -0
- package/dist/math/line3/constants/layout.js +25 -0
- package/dist/math/line3/constants/layout.js.map +1 -0
- package/dist/math/line3/constants/schema.d.ts +33 -0
- package/dist/math/line3/constants/schema.js +37 -0
- package/dist/math/line3/constants/schema.js.map +1 -0
- package/dist/math/line3/line3.d.ts +3 -53
- package/dist/math/line3/line3.js +1 -68
- package/dist/math/line3/line3.js.map +1 -1
- package/dist/math/mat4x4/constants/functions.d.ts +23 -0
- package/dist/math/mat4x4/constants/functions.js +236 -0
- package/dist/math/mat4x4/constants/functions.js.map +1 -0
- package/dist/math/mat4x4/constants/index.d.ts +3 -0
- package/dist/math/mat4x4/constants/index.js +25 -0
- package/dist/math/mat4x4/constants/index.js.map +1 -0
- package/dist/math/mat4x4/constants/layout.d.ts +1 -0
- package/dist/math/mat4x4/constants/layout.js +25 -0
- package/dist/math/mat4x4/constants/layout.js.map +1 -0
- package/dist/math/mat4x4/constants/schema.d.ts +11 -0
- package/dist/math/mat4x4/constants/schema.js +30 -0
- package/dist/math/mat4x4/constants/schema.js.map +1 -0
- package/dist/math/mat4x4/mat4x4.d.ts +3 -36
- package/dist/math/mat4x4/mat4x4.js +1 -228
- package/dist/math/mat4x4/mat4x4.js.map +1 -1
- package/dist/math/picking/face.d.ts +1 -0
- package/dist/math/picking/face.js +2 -0
- package/dist/math/picking/face.js.map +1 -0
- package/dist/math/picking/get-closest-entity-to-line.d.ts +4 -0
- package/dist/math/picking/get-closest-entity-to-line.js +30 -0
- package/dist/math/picking/get-closest-entity-to-line.js.map +1 -0
- package/dist/math/picking/get-closest-entity-to-point.d.ts +4 -0
- package/dist/math/picking/get-closest-entity-to-point.js +27 -0
- package/dist/math/picking/get-closest-entity-to-point.js.map +1 -0
- package/dist/math/picking/get-intersecting-entities.d.ts +12 -0
- package/dist/math/picking/get-intersecting-entities.js +15 -0
- package/dist/math/picking/get-intersecting-entities.js.map +1 -0
- package/dist/math/picking/getClosestEntityToLine.d.ts +4 -0
- package/dist/math/picking/getClosestEntityToLine.js +29 -0
- package/dist/math/picking/getClosestEntityToLine.js.map +1 -0
- package/dist/math/picking/getClosestEntityToPoint.d.ts +4 -0
- package/dist/math/picking/getClosestEntityToPoint.js +27 -0
- package/dist/math/picking/getClosestEntityToPoint.js.map +1 -0
- package/dist/math/picking/getIntersectingEntities.d.ts +12 -0
- package/dist/math/picking/getIntersectingEntities.js +15 -0
- package/dist/math/picking/getIntersectingEntities.js.map +1 -0
- package/dist/math/picking/index.d.ts +5 -0
- package/dist/math/picking/index.js +27 -0
- package/dist/math/picking/index.js.map +1 -0
- package/dist/math/picking/pick-from-tables.d.ts +19 -0
- package/dist/math/picking/pick-from-tables.js +63 -0
- package/dist/math/picking/pick-from-tables.js.map +1 -0
- package/dist/math/picking/pick-result.d.ts +12 -0
- package/dist/math/picking/pick-result.js +23 -0
- package/dist/math/picking/pick-result.js.map +1 -0
- package/dist/math/plane/constants/functions.d.ts +16 -0
- package/dist/math/plane/constants/functions.js +54 -0
- package/dist/math/plane/constants/functions.js.map +1 -0
- package/dist/math/plane/constants/index.d.ts +3 -0
- package/dist/math/plane/constants/index.js +25 -0
- package/dist/math/plane/constants/index.js.map +1 -0
- package/dist/math/plane/constants/layout.d.ts +1 -0
- package/dist/math/plane/constants/layout.js +25 -0
- package/dist/math/plane/constants/layout.js.map +1 -0
- package/dist/math/plane/constants/schema.d.ts +24 -0
- package/dist/{schema/type.js → math/plane/constants/schema.js} +7 -7
- package/dist/math/plane/constants/schema.js.map +1 -0
- package/dist/math/plane/plane.d.ts +3 -42
- package/dist/math/plane/plane.js +1 -49
- package/dist/math/plane/plane.js.map +1 -1
- package/dist/math/quat/constants/index.d.ts +3 -0
- package/dist/math/quat/constants/index.js +25 -0
- package/dist/math/quat/constants/index.js.map +1 -0
- package/dist/math/quat/constants/layout.d.ts +1 -0
- package/dist/math/quat/constants/layout.js +25 -0
- package/dist/math/quat/constants/layout.js.map +1 -0
- package/dist/math/quat/constants/schema.d.ts +11 -0
- package/dist/math/quat/constants/schema.js +30 -0
- package/dist/math/quat/constants/schema.js.map +1 -0
- package/dist/math/quat/quat.d.ts +3 -56
- package/dist/math/quat/quat.js +1 -250
- package/dist/math/quat/quat.js.map +1 -1
- package/dist/math/transform/debug-inverse.d.ts +1 -0
- package/dist/math/transform/debug-inverse.js +28 -0
- package/dist/math/transform/debug-inverse.js.map +1 -0
- package/dist/math/transform/debug-quat.d.ts +1 -0
- package/dist/math/transform/debug-quat.js +23 -0
- package/dist/math/transform/debug-quat.js.map +1 -0
- package/dist/math/transform/debug-test.d.ts +1 -0
- package/dist/math/transform/debug-test.js +34 -0
- package/dist/math/transform/debug-test.js.map +1 -0
- package/dist/math/transform/transform.d.ts +58 -0
- package/dist/math/transform/transform.js +101 -0
- package/dist/math/transform/transform.js.map +1 -0
- package/dist/math/transform/transform.test.d.ts +1 -0
- package/dist/math/transform/transform.test.js +309 -0
- package/dist/math/transform/transform.test.js.map +1 -0
- package/dist/math/u32/constants/index.d.ts +1 -0
- package/dist/math/u32/constants/index.js +23 -0
- package/dist/math/u32/constants/index.js.map +1 -0
- package/dist/math/u32/constants/schema.d.ts +6 -0
- package/dist/math/u32/constants/schema.js +24 -0
- package/dist/math/u32/constants/schema.js.map +1 -0
- package/dist/math/u32/u32.d.ts +3 -9
- package/dist/math/u32/u32.js +1 -6
- package/dist/math/u32/u32.js.map +1 -1
- package/dist/math/vec2/constants/functions.d.ts +48 -0
- package/dist/math/vec2/constants/functions.js +104 -0
- package/dist/math/vec2/constants/functions.js.map +1 -0
- package/dist/math/vec2/constants/index.d.ts +3 -0
- package/dist/math/vec2/constants/index.js +25 -0
- package/dist/math/vec2/constants/index.js.map +1 -0
- package/dist/math/vec2/constants/layout.d.ts +1 -0
- package/dist/math/vec2/constants/layout.js +25 -0
- package/dist/math/vec2/constants/layout.js.map +1 -0
- package/dist/math/vec2/constants/schema.d.ts +11 -0
- package/dist/math/vec2/constants/schema.js +30 -0
- package/dist/math/vec2/constants/schema.js.map +1 -0
- package/dist/math/vec2/functions/abs.d.ts +2 -0
- package/dist/math/vec2/functions/abs.js +23 -0
- package/dist/math/vec2/functions/abs.js.map +1 -0
- package/dist/math/vec2/functions/acos.d.ts +2 -0
- package/dist/math/vec2/functions/acos.js +23 -0
- package/dist/math/vec2/functions/acos.js.map +1 -0
- package/dist/math/vec2/functions/acosh.d.ts +2 -0
- package/dist/math/vec2/functions/acosh.js +23 -0
- package/dist/math/vec2/functions/acosh.js.map +1 -0
- package/dist/math/vec2/functions/add.d.ts +2 -0
- package/dist/math/vec2/functions/add.js +23 -0
- package/dist/math/vec2/functions/add.js.map +1 -0
- package/dist/math/vec2/functions/asin.d.ts +2 -0
- package/dist/math/vec2/functions/asin.js +23 -0
- package/dist/math/vec2/functions/asin.js.map +1 -0
- package/dist/math/vec2/functions/asinh.d.ts +2 -0
- package/dist/math/vec2/functions/asinh.js +23 -0
- package/dist/math/vec2/functions/asinh.js.map +1 -0
- package/dist/math/vec2/functions/atan.d.ts +2 -0
- package/dist/math/vec2/functions/atan.js +23 -0
- package/dist/math/vec2/functions/atan.js.map +1 -0
- package/dist/math/vec2/functions/atanh.d.ts +2 -0
- package/dist/math/vec2/functions/atanh.js +23 -0
- package/dist/math/vec2/functions/atanh.js.map +1 -0
- package/dist/math/vec2/functions/ceil.d.ts +2 -0
- package/dist/math/vec2/functions/ceil.js +23 -0
- package/dist/math/vec2/functions/ceil.js.map +1 -0
- package/dist/math/vec2/functions/clamp.d.ts +2 -0
- package/dist/math/vec2/functions/clamp.js +25 -0
- package/dist/math/vec2/functions/clamp.js.map +1 -0
- package/dist/math/vec2/functions/cos.d.ts +2 -0
- package/dist/math/vec2/functions/cos.js +23 -0
- package/dist/math/vec2/functions/cos.js.map +1 -0
- package/dist/math/vec2/functions/cosh.d.ts +2 -0
- package/dist/math/vec2/functions/cosh.js +23 -0
- package/dist/math/vec2/functions/cosh.js.map +1 -0
- package/dist/math/vec2/functions/distance.d.ts +2 -0
- package/dist/math/vec2/functions/distance.js +25 -0
- package/dist/math/vec2/functions/distance.js.map +1 -0
- package/dist/math/vec2/functions/dot.d.ts +2 -0
- package/dist/math/vec2/functions/dot.js +23 -0
- package/dist/math/vec2/functions/dot.js.map +1 -0
- package/dist/math/vec2/functions/exp-2.d.ts +2 -0
- package/dist/math/vec2/functions/exp-2.js +23 -0
- package/dist/math/vec2/functions/exp-2.js.map +1 -0
- package/dist/math/vec2/functions/exp.d.ts +2 -0
- package/dist/math/vec2/functions/exp.js +23 -0
- package/dist/math/vec2/functions/exp.js.map +1 -0
- package/dist/math/vec2/functions/face-forward.d.ts +2 -0
- package/dist/math/vec2/functions/face-forward.js +25 -0
- package/dist/math/vec2/functions/face-forward.js.map +1 -0
- package/dist/math/vec2/functions/floor.d.ts +2 -0
- package/dist/math/vec2/functions/floor.js +23 -0
- package/dist/math/vec2/functions/floor.js.map +1 -0
- package/dist/math/vec2/functions/fract.d.ts +2 -0
- package/dist/math/vec2/functions/fract.js +23 -0
- package/dist/math/vec2/functions/fract.js.map +1 -0
- package/dist/math/vec2/functions/functions.d.ts +48 -0
- package/dist/math/vec2/functions/functions.js +104 -0
- package/dist/math/vec2/functions/functions.js.map +1 -0
- package/dist/math/vec2/functions/index.d.ts +3 -0
- package/dist/math/vec2/functions/index.js +25 -0
- package/dist/math/vec2/functions/index.js.map +1 -0
- package/dist/math/vec2/functions/layout.d.ts +1 -0
- package/dist/math/vec2/functions/layout.js +25 -0
- package/dist/math/vec2/functions/layout.js.map +1 -0
- package/dist/math/vec2/functions/length.d.ts +2 -0
- package/dist/math/vec2/functions/length.js +23 -0
- package/dist/math/vec2/functions/length.js.map +1 -0
- package/dist/math/vec2/functions/log-2.d.ts +2 -0
- package/dist/math/vec2/functions/log-2.js +23 -0
- package/dist/math/vec2/functions/log-2.js.map +1 -0
- package/dist/math/vec2/functions/log.d.ts +2 -0
- package/dist/math/vec2/functions/log.js +23 -0
- package/dist/math/vec2/functions/log.js.map +1 -0
- package/dist/math/vec2/functions/max.d.ts +2 -0
- package/dist/math/vec2/functions/max.js +23 -0
- package/dist/math/vec2/functions/max.js.map +1 -0
- package/dist/math/vec2/functions/min.d.ts +2 -0
- package/dist/math/vec2/functions/min.js +23 -0
- package/dist/math/vec2/functions/min.js.map +1 -0
- package/dist/math/vec2/functions/mix.d.ts +2 -0
- package/dist/math/vec2/functions/mix.js +26 -0
- package/dist/math/vec2/functions/mix.js.map +1 -0
- package/dist/math/vec2/functions/mod.d.ts +2 -0
- package/dist/math/vec2/functions/mod.js +26 -0
- package/dist/math/vec2/functions/mod.js.map +1 -0
- package/dist/math/vec2/functions/modf.d.ts +5 -0
- package/dist/math/vec2/functions/modf.js +26 -0
- package/dist/math/vec2/functions/modf.js.map +1 -0
- package/dist/math/vec2/functions/negate.d.ts +2 -0
- package/dist/math/vec2/functions/negate.js +23 -0
- package/dist/math/vec2/functions/negate.js.map +1 -0
- package/dist/math/vec2/functions/normalize.d.ts +2 -0
- package/dist/math/vec2/functions/normalize.js +28 -0
- package/dist/math/vec2/functions/normalize.js.map +1 -0
- package/dist/math/vec2/functions/pow.d.ts +2 -0
- package/dist/math/vec2/functions/pow.js +26 -0
- package/dist/math/vec2/functions/pow.js.map +1 -0
- package/dist/math/vec2/functions/reflect.d.ts +2 -0
- package/dist/math/vec2/functions/reflect.js +29 -0
- package/dist/math/vec2/functions/reflect.js.map +1 -0
- package/dist/math/vec2/functions/refract.d.ts +2 -0
- package/dist/math/vec2/functions/refract.js +34 -0
- package/dist/math/vec2/functions/refract.js.map +1 -0
- package/dist/math/vec2/functions/round.d.ts +2 -0
- package/dist/math/vec2/functions/round.js +23 -0
- package/dist/math/vec2/functions/round.js.map +1 -0
- package/dist/math/vec2/functions/scale.d.ts +2 -0
- package/dist/math/vec2/functions/scale.js +23 -0
- package/dist/math/vec2/functions/scale.js.map +1 -0
- package/dist/math/vec2/functions/schema.d.ts +11 -0
- package/dist/math/vec2/functions/schema.js +30 -0
- package/dist/math/vec2/functions/schema.js.map +1 -0
- package/dist/math/vec2/functions/sign.d.ts +2 -0
- package/dist/math/vec2/functions/sign.js +23 -0
- package/dist/math/vec2/functions/sign.js.map +1 -0
- package/dist/math/vec2/functions/sin.d.ts +2 -0
- package/dist/math/vec2/functions/sin.js +23 -0
- package/dist/math/vec2/functions/sin.js.map +1 -0
- package/dist/math/vec2/functions/sinh.d.ts +2 -0
- package/dist/math/vec2/functions/sinh.js +23 -0
- package/dist/math/vec2/functions/sinh.js.map +1 -0
- package/dist/math/vec2/functions/smooth-step.d.ts +2 -0
- package/dist/math/vec2/functions/smooth-step.js +27 -0
- package/dist/math/vec2/functions/smooth-step.js.map +1 -0
- package/dist/math/vec2/functions/sqrt.d.ts +2 -0
- package/dist/math/vec2/functions/sqrt.js +23 -0
- package/dist/math/vec2/functions/sqrt.js.map +1 -0
- package/dist/math/vec2/functions/step.d.ts +2 -0
- package/dist/math/vec2/functions/step.js +26 -0
- package/dist/math/vec2/functions/step.js.map +1 -0
- package/dist/math/vec2/functions/subtract.d.ts +2 -0
- package/dist/math/vec2/functions/subtract.js +23 -0
- package/dist/math/vec2/functions/subtract.js.map +1 -0
- package/dist/math/vec2/functions/tan.d.ts +2 -0
- package/dist/math/vec2/functions/tan.js +23 -0
- package/dist/math/vec2/functions/tan.js.map +1 -0
- package/dist/math/vec2/functions/tanh.d.ts +2 -0
- package/dist/math/vec2/functions/tanh.js +23 -0
- package/dist/math/vec2/functions/tanh.js.map +1 -0
- package/dist/math/vec2/functions/trunc.d.ts +2 -0
- package/dist/math/vec2/functions/trunc.js +23 -0
- package/dist/math/vec2/functions/trunc.js.map +1 -0
- package/dist/math/vec2/vec2.d.ts +3 -62
- package/dist/math/vec2/vec2.js +1 -96
- package/dist/math/vec2/vec2.js.map +1 -1
- package/dist/math/vec3/constants/functions.d.ts +59 -0
- package/dist/math/vec3/constants/functions.js +159 -0
- package/dist/math/vec3/constants/functions.js.map +1 -0
- package/dist/math/vec3/constants/index.d.ts +3 -0
- package/dist/math/vec3/constants/index.js +25 -0
- package/dist/math/vec3/constants/index.js.map +1 -0
- package/dist/math/vec3/constants/layout.d.ts +1 -0
- package/dist/math/vec3/constants/layout.js +25 -0
- package/dist/math/vec3/constants/layout.js.map +1 -0
- package/dist/math/vec3/constants/schema.d.ts +11 -0
- package/dist/math/vec3/constants/schema.js +30 -0
- package/dist/math/vec3/constants/schema.js.map +1 -0
- package/dist/math/vec3/functions/abs.d.ts +2 -0
- package/dist/math/vec3/functions/abs.js +23 -0
- package/dist/math/vec3/functions/abs.js.map +1 -0
- package/dist/math/vec3/functions/acos.d.ts +2 -0
- package/dist/math/vec3/functions/acos.js +23 -0
- package/dist/math/vec3/functions/acos.js.map +1 -0
- package/dist/math/vec3/functions/acosh.d.ts +2 -0
- package/dist/math/vec3/functions/acosh.js +23 -0
- package/dist/math/vec3/functions/acosh.js.map +1 -0
- package/dist/math/vec3/functions/add.d.ts +2 -0
- package/dist/math/vec3/functions/add.js +27 -0
- package/dist/math/vec3/functions/add.js.map +1 -0
- package/dist/math/vec3/functions/asin.d.ts +2 -0
- package/dist/math/vec3/functions/asin.js +23 -0
- package/dist/math/vec3/functions/asin.js.map +1 -0
- package/dist/math/vec3/functions/asinh.d.ts +2 -0
- package/dist/math/vec3/functions/asinh.js +23 -0
- package/dist/math/vec3/functions/asinh.js.map +1 -0
- package/dist/math/vec3/functions/atan.d.ts +2 -0
- package/dist/math/vec3/functions/atan.js +23 -0
- package/dist/math/vec3/functions/atan.js.map +1 -0
- package/dist/math/vec3/functions/atanh.d.ts +2 -0
- package/dist/math/vec3/functions/atanh.js +23 -0
- package/dist/math/vec3/functions/atanh.js.map +1 -0
- package/dist/math/vec3/functions/ceil.d.ts +2 -0
- package/dist/math/vec3/functions/ceil.js +23 -0
- package/dist/math/vec3/functions/ceil.js.map +1 -0
- package/dist/math/vec3/functions/clamp.d.ts +2 -0
- package/dist/math/vec3/functions/clamp.js +25 -0
- package/dist/math/vec3/functions/clamp.js.map +1 -0
- package/dist/math/vec3/functions/cos.d.ts +2 -0
- package/dist/math/vec3/functions/cos.js +23 -0
- package/dist/math/vec3/functions/cos.js.map +1 -0
- package/dist/math/vec3/functions/cosh.d.ts +2 -0
- package/dist/math/vec3/functions/cosh.js +23 -0
- package/dist/math/vec3/functions/cosh.js.map +1 -0
- package/dist/math/vec3/functions/cross.d.ts +2 -0
- package/dist/math/vec3/functions/cross.js +27 -0
- package/dist/math/vec3/functions/cross.js.map +1 -0
- package/dist/math/vec3/functions/distance-squared.d.ts +2 -0
- package/dist/math/vec3/functions/distance-squared.js +28 -0
- package/dist/math/vec3/functions/distance-squared.js.map +1 -0
- package/dist/math/vec3/functions/distance.d.ts +2 -0
- package/dist/math/vec3/functions/distance.js +25 -0
- package/dist/math/vec3/functions/distance.js.map +1 -0
- package/dist/math/vec3/functions/dot.d.ts +2 -0
- package/dist/math/vec3/functions/dot.js +23 -0
- package/dist/math/vec3/functions/dot.js.map +1 -0
- package/dist/math/vec3/functions/equals.d.ts +2 -0
- package/dist/math/vec3/functions/equals.js +23 -0
- package/dist/math/vec3/functions/equals.js.map +1 -0
- package/dist/math/vec3/functions/exp-2.d.ts +2 -0
- package/dist/math/vec3/functions/exp-2.js +23 -0
- package/dist/math/vec3/functions/exp-2.js.map +1 -0
- package/dist/math/vec3/functions/exp.d.ts +2 -0
- package/dist/math/vec3/functions/exp.js +23 -0
- package/dist/math/vec3/functions/exp.js.map +1 -0
- package/dist/math/vec3/functions/face-forward.d.ts +2 -0
- package/dist/math/vec3/functions/face-forward.js +25 -0
- package/dist/math/vec3/functions/face-forward.js.map +1 -0
- package/dist/math/vec3/functions/floor.d.ts +2 -0
- package/dist/math/vec3/functions/floor.js +23 -0
- package/dist/math/vec3/functions/floor.js.map +1 -0
- package/dist/math/vec3/functions/fract.d.ts +2 -0
- package/dist/math/vec3/functions/fract.js +27 -0
- package/dist/math/vec3/functions/fract.js.map +1 -0
- package/dist/math/vec3/functions/index.d.ts +54 -0
- package/dist/math/vec3/functions/index.js +76 -0
- package/dist/math/vec3/functions/index.js.map +1 -0
- package/dist/math/vec3/functions/layout.d.ts +1 -0
- package/dist/math/vec3/functions/layout.js +25 -0
- package/dist/math/vec3/functions/layout.js.map +1 -0
- package/dist/math/vec3/functions/length-squared.d.ts +2 -0
- package/dist/math/vec3/functions/length-squared.js +23 -0
- package/dist/math/vec3/functions/length-squared.js.map +1 -0
- package/dist/math/vec3/functions/length.d.ts +2 -0
- package/dist/math/vec3/functions/length.js +23 -0
- package/dist/math/vec3/functions/length.js.map +1 -0
- package/dist/math/vec3/functions/log-2.d.ts +2 -0
- package/dist/math/vec3/functions/log-2.js +23 -0
- package/dist/math/vec3/functions/log-2.js.map +1 -0
- package/dist/math/vec3/functions/log.d.ts +2 -0
- package/dist/math/vec3/functions/log.js +23 -0
- package/dist/math/vec3/functions/log.js.map +1 -0
- package/dist/math/vec3/functions/max.d.ts +2 -0
- package/dist/math/vec3/functions/max.js +27 -0
- package/dist/math/vec3/functions/max.js.map +1 -0
- package/dist/math/vec3/functions/min.d.ts +2 -0
- package/dist/math/vec3/functions/min.js +27 -0
- package/dist/math/vec3/functions/min.js.map +1 -0
- package/dist/math/vec3/functions/mix.d.ts +2 -0
- package/dist/math/vec3/functions/mix.js +27 -0
- package/dist/math/vec3/functions/mix.js.map +1 -0
- package/dist/math/vec3/functions/mod.d.ts +2 -0
- package/dist/math/vec3/functions/mod.js +27 -0
- package/dist/math/vec3/functions/mod.js.map +1 -0
- package/dist/math/vec3/functions/modf.d.ts +5 -0
- package/dist/math/vec3/functions/modf.js +26 -0
- package/dist/math/vec3/functions/modf.js.map +1 -0
- package/dist/math/vec3/functions/multiply.d.ts +5 -0
- package/dist/math/vec3/functions/multiply.js +30 -0
- package/dist/math/vec3/functions/multiply.js.map +1 -0
- package/dist/math/vec3/functions/negate.d.ts +2 -0
- package/dist/math/vec3/functions/negate.js +23 -0
- package/dist/math/vec3/functions/negate.js.map +1 -0
- package/dist/math/vec3/functions/normalize.d.ts +2 -0
- package/dist/math/vec3/functions/normalize.js +28 -0
- package/dist/math/vec3/functions/normalize.js.map +1 -0
- package/dist/math/vec3/functions/one.d.ts +2 -0
- package/dist/math/vec3/functions/one.js +23 -0
- package/dist/math/vec3/functions/one.js.map +1 -0
- package/dist/math/vec3/functions/pow.d.ts +2 -0
- package/dist/math/vec3/functions/pow.js +27 -0
- package/dist/math/vec3/functions/pow.js.map +1 -0
- package/dist/math/vec3/functions/random.d.ts +2 -0
- package/dist/math/vec3/functions/random.js +25 -0
- package/dist/math/vec3/functions/random.js.map +1 -0
- package/dist/math/vec3/functions/reflect.d.ts +2 -0
- package/dist/math/vec3/functions/reflect.js +29 -0
- package/dist/math/vec3/functions/reflect.js.map +1 -0
- package/dist/math/vec3/functions/refract.d.ts +2 -0
- package/dist/math/vec3/functions/refract.js +34 -0
- package/dist/math/vec3/functions/refract.js.map +1 -0
- package/dist/math/vec3/functions/round.d.ts +2 -0
- package/dist/math/vec3/functions/round.js +23 -0
- package/dist/math/vec3/functions/round.js.map +1 -0
- package/dist/math/vec3/functions/scale.d.ts +2 -0
- package/dist/math/vec3/functions/scale.js +23 -0
- package/dist/math/vec3/functions/scale.js.map +1 -0
- package/dist/math/vec3/functions/schema.d.ts +11 -0
- package/dist/math/vec3/functions/schema.js +30 -0
- package/dist/math/vec3/functions/schema.js.map +1 -0
- package/dist/math/vec3/functions/sign.d.ts +2 -0
- package/dist/math/vec3/functions/sign.js +23 -0
- package/dist/math/vec3/functions/sign.js.map +1 -0
- package/dist/math/vec3/functions/sin.d.ts +2 -0
- package/dist/math/vec3/functions/sin.js +23 -0
- package/dist/math/vec3/functions/sin.js.map +1 -0
- package/dist/math/vec3/functions/sinh.d.ts +2 -0
- package/dist/math/vec3/functions/sinh.js +23 -0
- package/dist/math/vec3/functions/sinh.js.map +1 -0
- package/dist/math/vec3/functions/smooth-step.d.ts +2 -0
- package/dist/math/vec3/functions/smooth-step.js +32 -0
- package/dist/math/vec3/functions/smooth-step.js.map +1 -0
- package/dist/math/vec3/functions/sqrt.d.ts +2 -0
- package/dist/math/vec3/functions/sqrt.js +23 -0
- package/dist/math/vec3/functions/sqrt.js.map +1 -0
- package/dist/math/vec3/functions/step.d.ts +2 -0
- package/dist/math/vec3/functions/step.js +27 -0
- package/dist/math/vec3/functions/step.js.map +1 -0
- package/dist/math/vec3/functions/subtract.d.ts +2 -0
- package/dist/math/vec3/functions/subtract.js +27 -0
- package/dist/math/vec3/functions/subtract.js.map +1 -0
- package/dist/math/vec3/functions/tan.d.ts +2 -0
- package/dist/math/vec3/functions/tan.js +23 -0
- package/dist/math/vec3/functions/tan.js.map +1 -0
- package/dist/math/vec3/functions/tanh.d.ts +2 -0
- package/dist/math/vec3/functions/tanh.js +23 -0
- package/dist/math/vec3/functions/tanh.js.map +1 -0
- package/dist/math/vec3/functions/trunc.d.ts +2 -0
- package/dist/math/vec3/functions/trunc.js +23 -0
- package/dist/math/vec3/functions/trunc.js.map +1 -0
- package/dist/math/vec3/functions/zero.d.ts +2 -0
- package/dist/math/vec3/functions/zero.js +23 -0
- package/dist/math/vec3/functions/zero.js.map +1 -0
- package/dist/math/vec3/vec3.d.ts +3 -73
- package/dist/math/vec3/vec3.js +1 -151
- package/dist/math/vec3/vec3.js.map +1 -1
- package/dist/math/vec4/constants/functions.d.ts +49 -0
- package/dist/math/vec4/constants/functions.js +150 -0
- package/dist/math/vec4/constants/functions.js.map +1 -0
- package/dist/math/vec4/constants/index.d.ts +3 -0
- package/dist/math/vec4/constants/index.js +25 -0
- package/dist/math/vec4/constants/index.js.map +1 -0
- package/dist/math/vec4/constants/layout.d.ts +1 -0
- package/dist/math/vec4/constants/layout.js +25 -0
- package/dist/math/vec4/constants/layout.js.map +1 -0
- package/dist/math/vec4/constants/schema.d.ts +11 -0
- package/dist/math/vec4/constants/schema.js +30 -0
- package/dist/math/vec4/constants/schema.js.map +1 -0
- package/dist/math/vec4/functions/abs.d.ts +2 -0
- package/dist/math/vec4/functions/abs.js +23 -0
- package/dist/math/vec4/functions/abs.js.map +1 -0
- package/dist/math/vec4/functions/ceil.d.ts +2 -0
- package/dist/math/vec4/functions/ceil.js +23 -0
- package/dist/math/vec4/functions/ceil.js.map +1 -0
- package/dist/math/vec4/functions/clamp.d.ts +2 -0
- package/dist/math/vec4/functions/clamp.js +25 -0
- package/dist/math/vec4/functions/clamp.js.map +1 -0
- package/dist/math/vec4/functions/floor.d.ts +2 -0
- package/dist/math/vec4/functions/floor.js +23 -0
- package/dist/math/vec4/functions/floor.js.map +1 -0
- package/dist/math/vec4/functions/layout.d.ts +1 -0
- package/dist/math/vec4/functions/layout.js +25 -0
- package/dist/math/vec4/functions/layout.js.map +1 -0
- package/dist/math/vec4/functions/max.d.ts +2 -0
- package/dist/math/vec4/functions/max.js +28 -0
- package/dist/math/vec4/functions/max.js.map +1 -0
- package/dist/math/vec4/functions/min.d.ts +2 -0
- package/dist/math/vec4/functions/min.js +28 -0
- package/dist/math/vec4/functions/min.js.map +1 -0
- package/dist/math/vec4/functions/round.d.ts +2 -0
- package/dist/math/vec4/functions/round.js +23 -0
- package/dist/math/vec4/functions/round.js.map +1 -0
- package/dist/math/vec4/functions/schema.d.ts +11 -0
- package/dist/math/vec4/functions/schema.js +30 -0
- package/dist/math/vec4/functions/schema.js.map +1 -0
- package/dist/math/vec4/functions/trunc.d.ts +2 -0
- package/dist/math/vec4/functions/trunc.js +23 -0
- package/dist/math/vec4/functions/trunc.js.map +1 -0
- package/dist/math/vec4/vec4.d.ts +3 -63
- package/dist/math/vec4/vec4.js +1 -142
- package/dist/math/vec4/vec4.js.map +1 -1
- package/dist/observe/create-observable-event.d.ts +1 -1
- package/dist/observe/create-observable-event.js +1 -1
- package/dist/observe/create-observable-event.js.map +1 -1
- package/dist/observe/create-observable-state.d.ts +1 -1
- package/dist/observe/create-observable-state.js +1 -1
- package/dist/observe/create-observable-state.js.map +1 -1
- package/dist/old-ecs/ecs/ecs.test.js +0 -1
- package/dist/old-ecs/ecs/ecs.test.js.map +1 -1
- package/dist/old-ecs/privacy/helper-functions.d.ts +43 -0
- package/dist/old-ecs/privacy/helper-functions.js +76 -0
- package/dist/old-ecs/privacy/helper-functions.js.map +1 -0
- package/dist/old-ecs/privacy/helper-functions.test.d.ts +1 -0
- package/dist/old-ecs/privacy/helper-functions.test.js +173 -0
- package/dist/old-ecs/privacy/helper-functions.test.js.map +1 -0
- package/dist/samples/todo/services/main-service/todo-main-service.d.ts +1 -1
- package/dist/samples/todo/services/state-service/create-todo-database.d.ts +5 -4
- package/dist/samples/todo/services/state-service/create-todo-database.js +3 -3
- package/dist/samples/todo/services/state-service/create-todo-database.js.map +1 -1
- package/dist/samples/todo/services/state-service/create-todo-store.d.ts +3 -2
- package/dist/samples/todo/services/state-service/create-todo-store.js +15 -17
- package/dist/samples/todo/services/state-service/create-todo-store.js.map +1 -1
- package/dist/samples/todo/services/state-service/transactions/toggle-complete.js +1 -1
- package/dist/samples/todo/services/state-service/transactions/toggle-complete.js.map +1 -1
- package/dist/schema/f32.d.ts +1 -1
- package/dist/schema/f32.js +1 -1
- package/dist/schema/f32.js.map +1 -1
- package/dist/schema/i32.d.ts +1 -1
- package/dist/schema/i32.js +1 -1
- package/dist/schema/i32.js.map +1 -1
- package/dist/schema/schema/index.d.ts +2 -0
- package/dist/schema/schema/index.js +23 -0
- package/dist/schema/schema/index.js.map +1 -0
- package/dist/schema/schema/nullable.d.ts +6 -0
- package/dist/schema/schema/nullable.js +6 -0
- package/dist/schema/schema/nullable.js.map +1 -0
- package/dist/schema/schema/public.d.ts +3 -0
- package/dist/schema/schema/public.js +25 -0
- package/dist/schema/schema/public.js.map +1 -0
- package/dist/schema/schema/to-vertex-buffer-layout.d.ts +56 -0
- package/dist/schema/schema/to-vertex-buffer-layout.js +143 -0
- package/dist/schema/schema/to-vertex-buffer-layout.js.map +1 -0
- package/dist/schema/{schema copy.d.ts → schema/types.d.ts} +7 -4
- package/dist/schema/{schema copy.js → schema/types.js} +1 -1
- package/dist/schema/schema/types.js.map +1 -0
- package/dist/schema/u32.d.ts +1 -1
- package/dist/schema/u32.js +1 -1
- package/dist/schema/u32.js.map +1 -1
- package/dist/table/constants/functions.d.ts +3 -0
- package/dist/table/constants/functions.js +34 -0
- package/dist/table/constants/functions.js.map +1 -0
- package/dist/table/constants/index.d.ts +1 -0
- package/dist/table/constants/index.js +23 -0
- package/dist/table/constants/index.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/types.d.ts +2 -0
- package/dist/types/types.js.map +1 -1
- package/package.json +1 -1
- package/dist/schema/FromSchemas.d.ts +0 -4
- package/dist/schema/FromSchemas.js +0 -2
- package/dist/schema/FromSchemas.js.map +0 -1
- package/dist/schema/schema copy.js.map +0 -1
- package/dist/schema/type.d.ts +0 -76
- package/dist/schema/type.js.map +0 -1
|
@@ -1,2 +1,48 @@
|
|
|
1
|
-
|
|
1
|
+
/*MIT License
|
|
2
|
+
|
|
3
|
+
© Copyright 2025 Adobe. All rights reserved.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.*/
|
|
22
|
+
import { createDatabase } from "./public/create-database.js";
|
|
23
|
+
import { createPlugin } from "./create-plugin.js";
|
|
24
|
+
export var Database;
|
|
25
|
+
(function (Database) {
|
|
26
|
+
Database.create = createDatabase;
|
|
27
|
+
let Plugin;
|
|
28
|
+
(function (Plugin) {
|
|
29
|
+
Plugin.create = createPlugin;
|
|
30
|
+
})(Plugin = Database.Plugin || (Database.Plugin = {}));
|
|
31
|
+
})(Database || (Database = {}));
|
|
32
|
+
// Test type inference with new overload pattern
|
|
33
|
+
const testBasePlugin = Database.Plugin.create({
|
|
34
|
+
components: {
|
|
35
|
+
position: { type: "number" },
|
|
36
|
+
health: { type: "number" }
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
const testExtendedPlugin = Database.Plugin.create({
|
|
40
|
+
components: {
|
|
41
|
+
velocity: { type: "number" }
|
|
42
|
+
},
|
|
43
|
+
archetypes: {
|
|
44
|
+
DynamicEntity: ["position", "velocity"],
|
|
45
|
+
LivingEntity: ["position", "health"]
|
|
46
|
+
}
|
|
47
|
+
}, [testBasePlugin]);
|
|
2
48
|
//# sourceMappingURL=database.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"database.js","sourceRoot":"","sources":["../../../src/ecs/database/database.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"database.js","sourceRoot":"","sources":["../../../src/ecs/database/database.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAgBX,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAW7D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAoDlD,MAAM,KAAW,QAAQ,CAqCxB;AArCD,WAAiB,QAAQ;IACV,eAAM,GAAG,cAAc,CAAC;IAsBrC,IAAiB,MAAM,CAYtB;IAZD,WAAiB,MAAM;QAWR,aAAM,GAAG,YAAY,CAAC;IACrC,CAAC,EAZgB,MAAM,GAAN,eAAM,KAAN,eAAM,QAYtB;AAEH,CAAC,EArCgB,QAAQ,KAAR,QAAQ,QAqCxB;AA8CD,gDAAgD;AAChD,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;IAC5C,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC5B,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;KAC3B;CACF,CAAC,CAAC;AAEH,MAAM,kBAAkB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,CAC/C;IACE,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;KAC7B;IACD,UAAU,EAAE;QACV,aAAa,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;QACvC,YAAY,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC;KACrC;CACF,EACD,CAAC,cAAc,CAAC,CACjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
/*MIT License
|
|
2
|
+
|
|
3
|
+
© Copyright 2025 Adobe. All rights reserved.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.*/
|
|
22
|
+
import { describe, it, expect } from "vitest";
|
|
23
|
+
import { Database } from "./database.js";
|
|
24
|
+
describe("Database.create", () => {
|
|
25
|
+
it("should create an empty database without errors when called with no arguments", () => {
|
|
26
|
+
const db = Database.create();
|
|
27
|
+
expect(db).toBeDefined();
|
|
28
|
+
expect(db.store).toBeDefined();
|
|
29
|
+
expect(db.transactions).toBeDefined();
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
describe("Database.Plugin.create", () => {
|
|
33
|
+
describe("partial schema creation", () => {
|
|
34
|
+
it("should create a schema with all properties defaulting to empty objects when given empty schema", () => {
|
|
35
|
+
const schema = Database.Plugin.create({});
|
|
36
|
+
expect(schema.components).toEqual({});
|
|
37
|
+
expect(schema.resources).toEqual({});
|
|
38
|
+
expect(schema.archetypes).toEqual({});
|
|
39
|
+
expect(schema.transactions).toEqual({});
|
|
40
|
+
});
|
|
41
|
+
it("should create a schema with components and default empty objects for other properties when given only components", () => {
|
|
42
|
+
const schema = Database.Plugin.create({
|
|
43
|
+
components: {
|
|
44
|
+
position: { type: "number" },
|
|
45
|
+
velocity: { type: "number" }
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
expect(schema.components).toHaveProperty("position");
|
|
49
|
+
expect(schema.components).toHaveProperty("velocity");
|
|
50
|
+
expect(Object.keys(schema.resources)).toHaveLength(0);
|
|
51
|
+
expect(Object.keys(schema.archetypes)).toHaveLength(0);
|
|
52
|
+
expect(Object.keys(schema.transactions)).toHaveLength(0);
|
|
53
|
+
});
|
|
54
|
+
it("should create a schema with transactions and default empty objects for other properties when given only transactions", () => {
|
|
55
|
+
const testTransaction = () => { };
|
|
56
|
+
const schema = Database.Plugin.create({
|
|
57
|
+
transactions: {
|
|
58
|
+
updateEntity: testTransaction
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
expect(schema.transactions).toHaveProperty("updateEntity");
|
|
62
|
+
expect(schema.transactions.updateEntity).toBe(testTransaction);
|
|
63
|
+
expect(Object.keys(schema.components)).toHaveLength(0);
|
|
64
|
+
expect(Object.keys(schema.resources)).toHaveLength(0);
|
|
65
|
+
expect(Object.keys(schema.archetypes)).toHaveLength(0);
|
|
66
|
+
});
|
|
67
|
+
it("should create a schema with specified properties and defaults for omitted ones when given multiple partial properties", () => {
|
|
68
|
+
const schema = Database.Plugin.create({
|
|
69
|
+
components: {
|
|
70
|
+
health: { type: "number" }
|
|
71
|
+
},
|
|
72
|
+
resources: {
|
|
73
|
+
time: { default: 0 }
|
|
74
|
+
},
|
|
75
|
+
transactions: {
|
|
76
|
+
updateHealth: () => { }
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
expect(schema.components).toHaveProperty("health");
|
|
80
|
+
expect(schema.resources).toHaveProperty("time");
|
|
81
|
+
expect(schema.transactions).toHaveProperty("updateHealth");
|
|
82
|
+
expect(Object.keys(schema.archetypes)).toHaveLength(0);
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
describe("schema merging with dependencies", () => {
|
|
86
|
+
it("should merge both schemas with all properties preserved when given partial schema with dependencies", () => {
|
|
87
|
+
const baseSchema = Database.Plugin.create({
|
|
88
|
+
components: {
|
|
89
|
+
position: { type: "number" }
|
|
90
|
+
},
|
|
91
|
+
resources: {
|
|
92
|
+
time: { default: 0 }
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
const extendedSchema = Database.Plugin.create({
|
|
96
|
+
components: {
|
|
97
|
+
velocity: { type: "number" }
|
|
98
|
+
}
|
|
99
|
+
}, [baseSchema]);
|
|
100
|
+
expect(extendedSchema.components).toHaveProperty("position");
|
|
101
|
+
expect(extendedSchema.components).toHaveProperty("velocity");
|
|
102
|
+
expect(extendedSchema.resources).toHaveProperty("time");
|
|
103
|
+
expect(Object.keys(extendedSchema.components)).toHaveLength(2);
|
|
104
|
+
expect(Object.keys(extendedSchema.resources)).toHaveLength(1);
|
|
105
|
+
});
|
|
106
|
+
it("should create a schema containing only the dependency properties when given empty schema with dependencies", () => {
|
|
107
|
+
const baseSchema = Database.Plugin.create({
|
|
108
|
+
components: {
|
|
109
|
+
transform: { type: "number" }
|
|
110
|
+
},
|
|
111
|
+
transactions: {
|
|
112
|
+
updateTransform: () => { }
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
const emptyExtension = Database.Plugin.create({}, [baseSchema]);
|
|
116
|
+
expect(emptyExtension.components).toHaveProperty("transform");
|
|
117
|
+
expect(emptyExtension.transactions).toHaveProperty("updateTransform");
|
|
118
|
+
expect(Object.keys(emptyExtension.components)).toHaveLength(1);
|
|
119
|
+
expect(Object.keys(emptyExtension.transactions)).toHaveLength(1);
|
|
120
|
+
});
|
|
121
|
+
it("should merge all plugins together with properties from all dependencies when given multiple dependencies", () => {
|
|
122
|
+
const pluginA = Database.Plugin.create({
|
|
123
|
+
components: { a: { type: "number" } }
|
|
124
|
+
});
|
|
125
|
+
const pluginB = Database.Plugin.create({
|
|
126
|
+
components: { b: { type: "number" } }
|
|
127
|
+
});
|
|
128
|
+
const pluginC = Database.Plugin.create({
|
|
129
|
+
components: { c: { type: "number" } }
|
|
130
|
+
});
|
|
131
|
+
const merged = Database.Plugin.create({
|
|
132
|
+
components: { d: { type: "number" } }
|
|
133
|
+
}, [pluginA, pluginB, pluginC]);
|
|
134
|
+
expect(merged.components).toHaveProperty("a");
|
|
135
|
+
expect(merged.components).toHaveProperty("b");
|
|
136
|
+
expect(merged.components).toHaveProperty("c");
|
|
137
|
+
expect(merged.components).toHaveProperty("d");
|
|
138
|
+
expect(Object.keys(merged.components)).toHaveLength(4);
|
|
139
|
+
});
|
|
140
|
+
it("should merge transactions from dependencies", () => {
|
|
141
|
+
const baseSchema = Database.Plugin.create({
|
|
142
|
+
transactions: {
|
|
143
|
+
baseAction: () => { }
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
const extendedSchema = Database.Plugin.create({
|
|
147
|
+
transactions: {
|
|
148
|
+
extendedAction: () => { }
|
|
149
|
+
}
|
|
150
|
+
}, [baseSchema]);
|
|
151
|
+
expect(extendedSchema.transactions).toHaveProperty("baseAction");
|
|
152
|
+
expect(extendedSchema.transactions).toHaveProperty("extendedAction");
|
|
153
|
+
expect(Object.keys(extendedSchema.transactions)).toHaveLength(2);
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
describe("edge cases", () => {
|
|
157
|
+
it("should merge schemas with dependencies - shared components must use same reference", () => {
|
|
158
|
+
const positionComponent = { type: "number" };
|
|
159
|
+
const baseSchema = Database.Plugin.create({
|
|
160
|
+
components: {
|
|
161
|
+
position: positionComponent,
|
|
162
|
+
velocity: { type: "number" }
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
const extendedSchema = Database.Plugin.create({
|
|
166
|
+
components: {
|
|
167
|
+
position: positionComponent, // Must use same reference
|
|
168
|
+
mass: { type: "number" }
|
|
169
|
+
}
|
|
170
|
+
}, [baseSchema]);
|
|
171
|
+
// All components should be present
|
|
172
|
+
expect(extendedSchema.components).toHaveProperty("position");
|
|
173
|
+
expect(extendedSchema.components).toHaveProperty("velocity");
|
|
174
|
+
expect(extendedSchema.components).toHaveProperty("mass");
|
|
175
|
+
expect(Object.keys(extendedSchema.components)).toHaveLength(3);
|
|
176
|
+
});
|
|
177
|
+
it("should handle archetypes that reference components from dependencies", () => {
|
|
178
|
+
const baseSchema = Database.Plugin.create({
|
|
179
|
+
components: {
|
|
180
|
+
position: { type: "number" },
|
|
181
|
+
health: { type: "number" }
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
const extendedSchema = Database.Plugin.create({
|
|
185
|
+
components: {
|
|
186
|
+
velocity: { type: "number" }
|
|
187
|
+
},
|
|
188
|
+
archetypes: {
|
|
189
|
+
DynamicEntity: ["position", "velocity"],
|
|
190
|
+
LivingEntity: ["position", "health"]
|
|
191
|
+
}
|
|
192
|
+
}, [baseSchema]);
|
|
193
|
+
expect(extendedSchema.archetypes).toHaveProperty("DynamicEntity");
|
|
194
|
+
expect(extendedSchema.archetypes).toHaveProperty("LivingEntity");
|
|
195
|
+
expect(extendedSchema.archetypes.DynamicEntity).toEqual(["position", "velocity"]);
|
|
196
|
+
expect(extendedSchema.archetypes.LivingEntity).toEqual(["position", "health"]);
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
});
|
|
200
|
+
//# sourceMappingURL=database.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"database.test.js","sourceRoot":"","sources":["../../../src/ecs/database/database.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAEX,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC7B,EAAE,CAAC,8EAA8E,EAAE,GAAG,EAAE;QACpF,MAAM,EAAE,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC;QAE7B,MAAM,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;QACzB,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;QAC/B,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,WAAW,EAAE,CAAC;IAC1C,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACpC,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE;QACrC,EAAE,CAAC,gGAAgG,EAAE,GAAG,EAAE;YACtG,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YAE1C,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YACtC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YACrC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,OAAO,CA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BACvC,YAAY,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC;iBACvC;aACJ,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;YAEjB,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;YAClE,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;YACjE,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC;YAClF,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;QACnF,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -19,7 +19,7 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.*/
|
|
22
|
-
export * from "./create-database.js";
|
|
22
|
+
export * from "./public/create-database.js";
|
|
23
23
|
export * from "./reconciling/create-reconciling-database.js";
|
|
24
24
|
export * from "./reconciling/reconciling-database.js";
|
|
25
25
|
export * from "./reconciling/reconciling-entry.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ecs/database/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAEX,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ecs/database/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAEX,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8CAA8C,CAAC;AAC7D,cAAc,uCAAuC,CAAC;AACtD,cAAc,oCAAoC,CAAC;AACnD,cAAc,wCAAwC,CAAC;AACvD,cAAc,iCAAiC,CAAC;AAChD,cAAc,eAAe,CAAC;AAC9B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC"}
|
|
@@ -21,18 +21,14 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
21
21
|
SOFTWARE.*/
|
|
22
22
|
import { describe, it, expect } from 'vitest';
|
|
23
23
|
import { observeDependentValue } from './observe-dependent-value.js';
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
24
|
+
import { Store } from '../store/index.js';
|
|
25
|
+
import { Database } from './database.js';
|
|
26
26
|
describe('observeDependentValue', () => {
|
|
27
27
|
it('should compute and observe dependent values from resources', async () => {
|
|
28
28
|
// Create a store with three resources
|
|
29
|
-
const store =
|
|
30
|
-
a: { default: 10 },
|
|
31
|
-
b: { default: 20 },
|
|
32
|
-
c: { default: 30 }
|
|
33
|
-
}, {});
|
|
29
|
+
const store = Store.create({ components: {}, resources: { a: { default: 10 }, b: { default: 20 }, c: { default: 30 } }, archetypes: {} });
|
|
34
30
|
// Create the database
|
|
35
|
-
const database =
|
|
31
|
+
const database = Database.create(store, {
|
|
36
32
|
updateA: (t, value) => {
|
|
37
33
|
t.resources.a = value;
|
|
38
34
|
},
|
|
@@ -89,8 +85,8 @@ describe('observeDependentValue', () => {
|
|
|
89
85
|
expect(observedValues).toEqual([30, 35, 40, 15]);
|
|
90
86
|
});
|
|
91
87
|
it('should handle multiple observers correctly', async () => {
|
|
92
|
-
const store =
|
|
93
|
-
const database =
|
|
88
|
+
const store = Store.create({ components: {}, resources: { a: { default: 1 }, b: { default: 2 }, c: { default: 3 } }, archetypes: {} });
|
|
89
|
+
const database = Database.create(store, {
|
|
94
90
|
updateA: (t, value) => { t.resources.a = value; },
|
|
95
91
|
updateB: (t, value) => { t.resources.b = value; }
|
|
96
92
|
});
|
|
@@ -121,12 +117,8 @@ describe('observeDependentValue', () => {
|
|
|
121
117
|
unsubscribe2();
|
|
122
118
|
});
|
|
123
119
|
it('should handle complex computed values', async () => {
|
|
124
|
-
const store =
|
|
125
|
-
|
|
126
|
-
multiplier: { default: 2 },
|
|
127
|
-
offset: { default: 10 }
|
|
128
|
-
});
|
|
129
|
-
const database = createDatabase(store, {
|
|
120
|
+
const store = Store.create({ components: {}, resources: { count: { default: 5 }, multiplier: { default: 2 }, offset: { default: 10 } }, archetypes: {} });
|
|
121
|
+
const database = Database.create(store, {
|
|
130
122
|
updateCount: (t, value) => { t.resources.count = value; },
|
|
131
123
|
updateMultiplier: (t, value) => { t.resources.multiplier = value; }
|
|
132
124
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observe-dependent-value.test.js","sourceRoot":"","sources":["../../../src/ecs/database/observe-dependent-value.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AACX,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAM,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"observe-dependent-value.test.js","sourceRoot":"","sources":["../../../src/ecs/database/observe-dependent-value.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AACX,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAM,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAG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QAE7B,eAAe;QACf,QAAQ,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QACrC,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;QAExB,yBAAyB;QACzB,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;QAEjC,oBAAoB;QACpB,QAAQ,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;QAC1C,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;QAExB,yBAAyB;QACzB,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;QAErC,WAAW,EAAE,CAAC;IAClB,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -20,29 +20,33 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.*/
|
|
22
22
|
import { describe, expect, it, beforeEach } from "vitest";
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
23
|
+
import { Store } from "../store/index.js";
|
|
24
|
+
import { Database } from "./database.js";
|
|
25
25
|
import { F32 } from "../../math/f32/index.js";
|
|
26
26
|
import { Boolean } from "../../schema/index.js";
|
|
27
27
|
describe("observeSelectEntities Performance Tests", () => {
|
|
28
28
|
let database;
|
|
29
29
|
function createTestDatabase() {
|
|
30
|
-
const store =
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
30
|
+
const store = Store.create({
|
|
31
|
+
components: {
|
|
32
|
+
position: F32.schema,
|
|
33
|
+
health: F32.schema,
|
|
34
|
+
name: { type: "string" },
|
|
35
|
+
score: F32.schema,
|
|
36
|
+
active: Boolean.schema
|
|
37
|
+
},
|
|
38
|
+
resources: {},
|
|
39
|
+
archetypes: {
|
|
40
|
+
Position: ["position"],
|
|
41
|
+
Health: ["health"],
|
|
42
|
+
Name: ["name"],
|
|
43
|
+
PositionHealth: ["position", "health"],
|
|
44
|
+
PositionName: ["position", "name"],
|
|
45
|
+
HealthName: ["health", "name"],
|
|
46
|
+
Full: ["position", "health", "name", "score", "active"]
|
|
47
|
+
}
|
|
44
48
|
});
|
|
45
|
-
return
|
|
49
|
+
return Database.create(store, {
|
|
46
50
|
createPositionEntity(store, args) {
|
|
47
51
|
return store.archetypes.Position.insert(args);
|
|
48
52
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observe-select-entities.performance.test.js","sourceRoot":"","sources":["../../../src/ecs/database/observe-select-entities.performance.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAEX,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"observe-select-entities.performance.test.js","sourceRoot":"","sources":["../../../src/ecs/database/observe-select-entities.performance.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAEX,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD,QAAQ,CAAC,yCAAyC,EAAE,GAAG,E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,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;YACxB,MAAM,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClC,iDAAiD;YACjD,QAAQ,CAAC,YAAY,CAAC,YAAY,CAAC;gBAC/B,MAAM,EAAE,UAAU;gBAClB,MAAM,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE;aAC1B,CAAC,CAAC;YACH,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;YACxB,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;YACxB,MAAM,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClC,WAAW,EAAE,CAAC;QAClB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -20,30 +20,34 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.*/
|
|
22
22
|
import { describe, expect, it, beforeEach, vi } from "vitest";
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
23
|
+
import { Store } from "../store/index.js";
|
|
24
|
+
import { Database } from "./database.js";
|
|
25
25
|
import { F32 } from "../../math/f32/index.js";
|
|
26
26
|
import { Boolean } from "../../schema/index.js";
|
|
27
27
|
describe("observeSelectEntities", () => {
|
|
28
28
|
let database;
|
|
29
29
|
let entities;
|
|
30
30
|
function createTestDatabase() {
|
|
31
|
-
const store =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
31
|
+
const store = Store.create({
|
|
32
|
+
components: {
|
|
33
|
+
position: F32.schema,
|
|
34
|
+
health: F32.schema,
|
|
35
|
+
name: { type: "string" },
|
|
36
|
+
score: F32.schema,
|
|
37
|
+
active: Boolean.schema
|
|
38
|
+
},
|
|
39
|
+
resources: {},
|
|
40
|
+
archetypes: {
|
|
41
|
+
Position: ["position"],
|
|
42
|
+
Health: ["health"],
|
|
43
|
+
Name: ["name"],
|
|
44
|
+
PositionHealth: ["position", "health"],
|
|
45
|
+
PositionName: ["position", "name"],
|
|
46
|
+
HealthName: ["health", "name"],
|
|
47
|
+
Full: ["position", "health", "name", "score", "active"]
|
|
48
|
+
}
|
|
45
49
|
});
|
|
46
|
-
return
|
|
50
|
+
return Database.create(store, {
|
|
47
51
|
createPositionEntity(store, args) {
|
|
48
52
|
return store.archetypes.Position.insert(args);
|
|
49
53
|
},
|
|
@@ -327,13 +331,13 @@ describe("observeSelectEntities", () => {
|
|
|
327
331
|
unsubscribe1();
|
|
328
332
|
unsubscribe2();
|
|
329
333
|
});
|
|
330
|
-
it("should batch multiple synchronous
|
|
334
|
+
it("should batch multiple synchronous actions into single notification", async () => {
|
|
331
335
|
const observer = vi.fn();
|
|
332
336
|
const unsubscribe = database.observe.select(["position"])(observer);
|
|
333
337
|
// Initial notification
|
|
334
338
|
expect(observer).toHaveBeenCalledTimes(1);
|
|
335
339
|
const initialCount = observer.mock.calls[0][0].length;
|
|
336
|
-
// Execute multiple
|
|
340
|
+
// Execute multiple actions synchronously
|
|
337
341
|
const entity1 = database.transactions.createPositionEntity({ position: 100 });
|
|
338
342
|
const entity2 = database.transactions.createPositionEntity({ position: 200 });
|
|
339
343
|
const entity3 = database.transactions.createPositionEntity({ position: 300 });
|
|
@@ -348,7 +352,7 @@ describe("observeSelectEntities", () => {
|
|
|
348
352
|
expect(updatedCall.length).toBe(initialCount + 3);
|
|
349
353
|
unsubscribe();
|
|
350
354
|
});
|
|
351
|
-
it("should handle mixed synchronous and asynchronous
|
|
355
|
+
it("should handle mixed synchronous and asynchronous actions", async () => {
|
|
352
356
|
const observer = vi.fn();
|
|
353
357
|
const unsubscribe = database.observe.select(["position"])(observer);
|
|
354
358
|
// Initial notification
|