@adobe/data 0.7.3 → 0.8.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/blob-handle.d.ts +2 -2
- package/dist/blob/blob-meta.d.ts +2 -2
- package/dist/cache/blob-store.d.ts +2 -2
- package/dist/cache/data-cache.d.ts +1 -1
- package/dist/cache/functions/memoize.d.ts +1 -3
- package/dist/cache/functions/memoize.js +1 -3
- package/dist/cache/functions/memoize.js.map +1 -1
- package/dist/cache/managed-array.d.ts +2 -2
- package/dist/cache/managed-array.js.map +1 -1
- package/dist/cache/memory-allocator.d.ts +1 -1
- package/dist/cache/memory-allocator.js +2 -2
- package/dist/cache/memory-allocator.js.map +1 -1
- package/dist/ecs/archetype/create-archetype.d.ts +2 -2
- package/dist/ecs/archetype/create-archetype.js.map +1 -1
- package/dist/ecs/archetype/create-archetype.test.js +9 -9
- package/dist/ecs/archetype/create-archetype.test.js.map +1 -1
- package/dist/ecs/archetype/delete-row.test.js +4 -4
- package/dist/ecs/archetype/delete-row.test.js.map +1 -1
- package/dist/ecs/component-schemas.d.ts +1 -1
- package/dist/ecs/database/create-database.test.js +136 -6
- package/dist/ecs/database/create-database.test.js.map +1 -1
- package/dist/ecs/database/database-schema/create-database-schema.d.ts +1 -1
- package/dist/ecs/database/database-schema/database-schema.d.ts +1 -1
- package/dist/ecs/database/database.d.ts +2 -1
- package/dist/ecs/database/index.d.ts +1 -1
- package/dist/ecs/database/index.js +0 -1
- package/dist/ecs/database/index.js.map +1 -1
- package/dist/ecs/database/observe-dependent-value.js +3 -3
- package/dist/ecs/database/observe-dependent-value.js.map +1 -1
- package/dist/ecs/database/observe-select-entities.d.ts +2 -2
- package/dist/ecs/database/observe-select-entities.js +2 -2
- package/dist/ecs/database/observe-select-entities.js.map +1 -1
- package/dist/ecs/database/observe-select-entities.performance.test.js +6 -6
- package/dist/ecs/database/observe-select-entities.performance.test.js.map +1 -1
- package/dist/ecs/database/observe-select-entities.test.js +6 -6
- package/dist/ecs/database/observe-select-entities.test.js.map +1 -1
- package/dist/ecs/database/observed/create-observed-database.js +10 -2
- package/dist/ecs/database/observed/create-observed-database.js.map +1 -1
- package/dist/ecs/database/reconciling/create-reconciling-database.d.ts +8 -1
- package/dist/ecs/database/reconciling/create-reconciling-database.js +50 -19
- package/dist/ecs/database/reconciling/create-reconciling-database.js.map +1 -1
- package/dist/ecs/database/reconciling/create-reconciling-database.test.js +297 -0
- package/dist/ecs/database/reconciling/create-reconciling-database.test.js.map +1 -1
- package/dist/ecs/database/transactional-store/coalesce-transactions.d.ts +5 -1
- package/dist/ecs/database/transactional-store/coalesce-transactions.js +17 -28
- package/dist/ecs/database/transactional-store/coalesce-transactions.js.map +1 -1
- package/dist/ecs/database/transactional-store/coalesce-transactions.test.js +84 -7
- package/dist/ecs/database/transactional-store/coalesce-transactions.test.js.map +1 -1
- package/dist/ecs/database/transactional-store/create-transactional-store.js +7 -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 +11 -9
- package/dist/ecs/database/transactional-store/create-transactional-store.test.js.map +1 -1
- package/dist/ecs/entity-location-table/create-entity-location-table.js +13 -1
- package/dist/ecs/entity-location-table/create-entity-location-table.js.map +1 -1
- package/dist/ecs/entity-location-table/create-entity-location-table.test.js +1 -2
- package/dist/ecs/entity-location-table/create-entity-location-table.test.js.map +1 -1
- package/dist/ecs/entity-location-table/entity-location.d.ts +2 -2
- package/dist/ecs/entity-location-table/entity-location.js +3 -3
- package/dist/ecs/entity-location-table/entity-location.js.map +1 -1
- package/dist/ecs/entity.d.ts +2 -2
- package/dist/ecs/entity.js +2 -2
- package/dist/ecs/entity.js.map +1 -1
- package/dist/ecs/index.d.ts +5 -2
- package/dist/ecs/index.js +3 -2
- package/dist/ecs/index.js.map +1 -1
- package/dist/ecs/resource-schemas.d.ts +1 -1
- package/dist/ecs/store/core/core.d.ts +14 -13
- package/dist/ecs/store/core/create-core.d.ts +2 -2
- package/dist/ecs/store/core/create-core.js +19 -13
- package/dist/ecs/store/core/create-core.js.map +1 -1
- package/dist/ecs/store/core/create-core.test.js +54 -6
- package/dist/ecs/store/core/create-core.test.js.map +1 -1
- package/dist/ecs/store/core/select-entities.d.ts +2 -1
- package/dist/ecs/store/core/select-entities.js.map +1 -1
- package/dist/ecs/store/core/select-entities.test.js +3 -3
- package/dist/ecs/store/core/select-entities.test.js.map +1 -1
- package/dist/ecs/store/create-store.d.ts +2 -2
- package/dist/ecs/store/create-store.js.map +1 -1
- package/dist/ecs/store/create-store.test.js +8 -8
- package/dist/ecs/store/create-store.test.js.map +1 -1
- package/dist/ecs/store/index.d.ts +2 -0
- package/dist/ecs/store/store.d.ts +10 -9
- package/dist/ecs/store/store.js.map +1 -1
- package/dist/ecs/undo-redo-service/create-undo-redo-service.js +5 -7
- 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 +27 -27
- package/dist/ecs/undo-redo-service/create-undo-redo-service.test.js.map +1 -1
- package/dist/ecs/undo-redo-service/undo-redo-service.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/is-data.d.ts +3 -4
- package/dist/lit/hooks/use-drag-observe.d.ts +2 -1
- package/dist/lit/hooks/use-drag-observe.js +2 -2
- package/dist/lit/hooks/use-drag-observe.js.map +1 -1
- package/dist/lit/hooks/use-drag-transaction.js +3 -3
- package/dist/lit/hooks/use-drag-transaction.js.map +1 -1
- package/dist/lit/hooks/use-draggable.d.ts +1 -1
- package/dist/lit/hooks/use-draggable.js +1 -1
- package/dist/lit/hooks/use-draggable.js.map +1 -1
- package/dist/lit/hooks/use-observable-values.d.ts +1 -2
- package/dist/lit/hooks/use-observable-values.js +2 -2
- package/dist/lit/hooks/use-observable-values.js.map +1 -1
- package/dist/lit/index.d.ts +1 -0
- package/dist/math/aabb/center.d.ts +3 -0
- package/dist/math/aabb/center.js +6 -0
- package/dist/math/aabb/center.js.map +1 -0
- package/dist/math/aabb/face/aabb-face.test.d.ts +1 -0
- package/dist/math/aabb/face/aabb-face.test.js +55 -0
- package/dist/math/aabb/face/aabb-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/aabb/index.d.ts +4 -0
- package/dist/math/aabb/index.js +23 -0
- package/dist/math/aabb/index.js.map +1 -0
- package/dist/math/aabb/layout.d.ts +1 -0
- package/dist/math/aabb/layout.js +25 -0
- package/dist/math/aabb/layout.js.map +1 -0
- package/dist/math/aabb/line-intersection.d.ts +10 -0
- package/dist/math/aabb/line-intersection.js +42 -0
- package/dist/math/aabb/line-intersection.js.map +1 -0
- package/dist/math/aabb/line-intersection.test.js +1 -1
- package/dist/math/aabb/line-intersection.test.js.map +1 -1
- package/dist/math/aabb/public.d.ts +6 -0
- package/dist/math/aabb/public.js +28 -0
- package/dist/math/aabb/public.js.map +1 -0
- package/dist/math/aabb/schema.d.ts +33 -0
- package/dist/math/aabb/schema.js +36 -0
- package/dist/math/aabb/schema.js.map +1 -0
- package/dist/math/aabb/unit.d.ts +5 -0
- package/dist/math/aabb/unit.js +8 -0
- package/dist/math/aabb/unit.js.map +1 -0
- package/dist/math/f32/index.d.ts +4 -0
- package/dist/math/f32/index.js +23 -0
- package/dist/math/f32/index.js.map +1 -0
- package/dist/math/f32/public.d.ts +1 -0
- package/dist/math/f32/public.js +23 -0
- package/dist/math/f32/public.js.map +1 -0
- package/dist/math/f32/schema.d.ts +5 -0
- package/dist/math/f32/schema.js +27 -0
- package/dist/math/f32/schema.js.map +1 -0
- package/dist/math/f64/index.d.ts +4 -0
- package/dist/math/f64/index.js +2 -0
- package/dist/math/f64/index.js.map +1 -0
- package/dist/math/f64/public.d.ts +1 -0
- package/dist/math/f64/public.js +23 -0
- package/dist/math/f64/public.js.map +1 -0
- package/dist/math/f64/schema.d.ts +5 -0
- package/dist/math/f64/schema.js +6 -0
- package/dist/math/f64/schema.js.map +1 -0
- package/dist/math/i32/index.d.ts +4 -0
- package/dist/math/i32/index.js +23 -0
- package/dist/math/i32/index.js.map +1 -0
- package/dist/math/i32/public.d.ts +1 -0
- package/dist/math/i32/public.js +23 -0
- package/dist/math/i32/public.js.map +1 -0
- package/dist/math/i32/schema.d.ts +6 -0
- package/dist/math/i32/schema.js +28 -0
- package/dist/math/i32/schema.js.map +1 -0
- package/dist/math/index.d.ts +14 -13
- package/dist/math/index.js +14 -13
- package/dist/math/index.js.map +1 -1
- package/dist/math/line2/functions.d.ts +5 -0
- package/dist/math/line2/functions.js +61 -0
- package/dist/math/line2/functions.js.map +1 -0
- package/dist/math/line2/index.d.ts +4 -0
- package/dist/math/line2/index.js +23 -0
- package/dist/math/line2/index.js.map +1 -0
- package/dist/math/line2/layout.d.ts +1 -0
- package/dist/math/line2/layout.js +25 -0
- package/dist/math/line2/layout.js.map +1 -0
- package/dist/math/line2/public.d.ts +3 -0
- package/dist/math/line2/public.js +25 -0
- package/dist/math/line2/public.js.map +1 -0
- package/dist/math/line2/schema.d.ts +33 -0
- package/dist/math/line2/schema.js +37 -0
- package/dist/math/line2/schema.js.map +1 -0
- package/dist/math/line3/functions.d.ts +17 -0
- package/dist/math/line3/functions.js +70 -0
- package/dist/math/line3/functions.js.map +1 -0
- package/dist/math/line3/index.d.ts +4 -0
- package/dist/math/line3/index.js +23 -0
- package/dist/math/line3/index.js.map +1 -0
- package/dist/math/line3/layout.d.ts +1 -0
- package/dist/math/line3/layout.js +25 -0
- package/dist/math/line3/layout.js.map +1 -0
- package/dist/math/line3/public.d.ts +3 -0
- package/dist/math/line3/public.js +25 -0
- package/dist/math/line3/public.js.map +1 -0
- package/dist/math/line3/schema.d.ts +33 -0
- package/dist/math/line3/schema.js +37 -0
- package/dist/math/line3/schema.js.map +1 -0
- package/dist/math/mat4x4/functions.d.ts +23 -0
- package/dist/math/mat4x4/functions.js +236 -0
- package/dist/math/mat4x4/functions.js.map +1 -0
- package/dist/math/mat4x4/index.d.ts +26 -0
- package/dist/math/mat4x4/index.js +45 -0
- package/dist/math/mat4x4/index.js.map +1 -0
- package/dist/math/mat4x4/layout.d.ts +1 -0
- package/dist/math/mat4x4/layout.js +25 -0
- package/dist/math/mat4x4/layout.js.map +1 -0
- package/dist/math/mat4x4/public.d.ts +3 -0
- package/dist/math/mat4x4/public.js +25 -0
- package/dist/math/mat4x4/public.js.map +1 -0
- package/dist/math/mat4x4/schema.d.ts +11 -0
- package/dist/math/mat4x4/schema.js +30 -0
- package/dist/math/mat4x4/schema.js.map +1 -0
- package/dist/math/plane/functions.d.ts +16 -0
- package/dist/math/plane/functions.js +55 -0
- package/dist/math/plane/functions.js.map +1 -0
- package/dist/math/plane/index.d.ts +4 -0
- package/dist/math/plane/index.js +23 -0
- package/dist/math/plane/index.js.map +1 -0
- package/dist/math/plane/layout.d.ts +1 -0
- package/dist/math/plane/layout.js +25 -0
- package/dist/math/plane/layout.js.map +1 -0
- package/dist/math/plane/public.d.ts +3 -0
- package/dist/math/plane/public.js +25 -0
- package/dist/math/plane/public.js.map +1 -0
- package/dist/math/plane/schema.d.ts +24 -0
- package/dist/math/plane/schema.js +34 -0
- package/dist/math/plane/schema.js.map +1 -0
- package/dist/math/quat/constants/functions.d.ts +43 -0
- package/dist/math/quat/constants/functions.js +258 -0
- package/dist/math/quat/constants/functions.js.map +1 -0
- package/dist/math/quat/functions.d.ts +43 -0
- package/dist/math/quat/functions.js +258 -0
- package/dist/math/quat/functions.js.map +1 -0
- package/dist/math/quat/index.d.ts +4 -0
- package/dist/math/quat/index.js +23 -0
- package/dist/math/quat/index.js.map +1 -0
- package/dist/math/quat/layout.d.ts +1 -0
- package/dist/math/quat/layout.js +25 -0
- package/dist/math/quat/layout.js.map +1 -0
- package/dist/math/quat/public.d.ts +3 -0
- package/dist/math/quat/public.js +25 -0
- package/dist/math/quat/public.js.map +1 -0
- package/dist/math/quat/schema.d.ts +11 -0
- package/dist/math/quat/schema.js +30 -0
- package/dist/math/quat/schema.js.map +1 -0
- package/dist/math/u32/index.d.ts +4 -0
- package/dist/math/u32/index.js +23 -0
- package/dist/math/u32/index.js.map +1 -0
- package/dist/math/u32/public.d.ts +1 -0
- package/dist/math/u32/public.js +23 -0
- package/dist/math/u32/public.js.map +1 -0
- package/dist/math/u32/schema.d.ts +6 -0
- package/dist/math/u32/schema.js +28 -0
- package/dist/math/u32/schema.js.map +1 -0
- package/dist/math/vec2/functions.d.ts +48 -0
- package/dist/math/vec2/functions.js +104 -0
- package/dist/math/vec2/functions.js.map +1 -0
- package/dist/math/vec2/index.d.ts +4 -0
- package/dist/math/vec2/index.js +23 -0
- package/dist/math/vec2/index.js.map +1 -0
- package/dist/math/vec2/layout.d.ts +1 -0
- package/dist/math/vec2/layout.js +25 -0
- package/dist/math/vec2/layout.js.map +1 -0
- package/dist/math/vec2/public.d.ts +3 -0
- package/dist/math/vec2/public.js +25 -0
- package/dist/math/vec2/public.js.map +1 -0
- package/dist/math/vec2/schema.d.ts +11 -0
- package/dist/math/vec2/schema.js +30 -0
- package/dist/math/vec2/schema.js.map +1 -0
- package/dist/math/vec3/functions.d.ts +59 -0
- package/dist/math/vec3/functions.js +159 -0
- package/dist/math/vec3/functions.js.map +1 -0
- package/dist/math/vec3/index.d.ts +4 -0
- package/dist/math/vec3/index.js +23 -0
- package/dist/math/vec3/index.js.map +1 -0
- package/dist/math/vec3/layout.d.ts +1 -0
- package/dist/math/vec3/layout.js +25 -0
- package/dist/math/vec3/layout.js.map +1 -0
- package/dist/math/vec3/public.d.ts +3 -0
- package/dist/math/vec3/public.js +25 -0
- package/dist/math/vec3/public.js.map +1 -0
- package/dist/math/vec3/schema.d.ts +11 -0
- package/dist/math/vec3/schema.js +30 -0
- package/dist/math/vec3/schema.js.map +1 -0
- package/dist/math/vec4/functions.d.ts +49 -0
- package/dist/math/vec4/functions.js +150 -0
- package/dist/math/vec4/functions.js.map +1 -0
- package/dist/math/vec4/index.d.ts +4 -0
- package/dist/math/vec4/index.js +23 -0
- package/dist/math/vec4/index.js.map +1 -0
- package/dist/math/vec4/layout.d.ts +1 -0
- package/dist/math/vec4/layout.js +25 -0
- package/dist/math/vec4/layout.js.map +1 -0
- package/dist/math/vec4/public.d.ts +3 -0
- package/dist/math/vec4/public.js +25 -0
- package/dist/math/vec4/public.js.map +1 -0
- package/dist/math/vec4/schema.d.ts +11 -0
- package/dist/math/vec4/schema.js +30 -0
- package/dist/math/vec4/schema.js.map +1 -0
- package/dist/mutable.d.ts +3 -4
- package/dist/observe/create-event.d.ts +10 -0
- package/dist/observe/create-event.js +22 -0
- package/dist/observe/create-event.js.map +1 -0
- package/dist/observe/create-persisted-state.d.ts +1 -1
- package/dist/observe/create-persisted-state.js +2 -2
- package/dist/observe/create-persisted-state.js.map +1 -1
- package/dist/observe/create-query-state.d.ts +2 -3
- package/dist/observe/create-query-state.js +2 -2
- package/dist/observe/create-query-state.js.map +1 -1
- package/dist/observe/create-state.d.ts +7 -0
- package/dist/observe/create-state.js +27 -0
- package/dist/observe/create-state.js.map +1 -0
- package/dist/observe/from-array.d.ts +1 -1
- package/dist/observe/from-constant.d.ts +1 -1
- package/dist/observe/from-element-id.d.ts +1 -1
- package/dist/observe/from-element-properties-and-events.d.ts +1 -1
- package/dist/observe/from-element-property.d.ts +1 -1
- package/dist/observe/from-promise-with-error.d.ts +1 -1
- package/dist/observe/from-promise.d.ts +1 -1
- package/dist/observe/from-properties.d.ts +1 -1
- package/dist/observe/index.d.ts +16 -30
- package/dist/observe/index.js +1 -32
- package/dist/observe/index.js.map +1 -1
- package/dist/observe/observe.test.js +4 -4
- package/dist/observe/observe.test.js.map +1 -1
- package/dist/observe/public.d.ts +28 -0
- package/dist/observe/public.js +50 -0
- package/dist/observe/public.js.map +1 -0
- package/dist/observe/to-async-generator.d.ts +1 -1
- package/dist/observe/to-promise.d.ts +2 -2
- package/dist/observe/to-promise.js +1 -1
- package/dist/observe/to-properties.d.ts +1 -1
- package/dist/observe/with-async-map.d.ts +1 -1
- package/dist/observe/with-batch.d.ts +1 -1
- package/dist/observe/with-batch.test.js +5 -5
- package/dist/observe/with-batch.test.js.map +1 -1
- package/dist/observe/with-cache.d.ts +1 -1
- package/dist/observe/with-copy.d.ts +1 -1
- package/dist/observe/with-deduplicate-data.d.ts +1 -1
- package/dist/observe/with-deduplicate.d.ts +1 -1
- package/dist/observe/with-default.d.ts +1 -1
- package/dist/observe/with-filter.d.ts +1 -1
- package/dist/observe/with-lazy.d.ts +1 -1
- package/dist/observe/with-lazy.test.js +3 -3
- package/dist/observe/with-lazy.test.js.map +1 -1
- package/dist/observe/with-map-data.d.ts +1 -1
- package/dist/observe/with-map.d.ts +1 -1
- package/dist/observe/with-optional.d.ts +1 -1
- package/dist/observe/with-unwrap.d.ts +1 -1
- package/dist/old-ecs/action-ecs/action-ecs.js +2 -2
- package/dist/old-ecs/action-ecs/action-ecs.js.map +1 -1
- package/dist/old-ecs/action-ecs/action-ecs.test.js +3 -3
- package/dist/old-ecs/action-ecs/action-ecs.test.js.map +1 -1
- package/dist/old-ecs/action-ecs/action-types.d.ts +4 -4
- package/dist/old-ecs/core-ecs/core-ecs-serialization.test.js +3 -3
- package/dist/old-ecs/core-ecs/core-ecs-serialization.test.js.map +1 -1
- package/dist/old-ecs/core-ecs/core-ecs-types.d.ts +3 -3
- package/dist/old-ecs/core-ecs/core-ecs.js +2 -2
- package/dist/old-ecs/core-ecs/core-ecs.js.map +1 -1
- package/dist/old-ecs/core-ecs/core-ecs.test.js +2 -2
- package/dist/old-ecs/core-ecs/core-ecs.test.js.map +1 -1
- package/dist/old-ecs/ecs/ecs-types.d.ts +3 -3
- package/dist/old-ecs/ecs/ecs.test.js +3 -3
- package/dist/old-ecs/ecs/ecs.test.js.map +1 -1
- package/dist/old-ecs/entity.d.ts +2 -2
- package/dist/old-ecs/entity.js +2 -2
- package/dist/old-ecs/entity.js.map +1 -1
- package/dist/old-ecs/transaction-ecs/transaction-types.d.ts +4 -4
- package/dist/perftest/ecs-perf.js +11 -11
- package/dist/perftest/ecs-perf.js.map +1 -1
- package/dist/samples/todo/elements/todo-toolbar/todo-toolbar.js +3 -3
- package/dist/samples/todo/elements/todo-toolbar/todo-toolbar.js.map +1 -1
- package/dist/samples/todo/services/dependent-state-service/create-dependent-state-service.d.ts +3 -3
- package/dist/samples/todo/services/dependent-state-service/dependent-state/all-todos.d.ts +1 -1
- package/dist/samples/todo/services/dependent-state-service/dependent-state/complete-todos.d.ts +1 -1
- package/dist/samples/todo/services/dependent-state-service/dependent-state/incomplete-todos.d.ts +1 -1
- package/dist/samples/todo/services/state-service/create-todo-database.d.ts +2 -2
- package/dist/samples/todo/services/state-service/create-todo-store.d.ts +2 -2
- package/dist/samples/todo/services/state-service/create-todo-store.js +5 -4
- package/dist/samples/todo/services/state-service/create-todo-store.js.map +1 -1
- package/dist/schema/FromSchemas.d.ts +4 -0
- package/dist/schema/FromSchemas.js +2 -0
- package/dist/schema/FromSchemas.js.map +1 -0
- package/dist/schema/boolean/index.d.ts +4 -0
- package/dist/schema/boolean/index.js +23 -0
- package/dist/schema/boolean/index.js.map +1 -0
- package/dist/schema/boolean/public.d.ts +1 -0
- package/dist/schema/boolean/public.js +23 -0
- package/dist/schema/boolean/public.js.map +1 -0
- package/dist/schema/boolean/schema.d.ts +3 -0
- package/dist/schema/boolean/schema.js +4 -0
- package/dist/schema/boolean/schema.js.map +1 -0
- package/dist/schema/from-schemas.d.ts +5 -0
- package/dist/schema/from-schemas.js +2 -0
- package/dist/schema/from-schemas.js.map +1 -0
- package/dist/schema/index.d.ts +9 -8
- package/dist/schema/index.js +6 -7
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/public.d.ts +4 -0
- package/dist/schema/public.js +26 -0
- package/dist/schema/public.js.map +1 -0
- package/dist/schema/schema copy.d.ts +147 -0
- package/dist/schema/schema copy.js +34 -0
- package/dist/schema/schema copy.js.map +1 -0
- package/dist/schema/schema.d.ts +2 -80
- package/dist/schema/schema.js +0 -10
- package/dist/schema/schema.js.map +1 -1
- package/dist/schema/time/index.d.ts +4 -0
- package/dist/schema/time/index.js +23 -0
- package/dist/schema/time/index.js.map +1 -0
- package/dist/schema/time/public.d.ts +1 -0
- package/dist/schema/time/public.js +23 -0
- package/dist/schema/time/public.js.map +1 -0
- package/dist/schema/time/schema.d.ts +5 -0
- package/dist/schema/time/schema.js +24 -0
- package/dist/schema/time/schema.js.map +1 -0
- package/dist/schema/to-type.d.ts +77 -0
- package/dist/schema/to-type.js +33 -0
- package/dist/schema/to-type.js.map +1 -0
- package/dist/schema/to-vertex-buffer-layout.d.ts +2 -2
- package/dist/schema/to-vertex-buffer-layout.js +28 -14
- package/dist/schema/to-vertex-buffer-layout.js.map +1 -1
- package/dist/schema/to-vertex-buffer-layout.test.js +18 -18
- package/dist/schema/to-vertex-buffer-layout.test.js.map +1 -1
- package/dist/schema/true/index.d.ts +4 -0
- package/dist/schema/true/index.js +23 -0
- package/dist/schema/true/index.js.map +1 -0
- package/dist/schema/true/public.d.ts +1 -0
- package/dist/schema/true/public.js +23 -0
- package/dist/schema/true/public.js.map +1 -0
- package/dist/schema/true/schema.d.ts +5 -0
- package/dist/schema/true/schema.js +2 -0
- package/dist/schema/true/schema.js.map +1 -0
- package/dist/schema/type.d.ts +76 -0
- package/dist/schema/type.js +33 -0
- package/dist/schema/type.js.map +1 -0
- package/dist/schema/validation/with-validation.d.ts +2 -2
- package/dist/schema/validation/with-validation.js.map +1 -1
- package/dist/schema/validation/with-validation.test.js.map +1 -1
- package/dist/service/add-observable-actions.d.ts +5 -5
- package/dist/service/add-observable-actions.js +2 -2
- package/dist/service/add-observable-actions.js.map +1 -1
- package/dist/service/index.d.ts +1 -1
- package/dist/service/index.js.map +1 -1
- package/dist/service/progressive-result.d.ts +2 -3
- package/dist/table/add-row.d.ts +2 -2
- package/dist/table/add-row.js +2 -2
- package/dist/table/create-table.d.ts +2 -2
- package/dist/table/create-table.js.map +1 -1
- package/dist/table/delete-row.d.ts +2 -2
- package/dist/table/delete-row.js +2 -2
- package/dist/table/row-index.d.ts +2 -2
- package/dist/table/row-index.js +2 -2
- package/dist/table/row-index.js.map +1 -1
- package/dist/table/table-compact.test.js +9 -9
- package/dist/table/table-compact.test.js.map +1 -1
- package/dist/table/update-row.d.ts +4 -3
- package/dist/table/update-row.js +4 -3
- package/dist/table/update-row.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/typed-buffer/create-array-buffer.d.ts +2 -2
- package/dist/typed-buffer/create-const-buffer.d.ts +1 -1
- package/dist/typed-buffer/create-number-buffer.d.ts +1 -1
- package/dist/typed-buffer/create-number-buffer.js +4 -4
- package/dist/typed-buffer/create-number-buffer.js.map +1 -1
- package/dist/typed-buffer/create-number-buffer.test.js +2 -2
- package/dist/typed-buffer/create-number-buffer.test.js.map +1 -1
- package/dist/typed-buffer/create-struct-buffer.d.ts +3 -3
- package/dist/typed-buffer/create-struct-buffer.js.map +1 -1
- package/dist/typed-buffer/create-struct-buffer.test.js +10 -10
- package/dist/typed-buffer/create-struct-buffer.test.js.map +1 -1
- package/dist/typed-buffer/create-typed-buffer.d.ts +3 -3
- package/dist/typed-buffer/create-typed-buffer.js.map +1 -1
- package/dist/typed-buffer/index.d.ts +1 -0
- package/dist/typed-buffer/structs/assert-struct.d.ts +1 -1
- package/dist/typed-buffer/structs/get-struct-layout.d.ts +1 -1
- package/dist/typed-buffer/structs/get-struct-layout.js +4 -4
- package/dist/typed-buffer/structs/get-struct-layout.js.map +1 -1
- package/dist/typed-buffer/structs/get-struct-layout.test.js +12 -12
- package/dist/typed-buffer/structs/get-struct-layout.test.js.map +1 -1
- package/dist/typed-buffer/structs/struct-layout.d.ts +1 -1
- package/dist/typed-buffer/typed-buffer.d.ts +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/types.d.ts +1 -2
- package/package.json +1 -1
package/dist/schema/schema.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
type JSONPath = string;
|
|
4
|
-
type JSONMergePatch = unknown;
|
|
1
|
+
export type JSONPath = string;
|
|
2
|
+
export type JSONMergePatch = unknown;
|
|
5
3
|
export type Layout = "std140" | "packed";
|
|
6
4
|
/**
|
|
7
5
|
* Conditional patch applied to the path when the enclosing schema branch is active
|
|
@@ -71,80 +69,4 @@ export interface Schema {
|
|
|
71
69
|
enum?: readonly any[];
|
|
72
70
|
layout?: Layout;
|
|
73
71
|
}
|
|
74
|
-
export type FromSchemas<T> = {
|
|
75
|
-
[K in Extract<keyof T, string>]: FromSchema<T[K]>;
|
|
76
|
-
};
|
|
77
|
-
export type FromSchema<T, Depth extends number = 5> = T extends {
|
|
78
|
-
mutable: true;
|
|
79
|
-
} ? FromSchemaInternal<T> : DeepReadonly<Depth extends 0 ? any : FromSchemaInternal<T, Depth>>;
|
|
80
|
-
type FromSchemaInternal<T, Depth extends number = 5> = T extends {
|
|
81
|
-
const: infer Const;
|
|
82
|
-
} ? Const : T extends {
|
|
83
|
-
enum: infer Enum;
|
|
84
|
-
} ? Enum extends ReadonlyArray<any> ? Enum[number] : never : T extends {
|
|
85
|
-
oneOf: infer Schemas;
|
|
86
|
-
} ? Schemas extends ReadonlyArray<Schema> ? FromOneOfSchema<Schemas, Decrement<Depth>> : never : T extends {
|
|
87
|
-
allOf: infer Schemas;
|
|
88
|
-
} ? Schemas extends ReadonlyArray<Schema> ? FromAllOfSchema<Schemas, Decrement<Depth>> : never : T extends {
|
|
89
|
-
type: 'number' | 'integer';
|
|
90
|
-
} ? number : T extends {
|
|
91
|
-
type: 'string';
|
|
92
|
-
} ? string : T extends {
|
|
93
|
-
type: 'boolean';
|
|
94
|
-
} ? boolean : T extends {
|
|
95
|
-
type: 'null';
|
|
96
|
-
} ? null : T extends {
|
|
97
|
-
type: 'typed-buffer';
|
|
98
|
-
items: infer Items;
|
|
99
|
-
} ? TypedBuffer<FromSchemaInternal<Items>> : T extends {
|
|
100
|
-
type: 'array';
|
|
101
|
-
} | {
|
|
102
|
-
items: any;
|
|
103
|
-
} ? FromSchemaArray<T, Decrement<Depth>> : T extends {
|
|
104
|
-
type?: undefined;
|
|
105
|
-
default: infer D;
|
|
106
|
-
} ? D : T extends {
|
|
107
|
-
type: 'object';
|
|
108
|
-
} | {
|
|
109
|
-
properties: any;
|
|
110
|
-
} ? FromSchemaObject<T, Decrement<Depth>> : any;
|
|
111
|
-
type Decrement<N extends number> = ((...x: any[]) => void) extends (arg: any, ...rest: infer R) => void ? R['length'] : never;
|
|
112
|
-
type FromSchemaArray<T, Depth extends number> = T extends {
|
|
113
|
-
items: infer Items;
|
|
114
|
-
} ? T extends {
|
|
115
|
-
minItems: infer Min;
|
|
116
|
-
maxItems: infer Max;
|
|
117
|
-
} ? Equal<Min, Max> extends true ? BuildTuple<FromSchema<Items, Depth>, Min> : FromSchema<Items, Depth>[] : FromSchema<Items, Depth>[] : any[];
|
|
118
|
-
type BuildTuple<T, N, R extends unknown[] = []> = R['length'] extends N ? R : BuildTuple<T, N, [...R, T]>;
|
|
119
|
-
type FromSchemaObject<T extends Schema, Depth extends number> = T extends {
|
|
120
|
-
properties: infer P;
|
|
121
|
-
} ? Simplify<{
|
|
122
|
-
[K in RequiredKeys<T>]: FromSchema<P[K], Depth>;
|
|
123
|
-
} & {
|
|
124
|
-
[K in OptionalKeys<T>]?: FromSchema<P[K], Depth>;
|
|
125
|
-
} & (T extends {
|
|
126
|
-
additionalProperties: infer AP;
|
|
127
|
-
} ? AP extends false ? {} : AP extends boolean ? AP extends true ? {
|
|
128
|
-
[key: string]: any;
|
|
129
|
-
} : {} : AP extends Schema ? {
|
|
130
|
-
[key: string]: FromSchema<AP, Depth>;
|
|
131
|
-
} : {} : {})> : T extends {
|
|
132
|
-
additionalProperties: infer AP;
|
|
133
|
-
} ? AP extends boolean ? AP extends true ? {
|
|
134
|
-
[key: string]: any;
|
|
135
|
-
} : {} : AP extends Schema ? {
|
|
136
|
-
[key: string]: FromSchema<AP, Depth>;
|
|
137
|
-
} : {} : {};
|
|
138
|
-
type RequiredKeys<T> = T extends {
|
|
139
|
-
required: infer R;
|
|
140
|
-
} ? R extends readonly (infer K)[] ? K extends string ? K : never : never : never;
|
|
141
|
-
type OptionalKeys<T> = T extends {
|
|
142
|
-
properties: infer P;
|
|
143
|
-
} ? Exclude<keyof P, RequiredKeys<T>> : never;
|
|
144
|
-
type Equal<A, B> = (<T>() => T extends A ? 1 : 2) extends <T>() => T extends B ? 1 : 2 ? true : false;
|
|
145
|
-
type Simplify<T> = T extends infer O ? {
|
|
146
|
-
[K in keyof O]: O[K];
|
|
147
|
-
} : never;
|
|
148
|
-
type FromOneOfSchema<Schemas extends ReadonlyArray<Schema>, Depth extends number> = Schemas[number] extends infer S ? S extends Schema ? FromSchema<S, Depth> : never : never;
|
|
149
|
-
type FromAllOfSchema<Schemas extends ReadonlyArray<Schema>, Depth extends number> = Schemas extends readonly [infer First, ...infer Rest] ? First extends Schema ? Rest extends ReadonlyArray<Schema> ? FromSchema<First, Depth> & FromAllOfSchema<Rest, Depth> : FromSchema<First, Depth> : never : {};
|
|
150
72
|
export {};
|
package/dist/schema/schema.js
CHANGED
|
@@ -20,15 +20,5 @@ 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
|
const schemaTypes = { number: true, integer: true, string: true, boolean: true, null: true, array: true, object: true, 'typed-buffer': true, blob: true };
|
|
23
|
-
const mySchema = {
|
|
24
|
-
type: 'object',
|
|
25
|
-
properties: {
|
|
26
|
-
a: { type: 'number' },
|
|
27
|
-
b: { type: 'string' },
|
|
28
|
-
c: { enum: [1, 2, 3] }
|
|
29
|
-
},
|
|
30
|
-
required: ['a', 'c'],
|
|
31
|
-
additionalProperties: false,
|
|
32
|
-
};
|
|
33
23
|
export {};
|
|
34
24
|
//# sourceMappingURL=schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/schema/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAwCX,MAAM,WAAW,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAW,CAAC
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/schema/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAwCX,MAAM,WAAW,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAW,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
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 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
|
+
export * as Time from "./public.js";
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/schema/time/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAOX,OAAO,KAAK,IAAI,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./schema.js";
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
export * from "./schema.js";
|
|
23
|
+
//# sourceMappingURL=public.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/schema/time/public.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAEX,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
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 { F64 } from "../../math/f64/index.js";
|
|
23
|
+
export const schema = F64.schema;
|
|
24
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/schema/time/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AACX,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAE9C,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { TypedBuffer } from "../typed-buffer/typed-buffer.js";
|
|
2
|
+
import { DeepReadonly } from "../types/types.js";
|
|
3
|
+
import { Schema } from "./schema.js";
|
|
4
|
+
export type ToType<T, Depth extends number = 5> = T extends {
|
|
5
|
+
mutable: true;
|
|
6
|
+
} ? FromSchemaInternal<T> : DeepReadonly<Depth extends 0 ? any : FromSchemaInternal<T, Depth>>;
|
|
7
|
+
type FromSchemaInternal<T, Depth extends number = 5> = T extends {
|
|
8
|
+
const: infer Const;
|
|
9
|
+
} ? Const : T extends {
|
|
10
|
+
enum: infer Enum;
|
|
11
|
+
} ? Enum extends ReadonlyArray<any> ? Enum[number] : never : T extends {
|
|
12
|
+
oneOf: infer Schemas;
|
|
13
|
+
} ? Schemas extends ReadonlyArray<Schema> ? FromOneOfSchema<Schemas, Decrement<Depth>> : never : T extends {
|
|
14
|
+
allOf: infer Schemas;
|
|
15
|
+
} ? Schemas extends ReadonlyArray<Schema> ? FromAllOfSchema<Schemas, Decrement<Depth>> : never : T extends {
|
|
16
|
+
type: 'number' | 'integer';
|
|
17
|
+
} ? number : T extends {
|
|
18
|
+
type: 'string';
|
|
19
|
+
} ? string : T extends {
|
|
20
|
+
type: 'boolean';
|
|
21
|
+
} ? boolean : T extends {
|
|
22
|
+
type: 'null';
|
|
23
|
+
} ? null : T extends {
|
|
24
|
+
type: 'typed-buffer';
|
|
25
|
+
items: infer Items;
|
|
26
|
+
} ? TypedBuffer<FromSchemaInternal<Items>> : T extends {
|
|
27
|
+
type: 'array';
|
|
28
|
+
} | {
|
|
29
|
+
items: any;
|
|
30
|
+
} ? FromSchemaArray<T, Decrement<Depth>> : T extends {
|
|
31
|
+
type?: undefined;
|
|
32
|
+
default: infer D;
|
|
33
|
+
} ? D : T extends {
|
|
34
|
+
type: 'object';
|
|
35
|
+
} | {
|
|
36
|
+
properties: any;
|
|
37
|
+
} ? FromSchemaObject<T, Decrement<Depth>> : any;
|
|
38
|
+
type Decrement<N extends number> = ((...x: any[]) => void) extends (arg: any, ...rest: infer R) => void ? R['length'] : never;
|
|
39
|
+
type FromSchemaArray<T, Depth extends number> = T extends {
|
|
40
|
+
items: infer Items;
|
|
41
|
+
} ? T extends {
|
|
42
|
+
minItems: infer Min;
|
|
43
|
+
maxItems: infer Max;
|
|
44
|
+
} ? Equal<Min, Max> extends true ? BuildTuple<ToType<Items, Depth>, Min> : ToType<Items, Depth>[] : ToType<Items, Depth>[] : any[];
|
|
45
|
+
type BuildTuple<T, N, R extends unknown[] = []> = R['length'] extends N ? R : BuildTuple<T, N, [...R, T]>;
|
|
46
|
+
type FromSchemaObject<T extends Schema, Depth extends number> = T extends {
|
|
47
|
+
properties: infer P;
|
|
48
|
+
} ? Simplify<{
|
|
49
|
+
[K in RequiredKeys<T>]: ToType<P[K], Depth>;
|
|
50
|
+
} & {
|
|
51
|
+
[K in OptionalKeys<T>]?: ToType<P[K], Depth>;
|
|
52
|
+
} & (T extends {
|
|
53
|
+
additionalProperties: infer AP;
|
|
54
|
+
} ? AP extends false ? {} : AP extends boolean ? AP extends true ? {
|
|
55
|
+
[key: string]: any;
|
|
56
|
+
} : {} : AP extends Schema ? {
|
|
57
|
+
[key: string]: ToType<AP, Depth>;
|
|
58
|
+
} : {} : {})> : T extends {
|
|
59
|
+
additionalProperties: infer AP;
|
|
60
|
+
} ? AP extends boolean ? AP extends true ? {
|
|
61
|
+
[key: string]: any;
|
|
62
|
+
} : {} : AP extends Schema ? {
|
|
63
|
+
[key: string]: ToType<AP, Depth>;
|
|
64
|
+
} : {} : {};
|
|
65
|
+
type RequiredKeys<T> = T extends {
|
|
66
|
+
required: infer R;
|
|
67
|
+
} ? R extends readonly (infer K)[] ? K extends string ? K : never : never : never;
|
|
68
|
+
type OptionalKeys<T> = T extends {
|
|
69
|
+
properties: infer P;
|
|
70
|
+
} ? Exclude<keyof P, RequiredKeys<T>> : never;
|
|
71
|
+
type Equal<A, B> = (<T>() => T extends A ? 1 : 2) extends <T>() => T extends B ? 1 : 2 ? true : false;
|
|
72
|
+
type Simplify<T> = T extends infer O ? {
|
|
73
|
+
[K in keyof O]: O[K];
|
|
74
|
+
} : never;
|
|
75
|
+
type FromOneOfSchema<Schemas extends ReadonlyArray<Schema>, Depth extends number> = Schemas[number] extends infer S ? S extends Schema ? ToType<S, Depth> : never : never;
|
|
76
|
+
type FromAllOfSchema<Schemas extends ReadonlyArray<Schema>, Depth extends number> = Schemas extends readonly [infer First, ...infer Rest] ? First extends Schema ? Rest extends ReadonlyArray<Schema> ? ToType<First, Depth> & FromAllOfSchema<Rest, Depth> : ToType<First, Depth> : never : {};
|
|
77
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
const mySchema = {
|
|
23
|
+
type: 'object',
|
|
24
|
+
properties: {
|
|
25
|
+
a: { type: 'number' },
|
|
26
|
+
b: { type: 'string' },
|
|
27
|
+
c: { enum: [1, 2, 3] }
|
|
28
|
+
},
|
|
29
|
+
required: ['a', 'c'],
|
|
30
|
+
additionalProperties: false,
|
|
31
|
+
};
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=to-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"to-type.js","sourceRoot":"","sources":["../../src/schema/to-type.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AA2JX,MAAM,QAAQ,GAAG;IACf,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACrB,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACrB,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE;KACvB;IACD,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;IACpB,oBAAoB,EAAE,KAAK;CACF,CAAC"}
|
|
@@ -44,7 +44,7 @@ export interface VertexBufferLayoutOptions {
|
|
|
44
44
|
* });
|
|
45
45
|
* ```
|
|
46
46
|
*/
|
|
47
|
-
export declare function
|
|
47
|
+
export declare function toVertexBufferLayout<S extends Schema>(schema: S, options?: VertexBufferLayoutOptions): GPUVertexBufferLayout;
|
|
48
48
|
/**
|
|
49
49
|
* Type-safe helper to generate vertex buffer layout for a specific schema type
|
|
50
50
|
*
|
|
@@ -53,4 +53,4 @@ export declare function schemaToVertexBufferLayout<S extends Schema>(schema: S,
|
|
|
53
53
|
* const positionColorLayout = positionColorNormalVertexSchema |> schemaToVertexBufferLayoutForType;
|
|
54
54
|
* ```
|
|
55
55
|
*/
|
|
56
|
-
export declare function
|
|
56
|
+
export declare function toVertexBufferLayoutForType<T extends Schema>(schema: T, options?: VertexBufferLayoutOptions): GPUVertexBufferLayout;
|
|
@@ -32,15 +32,25 @@ function fieldLayoutToVertexFormat(fieldLayout) {
|
|
|
32
32
|
case "u32": return "uint32";
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
if (typeof fieldLayout === "object"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
35
|
+
if (typeof fieldLayout === "object") {
|
|
36
|
+
const fieldType = fieldLayout.type;
|
|
37
|
+
if (typeof fieldType === "string") {
|
|
38
|
+
// Primitive type
|
|
39
|
+
switch (fieldType) {
|
|
40
|
+
case "f32": return "float32";
|
|
41
|
+
case "i32": return "sint32";
|
|
42
|
+
case "u32": return "uint32";
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
else if (typeof fieldType === "object" && fieldType.type === "array") {
|
|
46
|
+
// Handle array/vector types
|
|
47
|
+
const elementCount = getVectorElementCount(fieldType);
|
|
48
|
+
switch (elementCount) {
|
|
49
|
+
case 1: return "float32"; // f32
|
|
50
|
+
case 2: return "float32x2"; // vec2
|
|
51
|
+
case 3: return "float32x3"; // vec3
|
|
52
|
+
case 4: return "float32x4"; // vec4
|
|
53
|
+
}
|
|
44
54
|
}
|
|
45
55
|
}
|
|
46
56
|
throw new Error(`Unsupported field layout for vertex buffer: ${JSON.stringify(fieldLayout)}`);
|
|
@@ -79,7 +89,7 @@ function getVectorElementCount(fieldLayout) {
|
|
|
79
89
|
* });
|
|
80
90
|
* ```
|
|
81
91
|
*/
|
|
82
|
-
export function
|
|
92
|
+
export function toVertexBufferLayout(schema, options = {}) {
|
|
83
93
|
// Determine layout to use
|
|
84
94
|
const layoutMode = options.layout ?? schema.layout ?? "packed";
|
|
85
95
|
// Get struct layout information
|
|
@@ -93,10 +103,14 @@ export function schemaToVertexBufferLayout(schema, options = {}) {
|
|
|
93
103
|
for (const [fieldName, fieldLayout] of Object.entries(structLayout.fields)) {
|
|
94
104
|
const shaderLocation = options.shaderLocations?.[fieldName] ?? nextShaderLocation;
|
|
95
105
|
try {
|
|
96
|
-
const
|
|
106
|
+
const fieldLayoutTyped = fieldLayout;
|
|
107
|
+
const fieldType = fieldLayoutTyped.type;
|
|
108
|
+
const format = typeof fieldType === "string"
|
|
109
|
+
? fieldLayoutToVertexFormat(fieldType)
|
|
110
|
+
: fieldLayoutToVertexFormat(fieldLayoutTyped);
|
|
97
111
|
attributes.push({
|
|
98
112
|
format,
|
|
99
|
-
offset:
|
|
113
|
+
offset: fieldLayoutTyped.offset,
|
|
100
114
|
shaderLocation
|
|
101
115
|
});
|
|
102
116
|
}
|
|
@@ -123,7 +137,7 @@ export function schemaToVertexBufferLayout(schema, options = {}) {
|
|
|
123
137
|
* const positionColorLayout = positionColorNormalVertexSchema |> schemaToVertexBufferLayoutForType;
|
|
124
138
|
* ```
|
|
125
139
|
*/
|
|
126
|
-
export function
|
|
127
|
-
return
|
|
140
|
+
export function toVertexBufferLayoutForType(schema, options) {
|
|
141
|
+
return toVertexBufferLayout(schema, options);
|
|
128
142
|
}
|
|
129
143
|
//# sourceMappingURL=to-vertex-buffer-layout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"to-vertex-buffer-layout.js","sourceRoot":"","sources":["../../src/schema/to-vertex-buffer-layout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAIX,OAAO,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;AA+C/E;;GAEG;AACH,SAAS,yBAAyB,CAAC,
|
|
1
|
+
{"version":3,"file":"to-vertex-buffer-layout.js","sourceRoot":"","sources":["../../src/schema/to-vertex-buffer-layout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAIX,OAAO,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;AA+C/E;;GAEG;AACH,SAAS,yBAAyB,CAAC,WAAuC;IACtE,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE,CAAC;QAClC,yBAAyB;QACzB,QAAQ,WAAW,EAAE,CAAC;YAClB,KAAK,KAAK,CAAC,CAAC,OAAO,SAAS,CAAC;YAC7B,KAAK,KAAK,CAAC,CAAC,OAAO,QAAQ,CAAC;YAC5B,KAAK,KAAK,CAAC,CAAC,OAAO,QAAQ,CAAC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2C,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAC5I,CAAC;QAED,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC;YACxC,kBAAkB,EAAE,CAAC;QACzB,CAAC;IACL,CAAC;IAED,0DAA0D;IAC1D,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc,GAAG,CAAC,CAAC,cAAc,CAAC,CAAC;IAE/D,OAAO;QACH,WAAW,EAAE,YAAY,CAAC,IAAI;QAC9B,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,QAAQ;QACtC,UAAU;KACb,CAAC;AACN,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,2BAA2B,CACvC,MAAS,EACT,OAAmC;IAEnC,OAAO,oBAAoB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -20,8 +20,8 @@ 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, it, expect } from "vitest";
|
|
23
|
-
import {
|
|
24
|
-
describe("
|
|
23
|
+
import { Schema } from "./index.js";
|
|
24
|
+
describe("Schema.toVertexBufferLayout", () => {
|
|
25
25
|
describe("position-color-normal vertex schema", () => {
|
|
26
26
|
const positionColorNormalSchema = {
|
|
27
27
|
type: "object",
|
|
@@ -48,7 +48,7 @@ describe("schemaToVertexBufferLayout", () => {
|
|
|
48
48
|
layout: "packed"
|
|
49
49
|
};
|
|
50
50
|
it("should generate correct packed layout for position-color-normal", () => {
|
|
51
|
-
const layout =
|
|
51
|
+
const layout = Schema.toVertexBufferLayout(positionColorNormalSchema);
|
|
52
52
|
expect(layout.arrayStride).toBe(40); // 3 + 4 + 3 = 10 floats × 4 bytes = 40 bytes
|
|
53
53
|
expect(layout.stepMode).toBe("vertex");
|
|
54
54
|
expect(layout.attributes).toHaveLength(3);
|
|
@@ -72,19 +72,19 @@ describe("schemaToVertexBufferLayout", () => {
|
|
|
72
72
|
});
|
|
73
73
|
});
|
|
74
74
|
it("should allow custom shader locations", () => {
|
|
75
|
-
const layout =
|
|
75
|
+
const layout = Schema.toVertexBufferLayout(positionColorNormalSchema, {
|
|
76
76
|
shaderLocations: {
|
|
77
77
|
position: 0,
|
|
78
78
|
color: 8,
|
|
79
79
|
normal: 9
|
|
80
80
|
}
|
|
81
81
|
});
|
|
82
|
-
expect(layout.attributes.find(a => a.shaderLocation === 0)?.offset).toBe(0);
|
|
83
|
-
expect(layout.attributes.find(a => a.shaderLocation === 8)?.offset).toBe(12);
|
|
84
|
-
expect(layout.attributes.find(a => a.shaderLocation === 9)?.offset).toBe(28);
|
|
82
|
+
expect(layout.attributes.find((a) => a.shaderLocation === 0)?.offset).toBe(0);
|
|
83
|
+
expect(layout.attributes.find((a) => a.shaderLocation === 8)?.offset).toBe(12);
|
|
84
|
+
expect(layout.attributes.find((a) => a.shaderLocation === 9)?.offset).toBe(28);
|
|
85
85
|
});
|
|
86
86
|
it("should support instance step mode", () => {
|
|
87
|
-
const layout =
|
|
87
|
+
const layout = Schema.toVertexBufferLayout(positionColorNormalSchema, {
|
|
88
88
|
stepMode: "instance"
|
|
89
89
|
});
|
|
90
90
|
expect(layout.stepMode).toBe("instance");
|
|
@@ -104,7 +104,7 @@ describe("schemaToVertexBufferLayout", () => {
|
|
|
104
104
|
layout: "packed"
|
|
105
105
|
};
|
|
106
106
|
it("should generate minimal vertex layout", () => {
|
|
107
|
-
const layout =
|
|
107
|
+
const layout = Schema.toVertexBufferLayout(positionSchema);
|
|
108
108
|
expect(layout.arrayStride).toBe(12); // Vec3 = 12 bytes
|
|
109
109
|
expect(layout.attributes).toHaveLength(1);
|
|
110
110
|
expect(layout.attributes[0]).toEqual({
|
|
@@ -123,7 +123,7 @@ describe("schemaToVertexBufferLayout", () => {
|
|
|
123
123
|
},
|
|
124
124
|
layout: "packed"
|
|
125
125
|
};
|
|
126
|
-
const layout =
|
|
126
|
+
const layout = Schema.toVertexBufferLayout(schema);
|
|
127
127
|
expect(layout.arrayStride).toBe(4);
|
|
128
128
|
expect(layout.attributes[0]).toEqual({
|
|
129
129
|
format: "float32",
|
|
@@ -139,7 +139,7 @@ describe("schemaToVertexBufferLayout", () => {
|
|
|
139
139
|
},
|
|
140
140
|
layout: "packed"
|
|
141
141
|
};
|
|
142
|
-
const layout =
|
|
142
|
+
const layout = Schema.toVertexBufferLayout(schema);
|
|
143
143
|
expect(layout.arrayStride).toBe(4);
|
|
144
144
|
expect(layout.attributes[0]).toEqual({
|
|
145
145
|
format: "uint32",
|
|
@@ -155,7 +155,7 @@ describe("schemaToVertexBufferLayout", () => {
|
|
|
155
155
|
items: { type: "number" }
|
|
156
156
|
};
|
|
157
157
|
expect(() => {
|
|
158
|
-
|
|
158
|
+
Schema.toVertexBufferLayout(arraySchema);
|
|
159
159
|
}).toThrow(/Array must have fixed length/);
|
|
160
160
|
});
|
|
161
161
|
it("should throw error for unsupported field types", () => {
|
|
@@ -167,7 +167,7 @@ describe("schemaToVertexBufferLayout", () => {
|
|
|
167
167
|
layout: "packed"
|
|
168
168
|
};
|
|
169
169
|
expect(() => {
|
|
170
|
-
|
|
170
|
+
Schema.toVertexBufferLayout(schema);
|
|
171
171
|
}).toThrow(/not a valid struct type/);
|
|
172
172
|
});
|
|
173
173
|
it("should throw error for oversized vectors", () => {
|
|
@@ -184,7 +184,7 @@ describe("schemaToVertexBufferLayout", () => {
|
|
|
184
184
|
layout: "packed"
|
|
185
185
|
};
|
|
186
186
|
expect(() => {
|
|
187
|
-
|
|
187
|
+
Schema.toVertexBufferLayout(schema);
|
|
188
188
|
}).toThrow(/dimensions must be 1-4 elements/);
|
|
189
189
|
});
|
|
190
190
|
});
|
|
@@ -202,7 +202,7 @@ describe("schemaToVertexBufferLayout", () => {
|
|
|
202
202
|
},
|
|
203
203
|
layout: "packed"
|
|
204
204
|
};
|
|
205
|
-
const layout =
|
|
205
|
+
const layout = Schema.toVertexBufferLayout(schema);
|
|
206
206
|
expect(layout.arrayStride).toBe(12); // Packed: tight packing
|
|
207
207
|
});
|
|
208
208
|
it("should override schema layout when specified", () => {
|
|
@@ -218,14 +218,14 @@ describe("schemaToVertexBufferLayout", () => {
|
|
|
218
218
|
},
|
|
219
219
|
layout: "packed"
|
|
220
220
|
};
|
|
221
|
-
const layout =
|
|
221
|
+
const layout = Schema.toVertexBufferLayout(schema, {
|
|
222
222
|
layout: "std140"
|
|
223
223
|
});
|
|
224
224
|
expect(layout.arrayStride).toBe(16); // std140: 16-byte alignment
|
|
225
225
|
});
|
|
226
226
|
});
|
|
227
227
|
describe("type-safe helper", () => {
|
|
228
|
-
it("should work with
|
|
228
|
+
it("should work with Schema.toVertexBufferLayoutForType", () => {
|
|
229
229
|
const testSchema = {
|
|
230
230
|
type: "object",
|
|
231
231
|
properties: {
|
|
@@ -238,7 +238,7 @@ describe("schemaToVertexBufferLayout", () => {
|
|
|
238
238
|
},
|
|
239
239
|
layout: "packed"
|
|
240
240
|
};
|
|
241
|
-
const layout =
|
|
241
|
+
const layout = Schema.toVertexBufferLayoutForType(testSchema);
|
|
242
242
|
expect(layout.arrayStride).toBe(8); // Vec2 = 8 bytes
|
|
243
243
|
expect(layout.attributes[0].format).toBe("float32x2");
|
|
244
244
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"to-vertex-buffer-layout.test.js","sourceRoot":"","sources":["../../src/schema/to-vertex-buffer-layout.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AACX,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CA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AAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,4BAA4B;QACrE,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;QAC9B,EAAE,CAAC,qDAAqD,EAAE,GAAG,EAAE;YAC3D,MAAM,UAAU,GAAe;gBAC3B,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACR,QAAQ,EAAE;wBACN,IAAI,EAAE,OAAO;wBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE;wBACvC,QAAQ,EAAE,CAAC;wBACX,QAAQ,EAAE,CAAC;qBACd;iBACJ;gBACD,MAAM,EAAE,QAAQ;aACnB,CAAC;YAEF,MAAM,MAAM,GAAG,MAAM,CAAC,2BAA2B,CAAC,UAAU,CAAC,CAAC;YAC9D,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,iBAAiB;YACrD,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC1D,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
export * as True from "./public.js";
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/schema/true/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAOX,OAAO,KAAK,IAAI,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./schema.js";
|