@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
|
@@ -0,0 +1,435 @@
|
|
|
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 { createPlugin } from "./create-plugin.js";
|
|
24
|
+
describe("Database.Plugin.create", () => {
|
|
25
|
+
describe("single descriptor (no dependencies)", () => {
|
|
26
|
+
it("should create plugin with components, resources, and archetypes", () => {
|
|
27
|
+
const plugin = createPlugin({
|
|
28
|
+
components: {
|
|
29
|
+
velocity: { type: "number" },
|
|
30
|
+
particle: { type: "boolean" },
|
|
31
|
+
},
|
|
32
|
+
resources: {
|
|
33
|
+
mousePosition: { default: 0 },
|
|
34
|
+
fooPosition: { default: 0 },
|
|
35
|
+
},
|
|
36
|
+
archetypes: {
|
|
37
|
+
Particle: ["particle"],
|
|
38
|
+
DynamicParticle: ["particle", "velocity"],
|
|
39
|
+
},
|
|
40
|
+
systems: {
|
|
41
|
+
updateSystem: {
|
|
42
|
+
create: (db) => () => {
|
|
43
|
+
db.store.archetypes.Particle.insert({ particle: true });
|
|
44
|
+
db.archetypes.Particle.id.toString();
|
|
45
|
+
// @ts-expect-error - foo does not exist
|
|
46
|
+
db.archetypes.foo;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
it("should infer db type correctly with single descriptor", () => {
|
|
53
|
+
const plugin = createPlugin({
|
|
54
|
+
resources: {
|
|
55
|
+
time: { default: 0 },
|
|
56
|
+
},
|
|
57
|
+
systems: {
|
|
58
|
+
physicsSystem: {
|
|
59
|
+
create: (db) => () => {
|
|
60
|
+
const time = db.resources.time;
|
|
61
|
+
// @ts-expect-error - this should be an error
|
|
62
|
+
const dt = db.resources.deltaTime2;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
expect(plugin).toBeDefined();
|
|
68
|
+
expect(plugin.systems).toBeDefined();
|
|
69
|
+
});
|
|
70
|
+
it("should constrain archetype references at input", () => {
|
|
71
|
+
createPlugin({
|
|
72
|
+
components: {
|
|
73
|
+
particle: { type: "boolean" },
|
|
74
|
+
},
|
|
75
|
+
archetypes: {
|
|
76
|
+
Particle: ["particle"],
|
|
77
|
+
// @ts-expect-error - DoesNotExist component does not exist
|
|
78
|
+
DoesNotExist: ["particle234"],
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
it("should constrain archetype access in systems", () => {
|
|
83
|
+
createPlugin({
|
|
84
|
+
components: {
|
|
85
|
+
particle: { type: "boolean" },
|
|
86
|
+
},
|
|
87
|
+
archetypes: {
|
|
88
|
+
Particle: ["particle"],
|
|
89
|
+
},
|
|
90
|
+
systems: {
|
|
91
|
+
testSystem: {
|
|
92
|
+
create: (db) => () => {
|
|
93
|
+
db.archetypes.Particle; // ✅ OK
|
|
94
|
+
// @ts-expect-error - foo does not exist
|
|
95
|
+
db.archetypes.foo;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
it("should constrain schedule references to dependency system names", () => {
|
|
102
|
+
const plugin = createPlugin({
|
|
103
|
+
systems: {
|
|
104
|
+
renderSystem: {
|
|
105
|
+
create: (_db) => () => { },
|
|
106
|
+
schedule: {
|
|
107
|
+
after: ["update"],
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}, [
|
|
112
|
+
createPlugin({
|
|
113
|
+
systems: {
|
|
114
|
+
update: {
|
|
115
|
+
create: (_db) => () => { }
|
|
116
|
+
},
|
|
117
|
+
render: {
|
|
118
|
+
create: (_db) => () => { }
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
})
|
|
122
|
+
]);
|
|
123
|
+
expect(plugin).toBeDefined();
|
|
124
|
+
expect(plugin.systems).toBeDefined();
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
describe("with dependencies", () => {
|
|
128
|
+
it("should merge components from dependencies", () => {
|
|
129
|
+
const basePlugin = createPlugin({
|
|
130
|
+
components: {
|
|
131
|
+
position: { type: "number" },
|
|
132
|
+
health: { type: "number" }
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
const extendedPlugin = createPlugin({
|
|
136
|
+
components: {
|
|
137
|
+
velocity: { type: "number" }
|
|
138
|
+
}
|
|
139
|
+
}, [basePlugin]);
|
|
140
|
+
expect("position" in extendedPlugin.components).toBe(true);
|
|
141
|
+
expect("health" in extendedPlugin.components).toBe(true);
|
|
142
|
+
expect("velocity" in extendedPlugin.components).toBe(true);
|
|
143
|
+
});
|
|
144
|
+
it("should merge resources from dependencies", () => {
|
|
145
|
+
const basePlugin = createPlugin({
|
|
146
|
+
resources: {
|
|
147
|
+
time: { default: 0 },
|
|
148
|
+
config: { default: "default" }
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
const extendedPlugin = createPlugin({
|
|
152
|
+
resources: {
|
|
153
|
+
delta: { default: 0 }
|
|
154
|
+
}
|
|
155
|
+
}, [basePlugin]);
|
|
156
|
+
expect("time" in extendedPlugin.resources).toBe(true);
|
|
157
|
+
expect("config" in extendedPlugin.resources).toBe(true);
|
|
158
|
+
expect("delta" in extendedPlugin.resources).toBe(true);
|
|
159
|
+
});
|
|
160
|
+
it("should merge systems from dependencies", () => {
|
|
161
|
+
const basePlugin = createPlugin({
|
|
162
|
+
systems: {
|
|
163
|
+
inputSystem: {
|
|
164
|
+
create: (_db) => () => { }
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
const extendedPlugin = createPlugin({
|
|
169
|
+
systems: {
|
|
170
|
+
renderSystem: {
|
|
171
|
+
create: (_db) => () => { }
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}, [basePlugin]);
|
|
175
|
+
expect("inputSystem" in extendedPlugin.systems).toBe(true);
|
|
176
|
+
expect("renderSystem" in extendedPlugin.systems).toBe(true);
|
|
177
|
+
});
|
|
178
|
+
it("should allow systems to access dependency resources", () => {
|
|
179
|
+
const basePlugin = createPlugin({
|
|
180
|
+
resources: {
|
|
181
|
+
time: { default: 0 }
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
const extendedPlugin = createPlugin({
|
|
185
|
+
systems: {
|
|
186
|
+
mySystem: {
|
|
187
|
+
create: (db) => () => {
|
|
188
|
+
const time = db.resources.time; // Should work!
|
|
189
|
+
expect(typeof time).toBe("number");
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}, [basePlugin]);
|
|
194
|
+
expect(extendedPlugin).toBeDefined();
|
|
195
|
+
});
|
|
196
|
+
it("should allow multiple dependencies", () => {
|
|
197
|
+
const plugin1 = createPlugin({
|
|
198
|
+
components: { a: { type: "number" } }
|
|
199
|
+
});
|
|
200
|
+
const plugin2 = createPlugin({
|
|
201
|
+
components: { b: { type: "string" } }
|
|
202
|
+
});
|
|
203
|
+
const plugin3 = createPlugin({
|
|
204
|
+
components: { c: { type: "boolean" } }
|
|
205
|
+
});
|
|
206
|
+
const merged = createPlugin({
|
|
207
|
+
components: { d: { type: "number" } }
|
|
208
|
+
}, [plugin1, plugin2, plugin3]);
|
|
209
|
+
expect("a" in merged.components).toBe(true);
|
|
210
|
+
expect("b" in merged.components).toBe(true);
|
|
211
|
+
expect("c" in merged.components).toBe(true);
|
|
212
|
+
expect("d" in merged.components).toBe(true);
|
|
213
|
+
});
|
|
214
|
+
});
|
|
215
|
+
describe("schedule validation", () => {
|
|
216
|
+
it("should allow valid system references in schedule", () => {
|
|
217
|
+
expect(() => {
|
|
218
|
+
createPlugin({
|
|
219
|
+
systems: {
|
|
220
|
+
system1: {
|
|
221
|
+
create: (_db) => () => { }
|
|
222
|
+
},
|
|
223
|
+
system2: {
|
|
224
|
+
create: (_db) => () => { },
|
|
225
|
+
schedule: {
|
|
226
|
+
// @ts-expect-error - system1 does not exist
|
|
227
|
+
after: ["system1"]
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
}).not.toThrow();
|
|
233
|
+
});
|
|
234
|
+
it("should allow referencing dependency systems in schedule", () => {
|
|
235
|
+
const basePlugin = createPlugin({
|
|
236
|
+
systems: {
|
|
237
|
+
inputSystem: {
|
|
238
|
+
create: (_db) => () => { }
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
expect(() => {
|
|
243
|
+
createPlugin({
|
|
244
|
+
systems: {
|
|
245
|
+
renderSystem: {
|
|
246
|
+
create: (_db) => () => { },
|
|
247
|
+
schedule: {
|
|
248
|
+
after: ["inputSystem"] // Reference from dependency!
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}, [basePlugin]);
|
|
253
|
+
}).not.toThrow();
|
|
254
|
+
});
|
|
255
|
+
it("should validate across multiple dependencies", () => {
|
|
256
|
+
const plugin1 = createPlugin({
|
|
257
|
+
systems: {
|
|
258
|
+
system1: {
|
|
259
|
+
create: (_db) => () => { }
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
const plugin2 = createPlugin({
|
|
264
|
+
systems: {
|
|
265
|
+
system2: {
|
|
266
|
+
create: (_db) => () => { }
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
expect(() => {
|
|
271
|
+
createPlugin({
|
|
272
|
+
systems: {
|
|
273
|
+
system3: {
|
|
274
|
+
create: (_db) => () => { },
|
|
275
|
+
schedule: {
|
|
276
|
+
after: ["system1", "system2"] // Both from dependencies
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}, [plugin1, plugin2]);
|
|
281
|
+
}).not.toThrow();
|
|
282
|
+
});
|
|
283
|
+
it("should constrain schedule references to dependency system names", () => {
|
|
284
|
+
const basePlugin = createPlugin({
|
|
285
|
+
systems: {
|
|
286
|
+
inputSystem: {
|
|
287
|
+
create: (_db) => () => { }
|
|
288
|
+
},
|
|
289
|
+
physicsSystem: {
|
|
290
|
+
create: (_db) => () => { }
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
// ✅ VALID: referencing actual systems from dependencies (no 'as const' needed!)
|
|
295
|
+
const validPlugin = createPlugin({
|
|
296
|
+
systems: {
|
|
297
|
+
renderSystem: {
|
|
298
|
+
create: (_db) => () => { },
|
|
299
|
+
schedule: {
|
|
300
|
+
// TypeScript autocompletes: "inputSystem" | "physicsSystem"
|
|
301
|
+
after: ["inputSystem", "physicsSystem"]
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}, [basePlugin]);
|
|
306
|
+
expect(validPlugin).toBeDefined();
|
|
307
|
+
expect(validPlugin.systems).toHaveProperty("renderSystem");
|
|
308
|
+
});
|
|
309
|
+
});
|
|
310
|
+
describe("type inference edge cases", () => {
|
|
311
|
+
it("should block arbitrary property access on resources", () => {
|
|
312
|
+
const plugin = createPlugin({
|
|
313
|
+
resources: {
|
|
314
|
+
time: { default: 0 }
|
|
315
|
+
},
|
|
316
|
+
systems: {
|
|
317
|
+
testSystem: {
|
|
318
|
+
create: (db) => () => {
|
|
319
|
+
const time = db.resources.time; // OK
|
|
320
|
+
// @ts-expect-error - should error
|
|
321
|
+
const invalid = db.resources.nonExistent;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
});
|
|
326
|
+
expect(plugin).toBeDefined();
|
|
327
|
+
});
|
|
328
|
+
it("should block arbitrary property access with dependencies", () => {
|
|
329
|
+
const basePlugin = createPlugin({
|
|
330
|
+
resources: {
|
|
331
|
+
time: { default: 0 }
|
|
332
|
+
}
|
|
333
|
+
});
|
|
334
|
+
const extendedPlugin = createPlugin({
|
|
335
|
+
resources: {
|
|
336
|
+
delta: { default: 0 }
|
|
337
|
+
},
|
|
338
|
+
systems: {
|
|
339
|
+
testSystem: {
|
|
340
|
+
create: (db) => () => {
|
|
341
|
+
const time = db.resources.time; // OK - from dependency
|
|
342
|
+
const delta = db.resources.delta; // OK - from descriptor
|
|
343
|
+
// @ts-expect-error - should error
|
|
344
|
+
const invalid = db.resources.nonExistent;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}, [basePlugin]);
|
|
349
|
+
expect(extendedPlugin).toBeDefined();
|
|
350
|
+
});
|
|
351
|
+
});
|
|
352
|
+
describe("identity validation", () => {
|
|
353
|
+
it("should throw error when merging different component definitions", () => {
|
|
354
|
+
const plugin1 = createPlugin({
|
|
355
|
+
components: {
|
|
356
|
+
health: { type: "number" }
|
|
357
|
+
}
|
|
358
|
+
});
|
|
359
|
+
expect(() => {
|
|
360
|
+
createPlugin({
|
|
361
|
+
components: {
|
|
362
|
+
health: { type: "string" } // Different definition
|
|
363
|
+
}
|
|
364
|
+
}, [plugin1]);
|
|
365
|
+
}).toThrow('Plugin merge conflict: components.health must be identical (===) across plugins');
|
|
366
|
+
});
|
|
367
|
+
it("should throw error when merging different resource definitions", () => {
|
|
368
|
+
const plugin1 = createPlugin({
|
|
369
|
+
resources: {
|
|
370
|
+
score: { default: 0 }
|
|
371
|
+
}
|
|
372
|
+
});
|
|
373
|
+
expect(() => {
|
|
374
|
+
createPlugin({
|
|
375
|
+
resources: {
|
|
376
|
+
score: { default: 100 } // Different definition
|
|
377
|
+
}
|
|
378
|
+
}, [plugin1]);
|
|
379
|
+
}).toThrow('Plugin merge conflict: resources.score must be identical (===) across plugins');
|
|
380
|
+
});
|
|
381
|
+
it("should throw error when merging different archetype definitions", () => {
|
|
382
|
+
const plugin1 = createPlugin({
|
|
383
|
+
components: {
|
|
384
|
+
position: { type: "number" },
|
|
385
|
+
velocity: { type: "number" }
|
|
386
|
+
},
|
|
387
|
+
archetypes: {
|
|
388
|
+
Entity: ["position"]
|
|
389
|
+
}
|
|
390
|
+
});
|
|
391
|
+
expect(() => {
|
|
392
|
+
createPlugin({
|
|
393
|
+
archetypes: {
|
|
394
|
+
Entity: ["position", "velocity"] // Different definition
|
|
395
|
+
}
|
|
396
|
+
}, [plugin1]);
|
|
397
|
+
}).toThrow('Plugin merge conflict: archetypes.Entity must be identical (===) across plugins');
|
|
398
|
+
});
|
|
399
|
+
it("should allow same component with identical reference", () => {
|
|
400
|
+
const sharedComponent = { type: "number" };
|
|
401
|
+
const plugin1 = createPlugin({
|
|
402
|
+
components: {
|
|
403
|
+
health: sharedComponent
|
|
404
|
+
}
|
|
405
|
+
});
|
|
406
|
+
expect(() => {
|
|
407
|
+
createPlugin({
|
|
408
|
+
components: {
|
|
409
|
+
health: sharedComponent // Same reference - OK
|
|
410
|
+
}
|
|
411
|
+
}, [plugin1]);
|
|
412
|
+
}).not.toThrow();
|
|
413
|
+
});
|
|
414
|
+
it("should allow overwriting systems", () => {
|
|
415
|
+
const plugin1 = createPlugin({
|
|
416
|
+
systems: {
|
|
417
|
+
update: {
|
|
418
|
+
create: () => () => { }
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
});
|
|
422
|
+
// Should not throw - systems can be overwritten
|
|
423
|
+
expect(() => {
|
|
424
|
+
createPlugin({
|
|
425
|
+
systems: {
|
|
426
|
+
update: {
|
|
427
|
+
create: () => () => { } // Different function - OK
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
}, [plugin1]);
|
|
431
|
+
}).not.toThrow();
|
|
432
|
+
});
|
|
433
|
+
});
|
|
434
|
+
});
|
|
435
|
+
//# sourceMappingURL=create-plugin.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-plugin.test.js","sourceRoot":"","sources":["../../../src/ecs/database/create-plugin.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAEX,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACpC,QAAQ,CAAC,qCAAqC,EAAE,GAAG,EAAE;QACjD,EAAE,CAAC,iEAAiE,EAAE,GAAG,EAAE;YACvE,MAAM,MAAM,GAAG,YAAY,CAAC;gBACxB,UAAU,EAAE;oBACR,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBAC5B,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;iBAChC;gBACD,SAAS,EAAE;oBACP,aAAa,EAAE,EAAE,OAAO,EAAE,CAAW,EAAE;oBACvC,WAAW,EAAE,EAAE,OAAO,EAAE,CAAW,EAAE;iBACxC;gBACD,UAAU,EAAE;oBACR,QAAQ,EAAE,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B,OAAO,EAAE;oBACL,MAAM,EAAE;wBACJ,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;qBAC1B;iBACJ;aACJ,CAAC,CAAC;YAEH,gDAAgD;YAChD,MAAM,CAAC,GAAG,EAAE;gBACR,YAAY,CAAC;oBACT,OAAO,EAAE;wBACL,MAAM,EAAE;4BACJ,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,0BAA0B;yBACrD;qBACJ;iBACJ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;YAClB,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;QACrB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -3,12 +3,12 @@ import { StringKeyof } from "../../../types/types.js";
|
|
|
3
3
|
import { ComponentSchemas } from "../../component-schemas.js";
|
|
4
4
|
import { ResourceSchemas } from "../../resource-schemas.js";
|
|
5
5
|
import { ArchetypeComponents } from "../../store/archetype-components.js";
|
|
6
|
-
import {
|
|
6
|
+
import type { ActionDeclarations } from "../../store/action-functions.js";
|
|
7
7
|
import { DatabaseFromSchema, DatabaseSchema } from "./database-schema.js";
|
|
8
|
-
export declare function createDatabaseSchema<const CS extends ComponentSchemas, const RS extends ResourceSchemas, const A extends ArchetypeComponents<StringKeyof<CS>>, const TD extends
|
|
8
|
+
export declare function createDatabaseSchema<const CS extends ComponentSchemas, const RS extends ResourceSchemas, const A extends ArchetypeComponents<StringKeyof<CS>>, const TD extends ActionDeclarations<FromSchemas<CS>, FromSchemas<RS>, A>>(components: CS, resources: RS, archetypes: A, transactions: TD): {
|
|
9
9
|
readonly components: CS;
|
|
10
10
|
readonly resources: RS;
|
|
11
11
|
readonly archetypes: A;
|
|
12
12
|
readonly transactions: TD;
|
|
13
13
|
};
|
|
14
|
-
export declare function createDatabaseFromSchema<const CS extends ComponentSchemas, const RS extends ResourceSchemas, const A extends ArchetypeComponents<StringKeyof<CS>>, const TD extends
|
|
14
|
+
export declare function createDatabaseFromSchema<const CS extends ComponentSchemas, const RS extends ResourceSchemas, const A extends ArchetypeComponents<StringKeyof<CS>>, const TD extends ActionDeclarations<FromSchemas<CS>, FromSchemas<RS>, A>>(schema: DatabaseSchema<CS, RS, A, TD>): DatabaseFromSchema<typeof schema>;
|
|
@@ -19,12 +19,16 @@ 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
|
-
import {
|
|
23
|
-
import {
|
|
22
|
+
import { Store } from "../../index.js";
|
|
23
|
+
import { Database } from "../database.js";
|
|
24
24
|
export function createDatabaseSchema(components, resources, archetypes, transactions) {
|
|
25
25
|
return { components, resources, archetypes, transactions };
|
|
26
26
|
}
|
|
27
27
|
export function createDatabaseFromSchema(schema) {
|
|
28
|
-
return
|
|
28
|
+
return Database.create(Store.create({
|
|
29
|
+
components: schema.components,
|
|
30
|
+
resources: schema.resources,
|
|
31
|
+
archetypes: schema.archetypes,
|
|
32
|
+
}), schema.transactions);
|
|
29
33
|
}
|
|
30
34
|
//# sourceMappingURL=create-database-schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-database-schema.js","sourceRoot":"","sources":["../../../../src/ecs/database/database-schema/create-database-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAKX,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"create-database-schema.js","sourceRoot":"","sources":["../../../../src/ecs/database/database-schema/create-database-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAKX,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAGvC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAI1C,MAAM,UAAU,oBAAoB,CAMhC,UAAc,EACd,SAAa,EACb,UAAa,EACb,YAAgB;IAEhB,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAmD,CAAC;AAChH,CAAC;AAED,MAAM,UAAU,wBAAwB,CAMpC,MAAqC;IAErC,OAAO,QAAQ,CAAC,MAAM,CAClB,KAAK,CAAC,MAAM,CAAY;QACpB,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,UAAU,EAAE,MAAM,CAAC,UAAU;KAChC,CAAC,EACF,MAAM,CAAC,YAAmB,CACtB,CAAC;AACb,CAAC"}
|
|
@@ -2,12 +2,13 @@ import { FromSchemas } from "../../../schema/from-schemas.js";
|
|
|
2
2
|
import { ComponentSchemas } from "../../component-schemas.js";
|
|
3
3
|
import { ResourceSchemas } from "../../resource-schemas.js";
|
|
4
4
|
import { StringKeyof } from "../../../types/types.js";
|
|
5
|
-
import { Database
|
|
5
|
+
import { Database } from "../database.js";
|
|
6
|
+
import type { ToActionFunctions, ActionDeclarations } from "../../store/action-functions.js";
|
|
6
7
|
import { ArchetypeComponents } from "../../store/archetype-components.js";
|
|
7
|
-
export type DatabaseSchema<CS extends ComponentSchemas, RS extends ResourceSchemas, A extends ArchetypeComponents<StringKeyof<CS>>, TD extends
|
|
8
|
+
export type DatabaseSchema<CS extends ComponentSchemas, RS extends ResourceSchemas, A extends ArchetypeComponents<StringKeyof<CS>>, TD extends ActionDeclarations<FromSchemas<CS>, FromSchemas<RS>, A>> = {
|
|
8
9
|
readonly components: CS;
|
|
9
10
|
readonly resources: RS;
|
|
10
11
|
readonly archetypes: A;
|
|
11
12
|
readonly transactions: TD;
|
|
12
13
|
};
|
|
13
|
-
export type DatabaseFromSchema<T> = T extends DatabaseSchema<infer CS, infer RS, infer A, infer TD> ? Database<FromSchemas<CS>, FromSchemas<RS>, A,
|
|
14
|
+
export type DatabaseFromSchema<T> = T extends DatabaseSchema<infer CS, infer RS, infer A, infer TD> ? Database<FromSchemas<CS>, FromSchemas<RS>, A, ToActionFunctions<TD>> : never;
|
|
@@ -5,29 +5,32 @@ import { Entity } from "../entity.js";
|
|
|
5
5
|
import { EntityReadValues } from "../store/core/index.js";
|
|
6
6
|
import { Observe } from "../../observe/index.js";
|
|
7
7
|
import { TransactionResult } from "./transactional-store/index.js";
|
|
8
|
-
import { StringKeyof } from "../../types/types.js";
|
|
8
|
+
import { IntersectTuple, NoInfer, StringKeyof } from "../../types/types.js";
|
|
9
9
|
import { Components } from "../store/components.js";
|
|
10
10
|
import { ArchetypeComponents } from "../store/archetype-components.js";
|
|
11
11
|
import { RequiredComponents } from "../required-components.js";
|
|
12
12
|
import { EntitySelectOptions } from "../store/entity-select-options.js";
|
|
13
13
|
import { Service } from "../../service/service.js";
|
|
14
14
|
import { OptionalComponents } from "../optional-components.js";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
readonly
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
15
|
+
import { createDatabase } from "./public/create-database.js";
|
|
16
|
+
import { ResourceSchemas } from "../resource-schemas.js";
|
|
17
|
+
import { ComponentSchemas } from "../component-schemas.js";
|
|
18
|
+
import { FromSchemas } from "../../schema/index.js";
|
|
19
|
+
import type { ActionDeclarations, ActionFunctions, ToActionFunctions } from "../store/action-functions.js";
|
|
20
|
+
import { createPlugin } from "./create-plugin.js";
|
|
21
|
+
type SystemFunction = () => void | Promise<void>;
|
|
22
|
+
export interface Database<C extends Components, R extends ResourceComponents, A extends ArchetypeComponents<StringKeyof<C & OptionalComponents>>, F extends ActionFunctions, S extends string = never> extends ReadonlyStore<C, R, A>, Service {
|
|
23
|
+
readonly transactions: F & Service;
|
|
24
|
+
/**
|
|
25
|
+
* Provides direct mutable access to the underlying store.
|
|
26
|
+
*/
|
|
27
|
+
readonly store: Store<C, R, A> & {
|
|
28
|
+
/**
|
|
29
|
+
* Provides fast access to the action functions without a transaction wrapper.
|
|
30
|
+
* This means any calls to them will NOT be observable or undoable.
|
|
31
|
+
*/
|
|
32
|
+
readonly actions: F;
|
|
33
|
+
};
|
|
31
34
|
readonly observe: {
|
|
32
35
|
readonly components: {
|
|
33
36
|
readonly [K in StringKeyof<C>]: Observe<void>;
|
|
@@ -43,7 +46,46 @@ export interface Database<C extends Components = never, R extends ResourceCompon
|
|
|
43
46
|
archetype(id: ArchetypeId): Observe<void>;
|
|
44
47
|
select<Include extends StringKeyof<C>, T extends Include>(include: readonly Include[] | ReadonlySet<string>, options?: EntitySelectOptions<C, Pick<C & RequiredComponents, T>>): Observe<readonly Entity[]>;
|
|
45
48
|
};
|
|
49
|
+
readonly system: {
|
|
50
|
+
readonly functions: {
|
|
51
|
+
readonly [K in S]: SystemFunction;
|
|
52
|
+
};
|
|
53
|
+
readonly order: S[][];
|
|
54
|
+
};
|
|
46
55
|
toData(): unknown;
|
|
47
56
|
fromData(data: unknown): void;
|
|
48
|
-
|
|
57
|
+
extend<P extends Database.Plugin<any, any, any, any, any>>(plugin: P): Database<C & (P extends Database.Plugin<infer XC, any, any, any, any> ? FromSchemas<XC> : never), R & (P extends Database.Plugin<any, infer XR, any, any, any> ? FromSchemas<XR> : never), A & (P extends Database.Plugin<any, any, infer XA, any, any> ? XA : never), F & (P extends Database.Plugin<any, any, any, infer XTD, any> ? ToActionFunctions<XTD> : never), S | (P extends Database.Plugin<any, any, any, any, infer XS> ? XS : never)>;
|
|
58
|
+
}
|
|
59
|
+
export declare namespace Database {
|
|
60
|
+
const create: typeof createDatabase;
|
|
61
|
+
type Plugin<CS extends ComponentSchemas = any, RS extends ResourceSchemas = any, A extends ArchetypeComponents<StringKeyof<CS & OptionalComponents>> = any, TD extends ActionDeclarations<FromSchemas<CS>, FromSchemas<RS>, any> = any, S extends string = any> = {
|
|
62
|
+
readonly components?: CS;
|
|
63
|
+
readonly resources?: RS;
|
|
64
|
+
readonly archetypes?: A;
|
|
65
|
+
readonly transactions?: TD;
|
|
66
|
+
readonly systems?: {
|
|
67
|
+
readonly [K in S]: {
|
|
68
|
+
readonly create: (db: Database<FromSchemas<CS>, FromSchemas<RS>, A, ToActionFunctions<TD>, S>) => SystemFunction;
|
|
69
|
+
readonly schedule?: {
|
|
70
|
+
readonly before?: readonly NoInfer<Exclude<S, K>>[];
|
|
71
|
+
readonly after?: readonly NoInfer<Exclude<S, K>>[];
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
namespace Plugin {
|
|
77
|
+
type Intersect<T extends readonly Plugin<any, any, any, any, any>[]> = Required<Database.Plugin<{} & IntersectTuple<{
|
|
78
|
+
[K in keyof T]: T[K] extends Plugin<infer C, any, any, any, any> ? (C extends undefined ? {} : C) : never;
|
|
79
|
+
}>, {} & IntersectTuple<{
|
|
80
|
+
[K in keyof T]: T[K] extends Plugin<any, infer R, any, any, any> ? (R extends undefined ? {} : R) : never;
|
|
81
|
+
}>, {} & IntersectTuple<{
|
|
82
|
+
[K in keyof T]: T[K] extends Plugin<any, any, infer A, any, any> ? (A extends undefined ? {} : A) : never;
|
|
83
|
+
}>, {} & IntersectTuple<{
|
|
84
|
+
[K in keyof T]: T[K] extends Plugin<any, any, any, infer TD, any> ? (TD extends undefined ? Record<never, never> : TD) : never;
|
|
85
|
+
}>, Extract<{
|
|
86
|
+
[K in keyof T]: T[K] extends Plugin<any, any, any, any, infer S> ? S : never;
|
|
87
|
+
}[number], string>>>;
|
|
88
|
+
const create: typeof createPlugin;
|
|
89
|
+
}
|
|
49
90
|
}
|
|
91
|
+
export {};
|