@adobe/data 0.4.4 → 0.4.6
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/ecs/database/database-schema/create-database-from-schema.d.ts +12 -0
- package/dist/ecs/database/database-schema/create-database-from-schema.js +8 -0
- package/dist/ecs/database/database-schema/create-database-from-schema.js.map +1 -0
- package/dist/ecs/database/database-schema/create-database-schema-test.js +2 -2
- package/dist/ecs/database/database-schema/create-database-schema-test.js.map +1 -1
- package/dist/ecs/database/database-schema/create-database-schema.d.ts +3 -6
- package/dist/ecs/database/database-schema/create-database-schema.js +2 -2
- package/dist/ecs/database/database-schema/create-database-schema.js.map +1 -1
- package/dist/{core/schema/validation/is-valid.test.js → ecs/database/database-schema/create-store-schema-test.js} +14 -18
- package/dist/ecs/database/database-schema/create-store-schema-test.js.map +1 -0
- package/dist/ecs/database/database-schema/create-store-schema.d.ts +9 -0
- package/dist/{core/functions/is-async-generator.js → ecs/database/database-schema/create-store-schema.js} +4 -3
- package/dist/ecs/database/database-schema/create-store-schema.js.map +1 -0
- package/dist/ecs/database/database-schema/database-schema.d.ts +2 -5
- package/dist/ecs/database/database-schema/index.d.ts +2 -2
- package/dist/ecs/database/database-schema/index.js +2 -2
- package/dist/ecs/database/database-schema/index.js.map +1 -1
- package/dist/ecs/database/database-schema/store-schema.d.ts +12 -0
- package/dist/ecs/{ecs/ecs-types.js → database/database-schema/store-schema.js} +1 -1
- package/dist/ecs/database/database-schema/store-schema.js.map +1 -0
- package/dist/ecs/database/database.d.ts +4 -4
- package/dist/ecs/database/index.d.ts +0 -1
- package/dist/ecs/database/index.js +0 -1
- package/dist/ecs/database/index.js.map +1 -1
- package/dist/{cache/functions/omit.js → ecs/database/store-schema/create-store-schema-test.js} +15 -8
- package/dist/ecs/database/store-schema/create-store-schema-test.js.map +1 -0
- package/dist/ecs/database/store-schema/create-store-schema.d.ts +9 -0
- package/dist/{core/index.js → ecs/database/store-schema/create-store-schema.js} +5 -4
- package/dist/ecs/database/store-schema/create-store-schema.js.map +1 -0
- package/dist/ecs/database/store-schema/index.d.ts +2 -0
- package/dist/ecs/{action-ecs → database/store-schema}/index.js +2 -1
- package/dist/ecs/database/store-schema/index.js.map +1 -0
- package/dist/ecs/database/store-schema/store-schema.d.ts +12 -0
- package/dist/ecs/database/{transactional-store/undoable.js → store-schema/store-schema.js} +1 -1
- package/dist/ecs/database/store-schema/store-schema.js.map +1 -0
- package/dist/ecs/database/transactional-store/apply-operations.d.ts +2 -2
- package/dist/ecs/database/transactional-store/apply-operations.js.map +1 -1
- package/dist/ecs/database/transactional-store/create-test-transaction.d.ts +0 -1
- package/dist/ecs/database/transactional-store/create-test-transaction.js.map +1 -1
- package/dist/ecs/database/transactional-store/create-transactional-store.js +5 -6
- package/dist/ecs/database/transactional-store/create-transactional-store.js.map +1 -1
- package/dist/ecs/database/transactional-store/index.d.ts +0 -1
- package/dist/ecs/database/transactional-store/index.js +0 -1
- package/dist/ecs/database/transactional-store/index.js.map +1 -1
- package/dist/ecs/database/transactional-store/transactional-store.d.ts +1 -6
- package/dist/ecs/store/create-store.js.map +1 -1
- package/dist/ecs/store/index.d.ts +1 -0
- package/dist/ecs/store/index.js +1 -0
- package/dist/ecs/store/index.js.map +1 -1
- package/dist/{cache/functions/bind-functions.js → ecs/store/store-schema/create-store-schema-test.js} +15 -12
- 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 +9 -0
- package/dist/{core/functions/index.js → ecs/store/store-schema/create-store-schema.js} +5 -4
- package/dist/ecs/store/store-schema/create-store-schema.js.map +1 -0
- package/dist/ecs/store/store-schema/index.d.ts +2 -0
- package/dist/ecs/{transaction-ecs → store/store-schema}/index.js +2 -2
- package/dist/ecs/store/store-schema/index.js.map +1 -0
- package/dist/ecs/store/store-schema/store-schema.d.ts +12 -0
- package/dist/{cache/functions/types.js → ecs/store/store-schema/store-schema.js} +1 -1
- package/dist/ecs/store/store-schema/store-schema.js.map +1 -0
- package/dist/ecs/store/store.d.ts +6 -0
- package/dist/ecs/undo-redo/create-undo-redo-actions.js +0 -21
- package/dist/ecs/undo-redo/create-undo-redo-actions.js.map +1 -1
- package/dist/ecs/undo-redo/create-undo-redo-actions.test.js.map +1 -1
- package/dist/functions/serialization/deserialize.d.ts +4 -1
- package/dist/functions/serialization/deserialize.js +14 -1
- package/dist/functions/serialization/deserialize.js.map +1 -1
- package/dist/functions/serialization/serialization.d.ts +23 -0
- package/dist/functions/serialization/serialization.js +58 -0
- package/dist/functions/serialization/serialization.js.map +1 -0
- package/dist/functions/serialization.d.ts +23 -0
- package/dist/functions/serialization.js +58 -0
- package/dist/functions/serialization.js.map +1 -0
- package/dist/{core/functions/with-validation.js → functions/serialization.test.js} +22 -16
- package/dist/functions/serialization.test.js.map +1 -0
- package/dist/functions/serialize.d.ts +17 -0
- package/dist/functions/serialize.js +66 -0
- package/dist/functions/serialize.js.map +1 -0
- package/dist/observe/to-async-generator.js +14 -11
- package/dist/observe/to-async-generator.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/typed-buffer/structs/get-struct-layout.js +7 -10
- package/dist/typed-buffer/structs/get-struct-layout.js.map +1 -1
- package/dist/typed-buffer/structs/get-struct-layout.test.js +148 -11
- package/dist/typed-buffer/structs/get-struct-layout.test.js.map +1 -1
- package/package.json +1 -1
- package/dist/README.md +0 -310
- package/dist/cache/functions/bind-functions.d.ts +0 -6
- package/dist/cache/functions/bind-functions.js.map +0 -1
- package/dist/cache/functions/hashing/arrayBufferToHex.d.ts +0 -1
- package/dist/cache/functions/hashing/arrayBufferToHex.js +0 -27
- package/dist/cache/functions/hashing/arrayBufferToHex.js.map +0 -1
- package/dist/cache/functions/omit.d.ts +0 -1
- package/dist/cache/functions/omit.js.map +0 -1
- package/dist/cache/functions/types.d.ts +0 -1
- package/dist/cache/functions/types.js.map +0 -1
- package/dist/core/data.d.ts +0 -22
- package/dist/core/data.js +0 -52
- package/dist/core/data.js.map +0 -1
- package/dist/core/data.test.js +0 -48
- package/dist/core/data.test.js.map +0 -1
- package/dist/core/functions/array-equals.d.ts +0 -1
- package/dist/core/functions/array-equals.js +0 -34
- package/dist/core/functions/array-equals.js.map +0 -1
- package/dist/core/functions/deep-merge.d.ts +0 -32
- package/dist/core/functions/deep-merge.js +0 -54
- package/dist/core/functions/deep-merge.js.map +0 -1
- package/dist/core/functions/deep-merge.test.js +0 -94
- package/dist/core/functions/deep-merge.test.js.map +0 -1
- package/dist/core/functions/index.d.ts +0 -3
- package/dist/core/functions/index.js.map +0 -1
- package/dist/core/functions/is-async-generator.d.ts +0 -1
- package/dist/core/functions/is-async-generator.js.map +0 -1
- package/dist/core/functions/is-promise.d.ts +0 -1
- package/dist/core/functions/is-promise.js +0 -26
- package/dist/core/functions/is-promise.js.map +0 -1
- package/dist/core/functions/with-validation.d.ts +0 -5
- package/dist/core/functions/with-validation.js.map +0 -1
- package/dist/core/functions/with-validation.test.js +0 -96
- package/dist/core/functions/with-validation.test.js.map +0 -1
- package/dist/core/index.d.ts +0 -3
- package/dist/core/index.js.map +0 -1
- package/dist/core/schema/dynamic/dynamic-schema.d.ts +0 -27
- package/dist/core/schema/dynamic/dynamic-schema.js +0 -2
- package/dist/core/schema/dynamic/dynamic-schema.js.map +0 -1
- package/dist/core/schema/dynamic/enumerate-patches.d.ts +0 -9
- package/dist/core/schema/dynamic/enumerate-patches.js +0 -50
- package/dist/core/schema/dynamic/enumerate-patches.js.map +0 -1
- package/dist/core/schema/dynamic/enumerate-patches.test.d.ts +0 -134
- package/dist/core/schema/dynamic/enumerate-patches.test.js +0 -209
- package/dist/core/schema/dynamic/enumerate-patches.test.js.map +0 -1
- package/dist/core/schema/dynamic/get-dynamic-schema.d.ts +0 -5
- package/dist/core/schema/dynamic/get-dynamic-schema.js +0 -26
- package/dist/core/schema/dynamic/get-dynamic-schema.js.map +0 -1
- package/dist/core/schema/dynamic/get-dynamic-schema.test.d.ts +0 -1
- package/dist/core/schema/dynamic/get-dynamic-schema.test.js +0 -94
- package/dist/core/schema/dynamic/get-dynamic-schema.test.js.map +0 -1
- package/dist/core/schema/dynamic/index.d.ts +0 -1
- package/dist/core/schema/dynamic/index.js +0 -2
- package/dist/core/schema/dynamic/index.js.map +0 -1
- package/dist/core/schema/dynamic/schema-path-value-path.d.ts +0 -5
- package/dist/core/schema/dynamic/schema-path-value-path.js +0 -12
- package/dist/core/schema/dynamic/schema-path-value-path.js.map +0 -1
- package/dist/core/schema/dynamic-schema.d.ts +0 -27
- package/dist/core/schema/dynamic-schema.js +0 -2
- package/dist/core/schema/dynamic-schema.js.map +0 -1
- package/dist/core/schema/index.d.ts +0 -4
- package/dist/core/schema/index.js +0 -26
- package/dist/core/schema/index.js.map +0 -1
- package/dist/core/schema/schema.d.ts +0 -122
- package/dist/core/schema/schema.js +0 -34
- package/dist/core/schema/schema.js.map +0 -1
- package/dist/core/schema/schemas.d.ts +0 -45
- package/dist/core/schema/schemas.js +0 -39
- package/dist/core/schema/schemas.js.map +0 -1
- package/dist/core/schema/ui-schema.d.ts +0 -25
- package/dist/core/schema/ui-schema.js +0 -2
- package/dist/core/schema/ui-schema.js.map +0 -1
- package/dist/core/schema/validation/is-valid.d.ts +0 -2
- package/dist/core/schema/validation/is-valid.js +0 -14
- package/dist/core/schema/validation/is-valid.js.map +0 -1
- package/dist/core/schema/validation/is-valid.test.d.ts +0 -1
- package/dist/core/schema/validation/is-valid.test.js.map +0 -1
- package/dist/core/schema/validation/validate.d.ts +0 -2
- package/dist/core/schema/validation/validate.js +0 -38
- package/dist/core/schema/validation/validate.js.map +0 -1
- package/dist/core/schema/validation/validate.test.d.ts +0 -1
- package/dist/core/schema/validation/validate.test.js +0 -106
- package/dist/core/schema/validation/validate.test.js.map +0 -1
- package/dist/core/schema/validation/with-validation.d.ts +0 -5
- package/dist/core/schema/validation/with-validation.js +0 -16
- package/dist/core/schema/validation/with-validation.js.map +0 -1
- package/dist/core/schema/validation/with-validation.test.d.ts +0 -1
- package/dist/core/schema/validation/with-validation.test.js +0 -96
- package/dist/core/schema/validation/with-validation.test.js.map +0 -1
- package/dist/core/schema.d.ts +0 -86
- package/dist/core/schema.js +0 -33
- package/dist/core/schema.js.map +0 -1
- package/dist/core/schema.test.js +0 -16
- package/dist/core/schema.test.js.map +0 -1
- package/dist/core/schemas.d.ts +0 -45
- package/dist/core/schemas.js +0 -39
- package/dist/core/schemas.js.map +0 -1
- package/dist/ecs/action-ecs/action-ecs.d.ts +0 -19
- package/dist/ecs/action-ecs/action-ecs.js +0 -203
- package/dist/ecs/action-ecs/action-ecs.js.map +0 -1
- package/dist/ecs/action-ecs/action-ecs.test.d.ts +0 -1
- package/dist/ecs/action-ecs/action-ecs.test.js +0 -362
- package/dist/ecs/action-ecs/action-ecs.test.js.map +0 -1
- package/dist/ecs/action-ecs/action-types.d.ts +0 -106
- package/dist/ecs/action-ecs/action-types.js +0 -19
- package/dist/ecs/action-ecs/action-types.js.map +0 -1
- package/dist/ecs/action-ecs/index.d.ts +0 -2
- package/dist/ecs/action-ecs/index.js.map +0 -1
- package/dist/ecs/core-ecs/core-ecs-serialization.test.d.ts +0 -1
- package/dist/ecs/core-ecs/core-ecs-serialization.test.js +0 -230
- package/dist/ecs/core-ecs/core-ecs-serialization.test.js.map +0 -1
- package/dist/ecs/core-ecs/core-ecs-types.d.ts +0 -141
- package/dist/ecs/core-ecs/core-ecs-types.js +0 -23
- package/dist/ecs/core-ecs/core-ecs-types.js.map +0 -1
- package/dist/ecs/core-ecs/core-ecs.d.ts +0 -7
- package/dist/ecs/core-ecs/core-ecs.js +0 -492
- package/dist/ecs/core-ecs/core-ecs.js.map +0 -1
- package/dist/ecs/core-ecs/core-ecs.test.d.ts +0 -1
- package/dist/ecs/core-ecs/core-ecs.test.js +0 -425
- package/dist/ecs/core-ecs/core-ecs.test.js.map +0 -1
- package/dist/ecs/core-ecs/index.d.ts +0 -1
- package/dist/ecs/core-ecs/index.js +0 -2
- package/dist/ecs/core-ecs/index.js.map +0 -1
- package/dist/ecs/database/register-database-codec.d.ts +0 -1
- package/dist/ecs/database/register-database-codec.js +0 -35
- package/dist/ecs/database/register-database-codec.js.map +0 -1
- package/dist/ecs/database/register-database-codecs.d.ts +0 -1
- package/dist/ecs/database/register-database-codecs.js +0 -35
- package/dist/ecs/database/register-database-codecs.js.map +0 -1
- package/dist/ecs/database/register-store-codec.d.ts +0 -1
- package/dist/ecs/database/register-store-codec.js +0 -35
- package/dist/ecs/database/register-store-codec.js.map +0 -1
- package/dist/ecs/database/register-typed-buffer-codecs.d.ts +0 -1
- package/dist/ecs/database/register-typed-buffer-codecs.js +0 -80
- package/dist/ecs/database/register-typed-buffer-codecs.js.map +0 -1
- package/dist/ecs/database/transactional-store/apply-write-operations.d.ts +0 -7
- package/dist/ecs/database/transactional-store/apply-write-operations.js +0 -20
- package/dist/ecs/database/transactional-store/apply-write-operations.js.map +0 -1
- package/dist/ecs/database/transactional-store/applyWriteOperations.d.ts +0 -7
- package/dist/ecs/database/transactional-store/applyWriteOperations.js +0 -20
- package/dist/ecs/database/transactional-store/applyWriteOperations.js.map +0 -1
- package/dist/ecs/database/transactional-store/patch.d.ts +0 -3
- package/dist/ecs/database/transactional-store/patch.js +0 -7
- package/dist/ecs/database/transactional-store/patch.js.map +0 -1
- package/dist/ecs/database/transactional-store/undoable.d.ts +0 -13
- package/dist/ecs/database/transactional-store/undoable.js.map +0 -1
- package/dist/ecs/database/transactional-store/with-undoable.d.ts +0 -10
- package/dist/ecs/database/transactional-store/with-undoable.js +0 -13
- package/dist/ecs/database/transactional-store/with-undoable.js.map +0 -1
- package/dist/ecs/database/with-undoable.d.ts +0 -10
- package/dist/ecs/database/with-undoable.js +0 -13
- package/dist/ecs/database/with-undoable.js.map +0 -1
- package/dist/ecs/ecs/ecs-types.d.ts +0 -132
- package/dist/ecs/ecs/ecs-types.js.map +0 -1
- package/dist/ecs/ecs/ecs-where-functions.d.ts +0 -6
- package/dist/ecs/ecs/ecs-where-functions.js +0 -91
- package/dist/ecs/ecs/ecs-where-functions.js.map +0 -1
- package/dist/ecs/ecs/ecs.d.ts +0 -13
- package/dist/ecs/ecs/ecs.js +0 -177
- package/dist/ecs/ecs/ecs.js.map +0 -1
- package/dist/ecs/ecs/ecs.test.d.ts +0 -1
- package/dist/ecs/ecs/ecs.test.js +0 -399
- package/dist/ecs/ecs/ecs.test.js.map +0 -1
- package/dist/ecs/ecs/index.d.ts +0 -3
- package/dist/ecs/ecs/index.js +0 -3
- package/dist/ecs/ecs/index.js.map +0 -1
- package/dist/ecs/entity-location-table/register-database-codec.d.ts +0 -1
- package/dist/ecs/entity-location-table/register-database-codec.js +0 -35
- package/dist/ecs/entity-location-table/register-database-codec.js.map +0 -1
- package/dist/ecs/entity-location-table/register-entity-location-table-codec.d.ts +0 -1
- package/dist/ecs/entity-location-table/register-entity-location-table-codec.js +0 -42
- package/dist/ecs/entity-location-table/register-entity-location-table-codec.js.map +0 -1
- package/dist/ecs/entity-location-table/register-entity-location-table-codec.test.d.ts +0 -1
- package/dist/ecs/entity-location-table/register-entity-location-table-codec.test.js +0 -70
- package/dist/ecs/entity-location-table/register-entity-location-table-codec.test.js.map +0 -1
- package/dist/ecs/persistence-service/create-persistence-service.d.ts +0 -6
- package/dist/ecs/persistence-service/create-persistence-service.js +0 -24
- package/dist/ecs/persistence-service/create-persistence-service.js.map +0 -1
- package/dist/ecs/persistence-service/create-session-persistence-service.d.ts +0 -8
- package/dist/ecs/persistence-service/create-session-persistence-service.js +0 -49
- package/dist/ecs/persistence-service/create-session-persistence-service.js.map +0 -1
- package/dist/ecs/persistence-service/persistence-service copy.d.ts +0 -5
- package/dist/ecs/persistence-service/persistence-service copy.js +0 -2
- package/dist/ecs/persistence-service/persistence-service copy.js.map +0 -1
- package/dist/ecs/persistence-service/to-blob-refs.d.ts +0 -2
- package/dist/ecs/persistence-service/to-blob-refs.js +0 -3
- package/dist/ecs/persistence-service/to-blob-refs.js.map +0 -1
- package/dist/ecs/persistence-service/undo-redo-service.d.ts +0 -11
- package/dist/ecs/persistence-service/undo-redo-service.js +0 -23
- package/dist/ecs/persistence-service/undo-redo-service.js.map +0 -1
- package/dist/ecs/store/core/register-core-codec.d.ts +0 -1
- package/dist/ecs/store/core/register-core-codec.js +0 -45
- package/dist/ecs/store/core/register-core-codec.js.map +0 -1
- package/dist/ecs/store/core/register-core-codec.test.d.ts +0 -1
- package/dist/ecs/store/core/register-core-codec.test.js +0 -136
- package/dist/ecs/store/core/register-core-codec.test.js.map +0 -1
- package/dist/ecs/store/query.d.ts +0 -47
- package/dist/ecs/store/query.js +0 -2
- package/dist/ecs/store/query.js.map +0 -1
- package/dist/ecs/store/register-core-codec.d.ts +0 -1
- package/dist/ecs/store/register-core-codec.js +0 -38
- package/dist/ecs/store/register-core-codec.js.map +0 -1
- package/dist/ecs/store/register-store-codec.d.ts +0 -1
- package/dist/ecs/store/register-store-codec.js +0 -38
- package/dist/ecs/store/register-store-codec.js.map +0 -1
- package/dist/ecs/store/restore-store.d.ts +0 -12
- package/dist/ecs/store/restore-store.js +0 -91
- package/dist/ecs/store/restore-store.js.map +0 -1
- package/dist/ecs/store/select-options.d.ts +0 -1
- package/dist/ecs/store/select-options.js +0 -16
- package/dist/ecs/store/select-options.js.map +0 -1
- package/dist/ecs/store/select.d.ts +0 -44
- package/dist/ecs/store/select.js +0 -2
- package/dist/ecs/store/select.js.map +0 -1
- package/dist/ecs/transaction-ecs/index.d.ts +0 -2
- package/dist/ecs/transaction-ecs/index.js.map +0 -1
- package/dist/ecs/transaction-ecs/transaction-ecs.d.ts +0 -11
- package/dist/ecs/transaction-ecs/transaction-ecs.js +0 -184
- package/dist/ecs/transaction-ecs/transaction-ecs.js.map +0 -1
- package/dist/ecs/transaction-ecs/transaction-ecs.test.d.ts +0 -1
- package/dist/ecs/transaction-ecs/transaction-ecs.test.js +0 -599
- package/dist/ecs/transaction-ecs/transaction-ecs.test.js.map +0 -1
- package/dist/ecs/transaction-ecs/transaction-types.d.ts +0 -135
- package/dist/ecs/transaction-ecs/transaction-types.js +0 -2
- package/dist/ecs/transaction-ecs/transaction-types.js.map +0 -1
- package/dist/ecs/transaction-ecs/transactions.d.ts +0 -5
- package/dist/ecs/transaction-ecs/transactions.js +0 -158
- package/dist/ecs/transaction-ecs/transactions.js.map +0 -1
- package/dist/ecs/undo-redo/do.d.ts +0 -3
- package/dist/ecs/undo-redo/do.js +0 -3
- package/dist/ecs/undo-redo/do.js.map +0 -1
- package/dist/ecs/undo-redo/index.d.ts +0 -1
- package/dist/ecs/undo-redo/index.js +0 -23
- package/dist/ecs/undo-redo/index.js.map +0 -1
- package/dist/functions/serialization/register-typed-array-codecs copy.d.ts +0 -1
- package/dist/functions/serialization/register-typed-array-codecs copy.js +0 -13
- package/dist/functions/serialization/register-typed-array-codecs copy.js.map +0 -1
- package/dist/functions/serialization/serialize-to-blobs copy.d.ts +0 -8
- package/dist/functions/serialization/serialize-to-blobs copy.js +0 -21
- package/dist/functions/serialization/serialize-to-blobs copy.js.map +0 -1
- package/dist/observe/with-map copy.d.ts +0 -5
- package/dist/observe/with-map copy.js +0 -14
- package/dist/observe/with-map copy.js.map +0 -1
- package/dist/package.json +0 -129
- package/dist/schema/f32 copy.d.ts +0 -6
- package/dist/schema/f32 copy.js +0 -6
- package/dist/schema/f32 copy.js.map +0 -1
- package/dist/schemas/index.d.ts +0 -1
- package/dist/schemas/index.js +0 -23
- package/dist/schemas/index.js.map +0 -1
- package/dist/schemas/schemas.d.ts +0 -45
- package/dist/schemas/schemas.js +0 -39
- package/dist/schemas/schemas.js.map +0 -1
- package/dist/service/sequential-action.d.ts +0 -18
- package/dist/service/sequential-action.js +0 -45
- package/dist/service/sequential-action.js.map +0 -1
- package/dist/table/ensure-capacity copy.d.ts +0 -2
- package/dist/table/ensure-capacity copy.js +0 -15
- package/dist/table/ensure-capacity copy.js.map +0 -1
- package/dist/table/filter-rows.d.ts +0 -2
- package/dist/table/filter-rows.js +0 -15
- package/dist/table/filter-rows.js.map +0 -1
- /package/dist/{core/data.test.d.ts → ecs/database/database-schema/create-store-schema-test.d.ts} +0 -0
- /package/dist/{core/functions/deep-merge.test.d.ts → ecs/database/store-schema/create-store-schema-test.d.ts} +0 -0
- /package/dist/{core/functions/with-validation.test.d.ts → ecs/store/store-schema/create-store-schema-test.d.ts} +0 -0
- /package/dist/{core/schema.test.d.ts → functions/serialization.test.d.ts} +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FromSchemas } from "../../../schema/schema.js";
|
|
2
|
+
import { StringKeyof } from "../../../types/types.js";
|
|
3
|
+
import { ComponentSchemas } from "../../component-schemas.js";
|
|
4
|
+
import { ResourceSchemas } from "../../resource-schemas.js";
|
|
5
|
+
import { ArchetypeComponents } from "../../store/archetype-components.js";
|
|
6
|
+
import { Store } from "../../store/store.js";
|
|
7
|
+
import { Database, TransactionDeclaration } from "../database.js";
|
|
8
|
+
import { DatabaseSchema } from "./database-schema.js";
|
|
9
|
+
export declare const createDatabaseFromSchema: <CS extends ComponentSchemas, RS extends ResourceSchemas, A extends ArchetypeComponents<StringKeyof<CS>>, TD extends Record<string, TransactionDeclaration>, DS extends DatabaseSchema<CS, RS, A, TD>>(schema: DS) => {
|
|
10
|
+
database: Database<FromSchemas<CS>, FromSchemas<RS>, A, TD>;
|
|
11
|
+
store: Store<FromSchemas<CS>, FromSchemas<RS>, A>;
|
|
12
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createStore } from "../../store/create-store.js";
|
|
2
|
+
import { createDatabase } from "../create-database.js";
|
|
3
|
+
export const createDatabaseFromSchema = (schema) => {
|
|
4
|
+
const store = createStore(schema.components, schema.resources, schema.archetypes);
|
|
5
|
+
const database = createDatabase(store, schema.transactions);
|
|
6
|
+
return { database, store };
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=create-database-from-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-database-from-schema.js","sourceRoot":"","sources":["../../../../src/ecs/database/database-schema/create-database-from-schema.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAIvD,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAMtC,MAAU,EAAsH,EAAE;IAChI,MAAM,KAAK,GAAG,WAAW,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;IAClF,MAAM,QAAQ,GAAG,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;IAC5D,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAQ,CAAC;AACrC,CAAC,CAAA"}
|
|
@@ -20,9 +20,9 @@ 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 { TrueSchema } from "../../../schema/true.js";
|
|
23
|
-
import {
|
|
23
|
+
import { createStoreSchema } from "./create-store-schema.js";
|
|
24
24
|
// just a compile time test which is why we're using -test.ts extension instead of .test.ts
|
|
25
|
-
|
|
25
|
+
createStoreSchema({
|
|
26
26
|
velocity: { type: "number" },
|
|
27
27
|
particle: TrueSchema,
|
|
28
28
|
}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-database-schema-test.js","sourceRoot":"","sources":["../../../../src/ecs/database/database-schema/create-database-schema-test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAEX,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"create-database-schema-test.js","sourceRoot":"","sources":["../../../../src/ecs/database/database-schema/create-database-schema-test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAEX,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,2FAA2F;AAE3F,iBAAiB,CACb;IACI,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC5B,QAAQ,EAAE,UAAU;CACvB,EACD;IACI,aAAa,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EAAE;IAC7C,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EAAE;CAC9C,EACD;IACI,GAAG,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;IAC7B,mBAAmB;IACnB,GAAG,EAAE,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC,0DAA0D;CAC5F,EACD;IACI,gBAAgB,EAAE,CAAC,CAAC,EAAE,QAAgB,EAAE,EAAE;QACtC,CAAC,CAAC,SAAS,CAAC,aAAa,GAAG,QAAQ,CAAC;QACrC,mBAAmB;QACnB,CAAC,CAAC,SAAS,CAAC,cAAc,GAAG,QAAQ,CAAC;IAC1C,CAAC;CACJ,CACJ,CAAA"}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import { FromSchemas, Schema } from "../../../schema/schema.js";
|
|
2
1
|
import { StringKeyof } from "../../../types/types.js";
|
|
2
|
+
import { ComponentSchemas } from "../../component-schemas.js";
|
|
3
|
+
import { ResourceSchemas } from "../../resource-schemas.js";
|
|
3
4
|
import { ArchetypeComponents } from "../../store/archetype-components.js";
|
|
4
|
-
|
|
5
|
-
export declare function createDatabaseSchema<const CS extends Record<string, Schema>, const RS extends Record<string, Schema & {
|
|
6
|
-
default?: any;
|
|
7
|
-
}>, const A extends ArchetypeComponents<StringKeyof<CS>>, const TD extends Record<string, TransactionDeclaration<FromSchemas<CS>, FromSchemas<RS>, A>>>(components: CS, resources: RS, archetypes: A, transactions: TD): {
|
|
5
|
+
export declare function createStoreSchema<const CS extends ComponentSchemas, const RS extends ResourceSchemas, const A extends ArchetypeComponents<StringKeyof<CS>>>(components: CS, resources: RS, archetypes: A): {
|
|
8
6
|
components: CS;
|
|
9
7
|
resources: RS;
|
|
10
8
|
archetypes: A;
|
|
11
|
-
transactions: TD;
|
|
12
9
|
};
|
|
@@ -19,8 +19,8 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.*/
|
|
22
|
-
export function
|
|
23
|
-
return { components, resources, archetypes
|
|
22
|
+
export function createStoreSchema(components, resources, archetypes) {
|
|
23
|
+
return { components, resources, archetypes };
|
|
24
24
|
}
|
|
25
25
|
;
|
|
26
26
|
//# 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;
|
|
1
|
+
{"version":3,"file":"create-database-schema.js","sourceRoot":"","sources":["../../../../src/ecs/database/database-schema/create-database-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAQX,MAAM,UAAU,iBAAiB,CAK7B,UAAc,EACd,SAAa,EACb,UAAa;IAEb,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAmC,CAAC;AAClF,CAAC;AAAA,CAAC"}
|
|
@@ -19,22 +19,18 @@ 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 {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
it('returns false for invalid data', () => {
|
|
36
|
-
expect(isValid(schema, { foo: 123 })).toBe(false);
|
|
37
|
-
expect(isValid(schema, {})).toBe(false);
|
|
38
|
-
});
|
|
22
|
+
import { TrueSchema } from "../../../schema/true.js";
|
|
23
|
+
import { createStoreSchema } from "./create-store-schema.js";
|
|
24
|
+
// just a compile time test which is why we're using -test.ts extension instead of .test.ts
|
|
25
|
+
createStoreSchema({
|
|
26
|
+
velocity: { type: "number" },
|
|
27
|
+
particle: TrueSchema,
|
|
28
|
+
}, {
|
|
29
|
+
mousePosition: { type: "number", default: 0 },
|
|
30
|
+
fooPosition: { type: "number", default: 0 },
|
|
31
|
+
}, {
|
|
32
|
+
bar: ["particle", "velocity"],
|
|
33
|
+
// @ts-expect-error
|
|
34
|
+
foo: ["particle", "velocity2"] // should throw error because velocity2 is not a component
|
|
39
35
|
});
|
|
40
|
-
//# sourceMappingURL=
|
|
36
|
+
//# sourceMappingURL=create-store-schema-test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-store-schema-test.js","sourceRoot":"","sources":["../../../../src/ecs/database/database-schema/create-store-schema-test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAEX,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,2FAA2F;AAE3F,iBAAiB,CACb;IACI,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC5B,QAAQ,EAAE,UAAU;CACvB,EACD;IACI,aAAa,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EAAE;IAC7C,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EAAE;CAC9C,EACD;IACI,GAAG,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;IAC7B,mBAAmB;IACnB,GAAG,EAAE,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC,0DAA0D;CAC5F,CACJ,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { StringKeyof } from "../../../types/types.js";
|
|
2
|
+
import { ComponentSchemas } from "../../component-schemas.js";
|
|
3
|
+
import { ResourceSchemas } from "../../resource-schemas.js";
|
|
4
|
+
import { ArchetypeComponents } from "../../store/archetype-components.js";
|
|
5
|
+
export declare function createStoreSchema<const CS extends ComponentSchemas, const RS extends ResourceSchemas, const A extends ArchetypeComponents<StringKeyof<CS>>>(components: CS, resources: RS, archetypes: A): {
|
|
6
|
+
components: CS;
|
|
7
|
+
resources: RS;
|
|
8
|
+
archetypes: A;
|
|
9
|
+
};
|
|
@@ -19,7 +19,8 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.*/
|
|
22
|
-
export function
|
|
23
|
-
return
|
|
22
|
+
export function createStoreSchema(components, resources, archetypes) {
|
|
23
|
+
return { components, resources, archetypes };
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
;
|
|
26
|
+
//# sourceMappingURL=create-store-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-store-schema.js","sourceRoot":"","sources":["../../../../src/ecs/database/database-schema/create-store-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAQX,MAAM,UAAU,iBAAiB,CAK7B,UAAc,EACd,SAAa,EACb,UAAa;IAEb,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAmC,CAAC;AAClF,CAAC;AAAA,CAAC"}
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import { FromSchemas } from "@adobe/data/schema";
|
|
2
|
-
import { Database, ToTransactionFunctions, TransactionDeclaration } from "../database.js";
|
|
3
2
|
import { ComponentSchemas } from "../../component-schemas.js";
|
|
4
3
|
import { ResourceSchemas } from "../../resource-schemas.js";
|
|
5
4
|
import { Store } from "../../store/store.js";
|
|
6
5
|
import { ArchetypeComponents } from "../../store/archetype-components.js";
|
|
7
6
|
import { StringKeyof } from "../../../types/types.js";
|
|
8
|
-
export type
|
|
7
|
+
export type StoreSchema<CS extends ComponentSchemas, RS extends ResourceSchemas, A extends ArchetypeComponents<StringKeyof<CS>>> = {
|
|
9
8
|
readonly components: CS;
|
|
10
9
|
readonly resources: RS;
|
|
11
10
|
readonly archetypes: A;
|
|
12
|
-
readonly transactions: (store: Store<FromSchemas<CS>, FromSchemas<RS>, A>) => TD;
|
|
13
11
|
};
|
|
14
|
-
export type
|
|
15
|
-
export type StoreFromSchema<T> = T extends DatabaseSchema<infer CS, infer RS, infer A, infer TD> ? Store<FromSchemas<CS>, FromSchemas<RS>, A> : never;
|
|
12
|
+
export type StoreFromSchema<T> = T extends StoreSchema<infer CS, infer RS, infer A> ? Store<FromSchemas<CS>, FromSchemas<RS>, A> : never;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export * from "./
|
|
1
|
+
export { createStoreSchema } from "./create-store-schema.js";
|
|
2
|
+
export * from "./store-schema.js";
|
|
@@ -19,6 +19,6 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.*/
|
|
22
|
-
export {
|
|
23
|
-
export * from "./
|
|
22
|
+
export { createStoreSchema } from "./create-store-schema.js";
|
|
23
|
+
export * from "./store-schema.js";
|
|
24
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ecs/database/database-schema/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAEX,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ecs/database/database-schema/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAEX,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FromSchemas } from "@adobe/data/schema";
|
|
2
|
+
import { ComponentSchemas } from "../../component-schemas.js";
|
|
3
|
+
import { ResourceSchemas } from "../../resource-schemas.js";
|
|
4
|
+
import { Store } from "../../store/store.js";
|
|
5
|
+
import { ArchetypeComponents } from "../../store/archetype-components.js";
|
|
6
|
+
import { StringKeyof } from "../../../types/types.js";
|
|
7
|
+
export type StoreSchema<CS extends ComponentSchemas, RS extends ResourceSchemas, A extends ArchetypeComponents<StringKeyof<CS>>> = {
|
|
8
|
+
readonly components: CS;
|
|
9
|
+
readonly resources: RS;
|
|
10
|
+
readonly archetypes: A;
|
|
11
|
+
};
|
|
12
|
+
export type StoreFromSchema<T> = T extends StoreSchema<infer CS, infer RS, infer A> ? Store<FromSchemas<CS>, FromSchemas<RS>, A> : never;
|
|
@@ -20,4 +20,4 @@ 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
|
export {};
|
|
23
|
-
//# sourceMappingURL=
|
|
23
|
+
//# sourceMappingURL=store-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store-schema.js","sourceRoot":"","sources":["../../../../src/ecs/database/database-schema/store-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW"}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { Archetype, ArchetypeId, ReadonlyArchetype } from "../archetype/index.js";
|
|
2
2
|
import { ResourceComponents } from "../store/resource-components.js";
|
|
3
|
-
import { ReadonlyStore } from "../store/index.js";
|
|
3
|
+
import { ReadonlyStore, Store } from "../store/index.js";
|
|
4
4
|
import { Entity } from "../entity.js";
|
|
5
5
|
import { EntityReadValues } from "../store/core/index.js";
|
|
6
6
|
import { Observe } from "../../observe/index.js";
|
|
7
|
-
import {
|
|
7
|
+
import { TransactionResult } from "./transactional-store/index.js";
|
|
8
8
|
import { 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 { CoreComponents } from "../core-components.js";
|
|
12
12
|
import { EntitySelectOptions } from "../store/entity-select-options.js";
|
|
13
|
-
export type TransactionDeclaration<C extends Components, R extends ResourceComponents, A extends ArchetypeComponents<StringKeyof<C>>, Input extends any | void = any> = (t:
|
|
13
|
+
export type TransactionDeclaration<C extends Components, R extends ResourceComponents, A extends ArchetypeComponents<StringKeyof<C>>, Input extends any | void = any> = (t: Store<C, R, A>, input: Input) => void | Entity;
|
|
14
14
|
export type TransactionDeclarations = object;
|
|
15
15
|
export type AsyncArgsProvider<T> = () => Promise<T> | AsyncGenerator<T>;
|
|
16
16
|
/**
|
|
17
17
|
* Converts from TransactionDeclarations to TransactionFunctions by removing the initial store argument.
|
|
18
18
|
*/
|
|
19
19
|
export type ToTransactionFunctions<T> = {
|
|
20
|
-
[K in keyof T]: T[K] extends (
|
|
20
|
+
[K in keyof T]: T[K] extends (t: infer S) => infer R ? R extends void | Entity ? () => R : never : T[K] extends (t: infer S, input: infer Input) => infer R ? R extends void | Entity ? (arg: Input | AsyncArgsProvider<Input>) => R : never : never;
|
|
21
21
|
};
|
|
22
22
|
export type TransactionFunctions = {
|
|
23
23
|
readonly [K: string]: (args?: any) => void | Entity;
|
|
@@ -22,6 +22,5 @@ SOFTWARE.*/
|
|
|
22
22
|
export * from "./create-database.js";
|
|
23
23
|
export * from "./database.js";
|
|
24
24
|
export * from "./observe-dependent-value.js";
|
|
25
|
-
export * from "./database-schema/index.js";
|
|
26
25
|
export * from "./transactional-store/index.js";
|
|
27
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ecs/database/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAEX,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ecs/database/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAEX,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC"}
|
package/dist/{cache/functions/omit.js → ecs/database/store-schema/create-store-schema-test.js}
RENAMED
|
@@ -19,11 +19,18 @@ 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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
22
|
+
import { TrueSchema } from "../../../schema/true.js";
|
|
23
|
+
import { createStoreSchema } from "./create-store-schema.js";
|
|
24
|
+
// just a compile time test which is why we're using -test.ts extension instead of .test.ts
|
|
25
|
+
createStoreSchema({
|
|
26
|
+
velocity: { type: "number" },
|
|
27
|
+
particle: TrueSchema,
|
|
28
|
+
}, {
|
|
29
|
+
mousePosition: { type: "number", default: 0 },
|
|
30
|
+
fooPosition: { type: "number", default: 0 },
|
|
31
|
+
}, {
|
|
32
|
+
bar: ["particle", "velocity"],
|
|
33
|
+
// @ts-expect-error
|
|
34
|
+
foo: ["particle", "velocity2"] // should throw error because velocity2 is not a component
|
|
35
|
+
});
|
|
36
|
+
//# sourceMappingURL=create-store-schema-test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-store-schema-test.js","sourceRoot":"","sources":["../../../../src/ecs/database/store-schema/create-store-schema-test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAEX,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,2FAA2F;AAE3F,iBAAiB,CACb;IACI,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC5B,QAAQ,EAAE,UAAU;CACvB,EACD;IACI,aAAa,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EAAE;IAC7C,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EAAE;CAC9C,EACD;IACI,GAAG,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;IAC7B,mBAAmB;IACnB,GAAG,EAAE,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC,0DAA0D;CAC5F,CACJ,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { StringKeyof } from "../../../types/types.js";
|
|
2
|
+
import { ComponentSchemas } from "../../component-schemas.js";
|
|
3
|
+
import { ResourceSchemas } from "../../resource-schemas.js";
|
|
4
|
+
import { ArchetypeComponents } from "../../store/archetype-components.js";
|
|
5
|
+
export declare function createStoreSchema<const CS extends ComponentSchemas, const RS extends ResourceSchemas, const A extends ArchetypeComponents<StringKeyof<CS>>>(components: CS, resources: RS, archetypes: A): {
|
|
6
|
+
components: CS;
|
|
7
|
+
resources: RS;
|
|
8
|
+
archetypes: A;
|
|
9
|
+
};
|
|
@@ -19,7 +19,8 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.*/
|
|
22
|
-
export
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
export function createStoreSchema(components, resources, archetypes) {
|
|
23
|
+
return { components, resources, archetypes };
|
|
24
|
+
}
|
|
25
|
+
;
|
|
26
|
+
//# sourceMappingURL=create-store-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-store-schema.js","sourceRoot":"","sources":["../../../../src/ecs/database/store-schema/create-store-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAQX,MAAM,UAAU,iBAAiB,CAK7B,UAAc,EACd,SAAa,EACb,UAAa;IAEb,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAmC,CAAC;AAClF,CAAC;AAAA,CAAC"}
|
|
@@ -19,5 +19,6 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.*/
|
|
22
|
-
export
|
|
22
|
+
export { createStoreSchema } from "./create-store-schema.js";
|
|
23
|
+
export * from "./store-schema.js";
|
|
23
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ecs/database/store-schema/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAEX,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FromSchemas } from "@adobe/data/schema";
|
|
2
|
+
import { ComponentSchemas } from "../../component-schemas.js";
|
|
3
|
+
import { ResourceSchemas } from "../../resource-schemas.js";
|
|
4
|
+
import { Store } from "../../store/store.js";
|
|
5
|
+
import { ArchetypeComponents } from "../../store/archetype-components.js";
|
|
6
|
+
import { StringKeyof } from "../../../types/types.js";
|
|
7
|
+
export type StoreSchema<CS extends ComponentSchemas, RS extends ResourceSchemas, A extends ArchetypeComponents<StringKeyof<CS>>> = {
|
|
8
|
+
readonly components: CS;
|
|
9
|
+
readonly resources: RS;
|
|
10
|
+
readonly archetypes: A;
|
|
11
|
+
};
|
|
12
|
+
export type StoreFromSchema<T> = T extends StoreSchema<infer CS, infer RS, infer A> ? Store<FromSchemas<CS>, FromSchemas<RS>, A> : never;
|
|
@@ -20,4 +20,4 @@ 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
|
export {};
|
|
23
|
-
//# sourceMappingURL=
|
|
23
|
+
//# sourceMappingURL=store-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store-schema.js","sourceRoot":"","sources":["../../../../src/ecs/database/store-schema/store-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Store } from "../../store/index.js";
|
|
2
|
-
import {
|
|
3
|
-
export declare const applyOperations: (store:
|
|
2
|
+
import { TransactionWriteOperation } from "./transactional-store.js";
|
|
3
|
+
export declare const applyOperations: (store: Store<any, any, any>, operations: TransactionWriteOperation<any>[]) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply-operations.js","sourceRoot":"","sources":["../../../../src/ecs/database/transactional-store/apply-operations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"apply-operations.js","sourceRoot":"","sources":["../../../../src/ecs/database/transactional-store/apply-operations.ts"],"names":[],"mappings":"AAIA,yDAAyD;AACzD,MAAM,CAAC,MAAM,eAAe,GAAG,CAC3B,KAA2B,EAC3B,UAA4C,EAC9C,EAAE;IACA,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACjC,QAAQ,SAAS,CAAC,IAAI,EAAE,CAAC;YACrB,KAAK,QAAQ,CAAC,CAAC,CAAC;gBACZ,MAAM,cAAc,GAAG,CAAC,IAAI,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAuB,CAAC;gBACtF,MAAM,SAAS,GAAG,KAAK,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC;gBACxD,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,MAAa,CAAC,CAAC;gBAC1C,MAAM;YACV,CAAC;YACD,KAAK,QAAQ;gBACT,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;gBACjD,MAAM;YACV,KAAK,QAAQ;gBACT,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;gBAC/B,MAAM;QACd,CAAC;IACL,CAAC;AACL,CAAC,CAAA"}
|
|
@@ -3,5 +3,4 @@ import { ArchetypeComponents } from "../../store/archetype-components.js";
|
|
|
3
3
|
import { Components } from "../../store/components.js";
|
|
4
4
|
import { ResourceComponents } from "../../store/resource-components.js";
|
|
5
5
|
import { Store } from "../../store/store.js";
|
|
6
|
-
import { Transaction } from "./transactional-store.js";
|
|
7
6
|
export declare const createTestTransaction: <C extends Components = never, R extends ResourceComponents = never, A extends ArchetypeComponents<StringKeyof<C>> = never>(store: Store<C, R, A>) => Transaction<C, R, A>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-test-transaction.js","sourceRoot":"","sources":["../../../../src/ecs/database/transactional-store/create-test-transaction.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create-test-transaction.js","sourceRoot":"","sources":["../../../../src/ecs/database/transactional-store/create-test-transaction.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAInC,KAAqB,EAAwB,EAAE;IAC7C,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE;QACxB,SAAS,EAAE,KAAK;QAChB,QAAQ,EAAE,IAAI;KACjB,CAAC,CAAC;AACP,CAAC,CAAA"}
|
|
@@ -121,13 +121,12 @@ export function createTransactionalStore(store) {
|
|
|
121
121
|
},
|
|
122
122
|
update: updateEntity,
|
|
123
123
|
delete: deleteEntity,
|
|
124
|
-
transient: false,
|
|
125
|
-
undoable:
|
|
124
|
+
// transient: false as boolean,
|
|
125
|
+
undoable: undefined,
|
|
126
126
|
};
|
|
127
127
|
// Execute transaction function
|
|
128
128
|
const execute = (transactionFunction, options) => {
|
|
129
|
-
transactionStore.
|
|
130
|
-
transactionStore.undoable = null;
|
|
129
|
+
transactionStore.undoable = undefined;
|
|
131
130
|
// Reset transaction state
|
|
132
131
|
undoOperationsInReverseOrder = [];
|
|
133
132
|
redoOperations = [];
|
|
@@ -140,8 +139,8 @@ export function createTransactionalStore(store) {
|
|
|
140
139
|
// Return the transaction result
|
|
141
140
|
const result = {
|
|
142
141
|
value: value ?? undefined,
|
|
143
|
-
transient:
|
|
144
|
-
undoable: transactionStore.undoable,
|
|
142
|
+
transient: options?.transient ?? false,
|
|
143
|
+
undoable: transactionStore.undoable ?? null,
|
|
145
144
|
redo: [...redoOperations],
|
|
146
145
|
undo: [...undoOperationsInReverseOrder.reverse()],
|
|
147
146
|
changedEntities: new Map(changed.entities),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-transactional-store.js","sourceRoot":"","sources":["../../../../src/ecs/database/transactional-store/create-transactional-store.ts"],"names":[],"mappings":"AA8BA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAG7D,gEAAgE;AAChE,MAAM,MAAM,GAAY,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"create-transactional-store.js","sourceRoot":"","sources":["../../../../src/ecs/database/transactional-store/create-transactional-store.ts"],"names":[],"mappings":"AA8BA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAG7D,gEAAgE;AAChE,MAAM,MAAM,GAAY,cAAc,CAAC;AAUvC,MAAM,UAAU,wBAAwB,CAKpC,KAAqB;IAGrB,2DAA2D;IAC3D,IAAI,4BAA4B,GAAmC,EAAE,CAAC;IACtE,IAAI,cAAc,GAAmC,EAAE,CAAC;IACxD,MAAM,OAAO,GAAG;QACZ,QAAQ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AAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;QACxD,4BAA4B,CAAC,IAAI,CAAC;YAC9B,IAAI,EAAE,QAAQ;YACd,MAAM;YACN,MAAM,EAAE,cAAc;SACzB,CAAC,CAAC;IACP,CAAC;AACL,CAAC;AAED,yDAAyD;AACzD,SAAS,oBAAoB,CACzB,KAAqB,EACrB,UAA0C;IAE1C,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACjC,QAAQ,SAAS,CAAC,IAAI,EAAE,CAAC;YACrB,KAAK,QAAQ,CAAC,CAAC,CAAC;gBACZ,MAAM,cAAc,GAAG,CAAC,IAAI,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAqB,CAAC;gBACpF,MAAM,SAAS,GAAG,KAAK,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC;gBACxD,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,MAAa,CAAC,CAAC;gBAC1C,MAAM;YACV,CAAC;YACD,KAAK,QAAQ;gBACT,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;gBACjD,MAAM;YACV,KAAK,QAAQ;gBACT,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;gBAC/B,MAAM;QACd,CAAC;IACL,CAAC;AACL,CAAC"}
|
|
@@ -20,5 +20,4 @@ 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
|
export * from "./transactional-store.js";
|
|
23
|
-
export * from "./create-test-transaction.js";
|
|
24
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ecs/database/transactional-store/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAEX,cAAc,0BAA0B,CAAC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ecs/database/transactional-store/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAEX,cAAc,0BAA0B,CAAC"}
|
|
@@ -7,11 +7,6 @@ import { Components } from "../../store/components.js";
|
|
|
7
7
|
import { StringKeyof } from "../../../types/types.js";
|
|
8
8
|
import { ArchetypeComponents } from "../../store/archetype-components.js";
|
|
9
9
|
import { Undoable } from "../undoable.js";
|
|
10
|
-
export interface Transaction<C extends Components = never, R extends ResourceComponents = never, A extends ArchetypeComponents<StringKeyof<C>> = never> extends Store<C, R, A> {
|
|
11
|
-
readonly transient: boolean;
|
|
12
|
-
undoable: null | Undoable;
|
|
13
|
-
}
|
|
14
|
-
export type TransactionFromStore<S extends Store<any, any, any>> = S extends Store<infer C, infer R, infer A> ? Transaction<C, R, A> : never;
|
|
15
10
|
export interface TransactionalStore<C extends Components = never, R extends ResourceComponents = never, A extends ArchetypeComponents<StringKeyof<C>> = never> extends ReadonlyStore<C, R, A> {
|
|
16
11
|
/**
|
|
17
12
|
* Execute a transaction on the store.
|
|
@@ -20,7 +15,7 @@ export interface TransactionalStore<C extends Components = never, R extends Reso
|
|
|
20
15
|
* @param transactionFunction - A function that takes the store as an argument and performs some operations on it.
|
|
21
16
|
* @returns A promise that resolves when the transaction is complete.
|
|
22
17
|
*/
|
|
23
|
-
execute(transactionFunction: (t:
|
|
18
|
+
execute(transactionFunction: (t: Store<C, R, A>) => Entity | void, options?: {
|
|
24
19
|
transient?: boolean;
|
|
25
20
|
}): TransactionResult<C>;
|
|
26
21
|
transactionStore: Store<C, R, A>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-store.js","sourceRoot":"","sources":["../../../src/ecs/store/create-store.ts"],"names":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AAC"}
|
package/dist/ecs/store/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ecs/store/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AACX,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ecs/store/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AACX,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC"}
|
|
@@ -19,15 +19,18 @@ 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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
22
|
+
import { TrueSchema } from "../../../schema/true.js";
|
|
23
|
+
import { createStoreSchema } from "./create-store-schema.js";
|
|
24
|
+
// just a compile time test which is why we're using -test.ts extension instead of .test.ts
|
|
25
|
+
createStoreSchema({
|
|
26
|
+
velocity: { type: "number" },
|
|
27
|
+
particle: TrueSchema,
|
|
28
|
+
}, {
|
|
29
|
+
mousePosition: { type: "number", default: 0 },
|
|
30
|
+
fooPosition: { type: "number", default: 0 },
|
|
31
|
+
}, {
|
|
32
|
+
bar: ["particle", "velocity"],
|
|
33
|
+
// @ts-expect-error
|
|
34
|
+
foo: ["particle", "velocity2"] // should throw error because velocity2 is not a component
|
|
35
|
+
});
|
|
36
|
+
//# sourceMappingURL=create-store-schema-test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-store-schema-test.js","sourceRoot":"","sources":["../../../../src/ecs/store/store-schema/create-store-schema-test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAEX,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,2FAA2F;AAE3F,iBAAiB,CACb;IACI,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC5B,QAAQ,EAAE,UAAU;CACvB,EACD;IACI,aAAa,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EAAE;IAC7C,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EAAE;CAC9C,EACD;IACI,GAAG,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;IAC7B,mBAAmB;IACnB,GAAG,EAAE,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC,0DAA0D;CAC5F,CACJ,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { StringKeyof } from "../../../types/types.js";
|
|
2
|
+
import { ComponentSchemas } from "../../component-schemas.js";
|
|
3
|
+
import { ResourceSchemas } from "../../resource-schemas.js";
|
|
4
|
+
import { ArchetypeComponents } from "../archetype-components.js";
|
|
5
|
+
export declare function createStoreSchema<const CS extends ComponentSchemas, const RS extends ResourceSchemas, const A extends ArchetypeComponents<StringKeyof<CS>>>(components: CS, resources: RS, archetypes: A): {
|
|
6
|
+
readonly components: CS;
|
|
7
|
+
readonly resources: RS;
|
|
8
|
+
readonly archetypes: A;
|
|
9
|
+
};
|