@oasys/oecs 0.5.3 → 0.6.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/CHANGELOG.md +1399 -276
- package/README.md +327 -169
- package/dist/core/ecs/access_check.d.cts +31 -31
- package/dist/core/ecs/access_check.d.ts +31 -31
- package/dist/core/ecs/access_check.d.ts.map +1 -1
- package/dist/core/ecs/archetype.d.cts +273 -205
- package/dist/core/ecs/archetype.d.ts +273 -205
- package/dist/core/ecs/archetype.d.ts.map +1 -1
- package/dist/core/ecs/archetype_closure.d.cts +23 -0
- package/dist/core/ecs/archetype_closure.d.ts +23 -0
- package/dist/core/ecs/archetype_closure.d.ts.map +1 -0
- package/dist/core/ecs/archetype_graph.d.cts +34 -34
- package/dist/core/ecs/archetype_graph.d.ts +34 -34
- package/dist/core/ecs/archetype_graph.d.ts.map +1 -1
- package/dist/core/ecs/archetype_types.d.cts +55 -0
- package/dist/core/ecs/archetype_types.d.ts +55 -0
- package/dist/core/ecs/archetype_types.d.ts.map +1 -0
- package/dist/core/ecs/change_feed.d.cts +53 -0
- package/dist/core/ecs/change_feed.d.ts +53 -0
- package/dist/core/ecs/change_feed.d.ts.map +1 -0
- package/dist/core/ecs/changed_query.d.cts +36 -0
- package/dist/core/ecs/changed_query.d.ts +36 -0
- package/dist/core/ecs/changed_query.d.ts.map +1 -0
- package/dist/core/ecs/chunk_columns.d.cts +49 -0
- package/dist/core/ecs/chunk_columns.d.ts +49 -0
- package/dist/core/ecs/chunk_columns.d.ts.map +1 -0
- package/dist/core/ecs/command_log.d.cts +30 -30
- package/dist/core/ecs/command_log.d.ts +30 -30
- package/dist/core/ecs/command_log.d.ts.map +1 -1
- package/dist/core/ecs/component.d.cts +45 -44
- package/dist/core/ecs/component.d.ts +45 -44
- package/dist/core/ecs/component.d.ts.map +1 -1
- package/dist/core/ecs/component_registry.d.cts +53 -0
- package/dist/core/ecs/component_registry.d.ts +53 -0
- package/dist/core/ecs/component_registry.d.ts.map +1 -0
- package/dist/core/ecs/compute_backend.d.cts +18 -7
- package/dist/core/ecs/compute_backend.d.ts +18 -7
- package/dist/core/ecs/compute_backend.d.ts.map +1 -1
- package/dist/core/ecs/deferred_commands.d.cts +15 -14
- package/dist/core/ecs/deferred_commands.d.ts +15 -14
- package/dist/core/ecs/deferred_commands.d.ts.map +1 -1
- package/dist/core/ecs/dispatch_trace.d.cts +32 -31
- package/dist/core/ecs/dispatch_trace.d.ts +32 -31
- package/dist/core/ecs/dispatch_trace.d.ts.map +1 -1
- package/dist/core/ecs/ecs.d.cts +337 -276
- package/dist/core/ecs/ecs.d.ts +337 -276
- package/dist/core/ecs/ecs.d.ts.map +1 -1
- package/dist/core/ecs/ecs_memory.d.cts +134 -136
- package/dist/core/ecs/ecs_memory.d.ts +134 -136
- package/dist/core/ecs/ecs_memory.d.ts.map +1 -1
- package/dist/core/ecs/ecs_options.d.cts +89 -0
- package/dist/core/ecs/ecs_options.d.ts +89 -0
- package/dist/core/ecs/ecs_options.d.ts.map +1 -0
- package/dist/core/ecs/entity.d.cts +4 -4
- package/dist/core/ecs/entity.d.ts +4 -4
- package/dist/core/ecs/entity_allocator.d.cts +24 -22
- package/dist/core/ecs/entity_allocator.d.ts +24 -22
- package/dist/core/ecs/entity_allocator.d.ts.map +1 -1
- package/dist/core/ecs/event.d.cts +37 -23
- package/dist/core/ecs/event.d.ts +37 -23
- package/dist/core/ecs/event.d.ts.map +1 -1
- package/dist/core/ecs/facades.d.cts +12 -126
- package/dist/core/ecs/facades.d.ts +12 -126
- package/dist/core/ecs/facades.d.ts.map +1 -1
- package/dist/core/ecs/frame_stepper.d.cts +12 -12
- package/dist/core/ecs/frame_stepper.d.ts +12 -12
- package/dist/core/ecs/frame_stepper.d.ts.map +1 -1
- package/dist/core/ecs/frame_trace.d.cts +34 -34
- package/dist/core/ecs/frame_trace.d.ts +34 -34
- package/dist/core/ecs/frame_trace.d.ts.map +1 -1
- package/dist/core/ecs/host_commands.d.cts +107 -89
- package/dist/core/ecs/host_commands.d.ts +107 -89
- package/dist/core/ecs/host_commands.d.ts.map +1 -1
- package/dist/core/ecs/index.d.cts +22 -12
- package/dist/core/ecs/index.d.ts +22 -12
- package/dist/core/ecs/index.d.ts.map +1 -1
- package/dist/core/ecs/observer.d.cts +41 -122
- package/dist/core/ecs/observer.d.ts +41 -122
- package/dist/core/ecs/observer.d.ts.map +1 -1
- package/dist/core/ecs/phase.d.cts +79 -0
- package/dist/core/ecs/phase.d.ts +79 -0
- package/dist/core/ecs/phase.d.ts.map +1 -0
- package/dist/core/ecs/plugin.d.cts +125 -0
- package/dist/core/ecs/plugin.d.ts +125 -0
- package/dist/core/ecs/plugin.d.ts.map +1 -0
- package/dist/core/ecs/plugin_slots.d.cts +26 -0
- package/dist/core/ecs/plugin_slots.d.ts +26 -0
- package/dist/core/ecs/plugin_slots.d.ts.map +1 -0
- package/dist/core/ecs/query.d.cts +219 -568
- package/dist/core/ecs/query.d.ts +219 -568
- package/dist/core/ecs/query.d.ts.map +1 -1
- package/dist/core/ecs/query_cache.d.cts +130 -0
- package/dist/core/ecs/query_cache.d.ts +130 -0
- package/dist/core/ecs/query_cache.d.ts.map +1 -0
- package/dist/core/ecs/query_registry.d.cts +47 -0
- package/dist/core/ecs/query_registry.d.ts +47 -0
- package/dist/core/ecs/query_registry.d.ts.map +1 -0
- package/dist/core/ecs/query_terms.d.cts +126 -0
- package/dist/core/ecs/query_terms.d.ts +126 -0
- package/dist/core/ecs/query_terms.d.ts.map +1 -0
- package/dist/core/ecs/ref.d.cts +129 -16
- package/dist/core/ecs/ref.d.ts +129 -16
- package/dist/core/ecs/ref.d.ts.map +1 -1
- package/dist/core/ecs/relation.d.cts +105 -186
- package/dist/core/ecs/relation.d.ts +105 -186
- package/dist/core/ecs/relation.d.ts.map +1 -1
- package/dist/core/ecs/resource.d.cts +14 -14
- package/dist/core/ecs/resource.d.ts +14 -14
- package/dist/core/ecs/resource_registry.d.cts +6 -6
- package/dist/core/ecs/resource_registry.d.ts +6 -6
- package/dist/core/ecs/resource_registry.d.ts.map +1 -1
- package/dist/core/ecs/row_kinds.d.cts +24 -0
- package/dist/core/ecs/row_kinds.d.ts +24 -0
- package/dist/core/ecs/row_kinds.d.ts.map +1 -0
- package/dist/core/ecs/run_condition.d.cts +23 -23
- package/dist/core/ecs/run_condition.d.ts +23 -23
- package/dist/core/ecs/run_condition.d.ts.map +1 -1
- package/dist/core/ecs/schedule.d.cts +98 -114
- package/dist/core/ecs/schedule.d.ts +98 -114
- package/dist/core/ecs/schedule.d.ts.map +1 -1
- package/dist/core/ecs/schedule_plan.d.cts +33 -0
- package/dist/core/ecs/schedule_plan.d.ts +33 -0
- package/dist/core/ecs/schedule_plan.d.ts.map +1 -0
- package/dist/core/ecs/snapshot.d.cts +77 -0
- package/dist/core/ecs/snapshot.d.ts +77 -0
- package/dist/core/ecs/snapshot.d.ts.map +1 -0
- package/dist/core/ecs/snapshot_mount.d.cts +42 -0
- package/dist/core/ecs/snapshot_mount.d.ts +42 -0
- package/dist/core/ecs/snapshot_mount.d.ts.map +1 -0
- package/dist/core/ecs/sparse_store.d.cts +110 -53
- package/dist/core/ecs/sparse_store.d.ts +110 -53
- package/dist/core/ecs/sparse_store.d.ts.map +1 -1
- package/dist/core/ecs/store.d.cts +644 -511
- package/dist/core/ecs/store.d.ts +644 -511
- package/dist/core/ecs/store.d.ts.map +1 -1
- package/dist/core/ecs/store_layout_listener.d.cts +8 -8
- package/dist/core/ecs/store_layout_listener.d.ts +8 -8
- package/dist/core/ecs/store_types.d.cts +122 -0
- package/dist/core/ecs/store_types.d.ts +122 -0
- package/dist/core/ecs/store_types.d.ts.map +1 -0
- package/dist/core/ecs/system.d.cts +151 -66
- package/dist/core/ecs/system.d.ts +151 -66
- package/dist/core/ecs/system.d.ts.map +1 -1
- package/dist/core/ecs/system_context.d.cts +296 -0
- package/dist/core/ecs/system_context.d.ts +296 -0
- package/dist/core/ecs/system_context.d.ts.map +1 -0
- package/dist/core/ecs/system_set.d.cts +48 -0
- package/dist/core/ecs/system_set.d.ts +48 -0
- package/dist/core/ecs/system_set.d.ts.map +1 -0
- package/dist/core/ecs/utils/arrays.d.cts +15 -1
- package/dist/core/ecs/utils/arrays.d.ts +15 -1
- package/dist/core/ecs/utils/arrays.d.ts.map +1 -1
- package/dist/core/ecs/utils/error.d.cts +87 -4
- package/dist/core/ecs/utils/error.d.ts +87 -4
- package/dist/core/ecs/utils/error.d.ts.map +1 -1
- package/dist/core/ecs/utils/plugin_error.d.cts +10 -0
- package/dist/core/ecs/utils/plugin_error.d.ts +10 -0
- package/dist/core/ecs/utils/plugin_error.d.ts.map +1 -0
- package/dist/core/restore_errors.d.cts +30 -0
- package/dist/core/restore_errors.d.ts +30 -0
- package/dist/core/restore_errors.d.ts.map +1 -0
- package/dist/core/store/action_ring.d.cts +48 -49
- package/dist/core/store/action_ring.d.ts +48 -49
- package/dist/core/store/action_ring.d.ts.map +1 -1
- package/dist/core/store/allocator.d.cts +166 -114
- package/dist/core/store/allocator.d.ts +166 -114
- package/dist/core/store/allocator.d.ts.map +1 -1
- package/dist/core/store/buffer_backed_column.d.cts +21 -22
- package/dist/core/store/buffer_backed_column.d.ts +21 -22
- package/dist/core/store/buffer_backed_column.d.ts.map +1 -1
- package/dist/core/store/column_store.d.cts +138 -100
- package/dist/core/store/column_store.d.ts +138 -100
- package/dist/core/store/column_store.d.ts.map +1 -1
- package/dist/core/store/command_dispatch.d.cts +14 -15
- package/dist/core/store/command_dispatch.d.ts +14 -15
- package/dist/core/store/command_dispatch.d.ts.map +1 -1
- package/dist/core/store/command_ring.d.cts +41 -45
- package/dist/core/store/command_ring.d.ts +41 -45
- package/dist/core/store/command_ring.d.ts.map +1 -1
- package/dist/core/store/descriptor.d.cts +35 -18
- package/dist/core/store/descriptor.d.ts +35 -18
- package/dist/core/store/descriptor.d.ts.map +1 -1
- package/dist/core/store/entity_index.d.cts +34 -35
- package/dist/core/store/entity_index.d.ts +34 -35
- package/dist/core/store/entity_index.d.ts.map +1 -1
- package/dist/core/store/event_ring.d.cts +40 -42
- package/dist/core/store/event_ring.d.ts +40 -42
- package/dist/core/store/event_ring.d.ts.map +1 -1
- package/dist/core/store/extend.d.cts +15 -9
- package/dist/core/store/extend.d.ts +15 -9
- package/dist/core/store/extend.d.ts.map +1 -1
- package/dist/core/store/grow.d.cts +3 -3
- package/dist/core/store/grow.d.ts +3 -3
- package/dist/core/store/grow.d.ts.map +1 -1
- package/dist/core/store/header.d.cts +37 -33
- package/dist/core/store/header.d.ts +37 -33
- package/dist/core/store/header.d.ts.map +1 -1
- package/dist/core/store/index.d.cts +10 -10
- package/dist/core/store/index.d.ts +10 -10
- package/dist/core/store/index.d.ts.map +1 -1
- package/dist/core/store/layout_ops.d.cts +72 -63
- package/dist/core/store/layout_ops.d.ts +72 -63
- package/dist/core/store/layout_ops.d.ts.map +1 -1
- package/dist/core/store/region_table.d.cts +28 -21
- package/dist/core/store/region_table.d.ts +28 -21
- package/dist/core/store/region_table.d.ts.map +1 -1
- package/dist/core/store/snapshot.d.cts +31 -16
- package/dist/core/store/snapshot.d.ts +31 -16
- package/dist/core/store/snapshot.d.ts.map +1 -1
- package/dist/core/store/state_hash.d.cts +14 -14
- package/dist/core/store/state_hash.d.ts +14 -14
- package/dist/core/store/state_hash.d.ts.map +1 -1
- package/dist/core/store/store_regions.d.cts +10 -10
- package/dist/core/store/store_regions.d.ts +10 -10
- package/dist/core/store/store_regions.d.ts.map +1 -1
- package/dist/core/store/vendored_abi/abi.d.cts +27 -2
- package/dist/core/store/vendored_abi/abi.d.ts +27 -2
- package/dist/core/store/vendored_abi/abi.d.ts.map +1 -1
- package/dist/host_commands-B2KMx8O2.cjs +1 -0
- package/dist/host_commands-ClVPvhSa.cjs +2 -0
- package/dist/host_commands-CwxVQS1z.js +1524 -0
- package/dist/host_commands-nJvTy88E.js +1667 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +16 -11
- package/dist/index.d.ts +16 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.development.cjs +1 -1
- package/dist/index.development.js +6709 -5729
- package/dist/index.js +5664 -4743
- package/dist/internal.cjs +2 -2
- package/dist/internal.d.cts +5 -2
- package/dist/internal.d.ts +5 -2
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.development.cjs +1 -1
- package/dist/internal.development.js +70 -20
- package/dist/internal.js +138 -83
- package/dist/plugins/abi-D3V-QUSf.cjs +1 -0
- package/dist/plugins/abi-NP8pNxpd.js +42 -0
- package/dist/plugins/arrays-Dr_1hCjL.js +28 -0
- package/dist/plugins/arrays-Dt-Joc4i.cjs +1 -0
- package/dist/plugins/assertions-gtDVfbnQ.js +6 -0
- package/dist/plugins/assertions-z5GQd_bB.cjs +1 -0
- package/dist/{extensions → plugins}/editor/editor.d.cts +56 -56
- package/dist/{extensions → plugins}/editor/editor.d.ts +56 -56
- package/dist/plugins/editor/editor.d.ts.map +1 -0
- package/dist/{extensions → plugins}/editor/field_handle.d.cts +13 -13
- package/dist/{extensions → plugins}/editor/field_handle.d.ts +13 -13
- package/dist/plugins/editor/field_handle.d.ts.map +1 -0
- package/dist/plugins/editor/index.d.cts +22 -0
- package/dist/plugins/editor/index.d.ts +22 -0
- package/dist/plugins/editor/index.d.ts.map +1 -0
- package/dist/plugins/editor.cjs +1 -0
- package/dist/plugins/editor.d.cts +1 -0
- package/dist/plugins/editor.d.ts +1 -0
- package/dist/plugins/editor.development.cjs +1 -0
- package/dist/{extensions/editor/index.development.js → plugins/editor.development.js} +83 -66
- package/dist/{extensions/editor/index.js → plugins/editor.js} +83 -66
- package/dist/plugins/events/event_channel.d.cts +13 -0
- package/dist/plugins/events/event_channel.d.ts +13 -0
- package/dist/plugins/events/event_channel.d.ts.map +1 -0
- package/dist/plugins/events/event_registry.d.cts +22 -0
- package/dist/plugins/events/event_registry.d.ts +22 -0
- package/dist/plugins/events/event_registry.d.ts.map +1 -0
- package/dist/plugins/events/facade.d.cts +26 -0
- package/dist/plugins/events/facade.d.ts +26 -0
- package/dist/plugins/events/facade.d.ts.map +1 -0
- package/dist/plugins/events/index.d.cts +10 -0
- package/dist/plugins/events/index.d.ts +10 -0
- package/dist/plugins/events/index.d.ts.map +1 -0
- package/dist/plugins/events.cjs +1 -0
- package/dist/plugins/events.d.cts +1 -0
- package/dist/plugins/events.d.ts +1 -0
- package/dist/plugins/events.development.cjs +1 -0
- package/dist/plugins/events.development.js +174 -0
- package/dist/plugins/events.js +159 -0
- package/dist/plugins/observers/index.d.cts +23 -0
- package/dist/plugins/observers/index.d.ts +23 -0
- package/dist/plugins/observers/index.d.ts.map +1 -0
- package/dist/plugins/observers/observer_registry.d.cts +101 -0
- package/dist/plugins/observers/observer_registry.d.ts +101 -0
- package/dist/plugins/observers/observer_registry.d.ts.map +1 -0
- package/dist/plugins/observers.cjs +1 -0
- package/dist/plugins/observers.d.cts +1 -0
- package/dist/plugins/observers.d.ts +1 -0
- package/dist/plugins/observers.development.cjs +1 -0
- package/dist/plugins/observers.development.js +431 -0
- package/dist/plugins/observers.js +403 -0
- package/dist/plugins/relation_store-BsoegrZh.js +313 -0
- package/dist/plugins/relation_store-DQKSnxsm.cjs +1 -0
- package/dist/plugins/relation_store-RBhpcE28.cjs +1 -0
- package/dist/plugins/relation_store-RqW5Snx6.js +328 -0
- package/dist/plugins/relations/builtin_relations.d.cts +48 -0
- package/dist/plugins/relations/builtin_relations.d.ts +48 -0
- package/dist/plugins/relations/builtin_relations.d.ts.map +1 -0
- package/dist/plugins/relations/facade.d.cts +73 -0
- package/dist/plugins/relations/facade.d.ts +73 -0
- package/dist/plugins/relations/facade.d.ts.map +1 -0
- package/dist/plugins/relations/index.d.cts +11 -0
- package/dist/plugins/relations/index.d.ts +11 -0
- package/dist/plugins/relations/index.d.ts.map +1 -0
- package/dist/{core/ecs → plugins/relations}/relation_service.d.cts +93 -105
- package/dist/{core/ecs → plugins/relations}/relation_service.d.ts +93 -105
- package/dist/plugins/relations/relation_service.d.ts.map +1 -0
- package/dist/plugins/relations/relation_store.d.cts +177 -0
- package/dist/plugins/relations/relation_store.d.ts +177 -0
- package/dist/plugins/relations/relation_store.d.ts.map +1 -0
- package/dist/plugins/relations.cjs +1 -0
- package/dist/plugins/relations.d.cts +1 -0
- package/dist/plugins/relations.d.ts +1 -0
- package/dist/plugins/relations.development.cjs +1 -0
- package/dist/plugins/relations.development.js +603 -0
- package/dist/plugins/relations.js +553 -0
- package/dist/plugins/snapshots/index.d.cts +33 -0
- package/dist/plugins/snapshots/index.d.ts +33 -0
- package/dist/plugins/snapshots/index.d.ts.map +1 -0
- package/dist/plugins/snapshots/resume.d.cts +57 -0
- package/dist/plugins/snapshots/resume.d.ts +57 -0
- package/dist/plugins/snapshots/resume.d.ts.map +1 -0
- package/dist/plugins/snapshots/snapshot_service.d.cts +59 -0
- package/dist/plugins/snapshots/snapshot_service.d.ts +59 -0
- package/dist/plugins/snapshots/snapshot_service.d.ts.map +1 -0
- package/dist/plugins/snapshots.cjs +1 -0
- package/dist/plugins/snapshots.d.cts +1 -0
- package/dist/plugins/snapshots.d.ts +1 -0
- package/dist/plugins/snapshots.development.cjs +1 -0
- package/dist/plugins/snapshots.development.js +737 -0
- package/dist/plugins/snapshots.js +737 -0
- package/dist/plugins/solid/index.d.cts +8 -0
- package/dist/plugins/solid/index.d.ts +8 -0
- package/dist/plugins/solid/index.d.ts.map +1 -0
- package/dist/plugins/solid/solid.d.cts +97 -0
- package/dist/plugins/solid/solid.d.ts +97 -0
- package/dist/plugins/solid/solid.d.ts.map +1 -0
- package/dist/plugins/solid.cjs +1 -0
- package/dist/plugins/solid.d.cts +1 -0
- package/dist/plugins/solid.d.ts +1 -0
- package/dist/plugins/solid.development.cjs +1 -0
- package/dist/plugins/solid.development.js +319 -0
- package/dist/plugins/solid.js +319 -0
- package/dist/plugins/workers/index.d.cts +75 -0
- package/dist/plugins/workers/index.d.ts +75 -0
- package/dist/plugins/workers/index.d.ts.map +1 -0
- package/dist/plugins/workers/node_threads.d.cts +25 -0
- package/dist/plugins/workers/node_threads.d.ts +25 -0
- package/dist/plugins/workers/node_threads.d.ts.map +1 -0
- package/dist/plugins/workers/plan.d.cts +61 -0
- package/dist/plugins/workers/plan.d.ts +61 -0
- package/dist/plugins/workers/plan.d.ts.map +1 -0
- package/dist/plugins/workers/pool.d.cts +144 -0
- package/dist/plugins/workers/pool.d.ts +144 -0
- package/dist/plugins/workers/pool.d.ts.map +1 -0
- package/dist/plugins/workers/protocol.d.cts +112 -0
- package/dist/plugins/workers/protocol.d.ts +112 -0
- package/dist/plugins/workers/protocol.d.ts.map +1 -0
- package/dist/plugins/workers/worker_bind.d.cts +64 -0
- package/dist/plugins/workers/worker_bind.d.ts +64 -0
- package/dist/plugins/workers/worker_bind.d.ts.map +1 -0
- package/dist/plugins/workers/worker_loop.d.cts +14 -0
- package/dist/plugins/workers/worker_loop.d.ts +14 -0
- package/dist/plugins/workers/worker_loop.d.ts.map +1 -0
- package/dist/plugins/workers.cjs +1 -0
- package/dist/plugins/workers.d.cts +1 -0
- package/dist/plugins/workers.d.ts +1 -0
- package/dist/plugins/workers.development.cjs +1 -0
- package/dist/plugins/workers.development.js +596 -0
- package/dist/plugins/workers.js +474 -0
- package/dist/primitives.cjs +1 -1
- package/dist/primitives.d.cts +4 -4
- package/dist/primitives.d.ts +4 -4
- package/dist/primitives.development.cjs +1 -1
- package/dist/primitives.development.js +66 -22
- package/dist/primitives.js +66 -22
- package/dist/shared-BKl12xF1.js +132 -0
- package/dist/shared-Dk-pACZT.cjs +1 -0
- package/dist/shared.cjs +1 -1
- package/dist/shared.d.cts +7 -7
- package/dist/shared.d.ts +7 -7
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.development.cjs +1 -1
- package/dist/shared.development.js +4 -3
- package/dist/shared.js +4 -3
- package/dist/topological_sort-Cc_yXqPT.js +346 -0
- package/dist/topological_sort-vp1imU6D.cjs +1 -0
- package/dist/type_primitives/assertions.d.cts +12 -16
- package/dist/type_primitives/assertions.d.ts +12 -16
- package/dist/type_primitives/assertions.d.ts.map +1 -1
- package/dist/type_primitives/binary_heap/binary_heap.d.cts +2 -6
- package/dist/type_primitives/binary_heap/binary_heap.d.ts +2 -6
- package/dist/type_primitives/binary_heap/binary_heap.d.ts.map +1 -1
- package/dist/type_primitives/bitset/bitset.d.cts +7 -11
- package/dist/type_primitives/bitset/bitset.d.ts +7 -11
- package/dist/type_primitives/bitset/bitset.d.ts.map +1 -1
- package/dist/type_primitives/brand.d.cts +2 -7
- package/dist/type_primitives/brand.d.ts +2 -7
- package/dist/type_primitives/brand.d.ts.map +1 -1
- package/dist/type_primitives/error.d.cts +1 -2
- package/dist/type_primitives/error.d.ts +1 -2
- package/dist/type_primitives/error.d.ts.map +1 -1
- package/dist/type_primitives/index.d.cts +1 -1
- package/dist/type_primitives/index.d.ts +1 -1
- package/dist/type_primitives/sparse_map/sparse_map.d.cts +3 -7
- package/dist/type_primitives/sparse_map/sparse_map.d.ts +3 -7
- package/dist/type_primitives/sparse_map/sparse_map.d.ts.map +1 -1
- package/dist/type_primitives/sparse_set/sparse_set.d.cts +2 -6
- package/dist/type_primitives/sparse_set/sparse_set.d.ts +2 -6
- package/dist/type_primitives/sparse_set/sparse_set.d.ts.map +1 -1
- package/dist/type_primitives/topological_sort/topological_sort.d.cts +1 -5
- package/dist/type_primitives/topological_sort/topological_sort.d.ts +1 -5
- package/dist/type_primitives/topological_sort/topological_sort.d.ts.map +1 -1
- package/dist/type_primitives/typed_arrays/typed_arrays.d.cts +18 -17
- package/dist/type_primitives/typed_arrays/typed_arrays.d.ts +18 -17
- package/dist/type_primitives/typed_arrays/typed_arrays.d.ts.map +1 -1
- package/dist/utils/error.d.ts.map +1 -1
- package/dist/version.d.cts +4 -4
- package/dist/version.d.ts +4 -4
- package/dist/worker.cjs +1 -0
- package/dist/worker.d.cts +17 -0
- package/dist/worker.d.ts +17 -0
- package/dist/worker.d.ts.map +1 -0
- package/dist/worker.development.cjs +1 -0
- package/dist/worker.development.js +253 -0
- package/dist/worker.js +253 -0
- package/package.json +363 -191
- package/dist/core/ecs/builtin_relations.d.cts +0 -43
- package/dist/core/ecs/builtin_relations.d.ts +0 -43
- package/dist/core/ecs/builtin_relations.d.ts.map +0 -1
- package/dist/core/ecs/event_registry.d.cts +0 -22
- package/dist/core/ecs/event_registry.d.ts +0 -22
- package/dist/core/ecs/event_registry.d.ts.map +0 -1
- package/dist/core/ecs/relation_service.d.ts.map +0 -1
- package/dist/core/ecs/resume.d.cts +0 -85
- package/dist/core/ecs/resume.d.ts +0 -85
- package/dist/core/ecs/resume.d.ts.map +0 -1
- package/dist/core/ecs/snapshot_service.d.cts +0 -94
- package/dist/core/ecs/snapshot_service.d.ts +0 -94
- package/dist/core/ecs/snapshot_service.d.ts.map +0 -1
- package/dist/extensions/editor/editor.d.ts.map +0 -1
- package/dist/extensions/editor/field_handle.d.ts.map +0 -1
- package/dist/extensions/editor/index.cjs +0 -1
- package/dist/extensions/editor/index.d.cts +0 -21
- package/dist/extensions/editor/index.d.ts +0 -21
- package/dist/extensions/editor/index.d.ts.map +0 -1
- package/dist/extensions/editor/index.development.cjs +0 -1
- package/dist/extensions/reactive/ecs_sync.d.cts +0 -214
- package/dist/extensions/reactive/ecs_sync.d.ts +0 -214
- package/dist/extensions/reactive/ecs_sync.d.ts.map +0 -1
- package/dist/extensions/reactive/index.cjs +0 -1
- package/dist/extensions/reactive/index.d.cts +0 -23
- package/dist/extensions/reactive/index.d.ts +0 -23
- package/dist/extensions/reactive/index.d.ts.map +0 -1
- package/dist/extensions/reactive/index.development.cjs +0 -1
- package/dist/extensions/reactive/index.development.js +0 -215
- package/dist/extensions/reactive/index.js +0 -215
- package/dist/extensions/solid/index.cjs +0 -1
- package/dist/extensions/solid/index.d.cts +0 -6
- package/dist/extensions/solid/index.d.ts +0 -6
- package/dist/extensions/solid/index.d.ts.map +0 -1
- package/dist/extensions/solid/index.development.cjs +0 -1
- package/dist/extensions/solid/index.development.js +0 -40
- package/dist/extensions/solid/index.js +0 -36
- package/dist/extensions/solid/kernel_solid.d.cts +0 -45
- package/dist/extensions/solid/kernel_solid.d.ts +0 -45
- package/dist/extensions/solid/kernel_solid.d.ts.map +0 -1
- package/dist/host_commands-3jyFfWNg.js +0 -2326
- package/dist/host_commands-DNf0f6ko.cjs +0 -1
- package/dist/internal-C9jjL90H.js +0 -2485
- package/dist/internal-RZN14uMw.cjs +0 -2
- package/dist/interop-CT-REx0W.cjs +0 -1
- package/dist/interop-CcY6ASQc.js +0 -18
- package/dist/interop-DqxleBo7.js +0 -18
- package/dist/interop-T1HZ-Dpa.cjs +0 -1
- package/dist/kernel-Cz2Kxlwl.js +0 -240
- package/dist/kernel-DgyrLFjW.js +0 -227
- package/dist/kernel-sw7ScKWu.cjs +0 -1
- package/dist/kernel-yWV3XnAb.cjs +0 -1
- package/dist/reactive/array.d.cts +0 -24
- package/dist/reactive/array.d.ts +0 -24
- package/dist/reactive/array.d.ts.map +0 -1
- package/dist/reactive/index.cjs +0 -1
- package/dist/reactive/index.d.cts +0 -11
- package/dist/reactive/index.d.ts +0 -11
- package/dist/reactive/index.d.ts.map +0 -1
- package/dist/reactive/index.development.cjs +0 -1
- package/dist/reactive/index.development.js +0 -18
- package/dist/reactive/index.js +0 -18
- package/dist/reactive/interop.d.cts +0 -19
- package/dist/reactive/interop.d.ts +0 -19
- package/dist/reactive/interop.d.ts.map +0 -1
- package/dist/reactive/kernel.d.cts +0 -73
- package/dist/reactive/kernel.d.ts +0 -73
- package/dist/reactive/kernel.d.ts.map +0 -1
- package/dist/reactive/map.d.cts +0 -16
- package/dist/reactive/map.d.ts +0 -16
- package/dist/reactive/map.d.ts.map +0 -1
- package/dist/reactive/shallow.d.cts +0 -11
- package/dist/reactive/shallow.d.ts +0 -11
- package/dist/reactive/shallow.d.ts.map +0 -1
- package/dist/reactive/struct.d.cts +0 -10
- package/dist/reactive/struct.d.ts +0 -10
- package/dist/reactive/struct.d.ts.map +0 -1
- package/dist/shallow-9S1pY_Iw.js +0 -159
- package/dist/shallow-C5YmTbtb.cjs +0 -1
- package/dist/shallow-DQ8aG51_.cjs +0 -1
- package/dist/shallow-DfnAm9vG.js +0 -150
- package/dist/shared-BMXh9hxm.cjs +0 -1
- package/dist/shared-DQKK0i-E.js +0 -109
- package/dist/topological_sort-BDvEyb9W.cjs +0 -1
- package/dist/topological_sort-DK6EjpWa.js +0 -135
- package/dist/typed_arrays-BcXcnzB4.js +0 -258
- package/dist/typed_arrays-D3NmwtCG.cjs +0 -1
|
@@ -1,59 +1,61 @@
|
|
|
1
1
|
import { EntityID } from './entity.cjs';
|
|
2
2
|
export declare class EntityAllocator {
|
|
3
|
-
/** SAB-backed per-slot generation counters
|
|
3
|
+
/** SAB-backed per-slot generation counters, replanted on restore. */
|
|
4
4
|
private _generations;
|
|
5
|
-
/** Single-slot view over the entity-index region's `length` header field
|
|
6
|
-
* replanted on restore. Written on every high-water bump
|
|
5
|
+
/** Single-slot view over the entity-index region's `length` header field,
|
|
6
|
+
* replanted on restore. Written on every high-water bump. */
|
|
7
7
|
private _lengthView;
|
|
8
8
|
private _highWater;
|
|
9
9
|
private readonly _freeIndices;
|
|
10
10
|
private _aliveCount;
|
|
11
11
|
private readonly _capacity;
|
|
12
|
-
/** Slot index of the entity allocated by the most recent `alloc` call
|
|
12
|
+
/** Slot index of the entity allocated by the most recent `alloc` call,
|
|
13
13
|
* alloc-free out-param, read immediately after the call (the `_spawnIndex`
|
|
14
14
|
* pattern the pre-extraction Store used). */
|
|
15
15
|
lastIndex: number;
|
|
16
16
|
constructor(capacity: number, generations: Int32Array, lengthView: Uint32Array);
|
|
17
17
|
/** Re-point the SAB views after the backing buffer was reallocated
|
|
18
|
-
* (grow
|
|
18
|
+
* (grow, extend and restore). Does not touch host-side counters. */
|
|
19
19
|
replantViews(generations: Int32Array, lengthView: Uint32Array): void;
|
|
20
20
|
/** The live generations view. Hot flush loops hoist this to a local once
|
|
21
|
-
* per flush
|
|
21
|
+
* per flush. Do not cache it across a potential SAB replant. */
|
|
22
22
|
get generations(): Int32Array;
|
|
23
23
|
get highWater(): number;
|
|
24
24
|
get aliveCount(): number;
|
|
25
25
|
get freeCount(): number;
|
|
26
|
-
/** Allocate a slot and return its packed id
|
|
26
|
+
/** Allocate a slot and return its packed id. The slot index is left in
|
|
27
27
|
* `lastIndex`. This *commits* the slot (bumps counts, stamps the generation
|
|
28
|
-
* so `isAliveIndex` is already true)
|
|
29
|
-
* archetype row must have reserved column capacity first
|
|
28
|
+
* so `isAliveIndex` is already true), a caller placing the entity into an
|
|
29
|
+
* archetype row must have reserved column capacity first. */
|
|
30
30
|
alloc(): EntityID;
|
|
31
31
|
/** Pre-check that `count` fresh slots fit, so a bulk-spawn commits
|
|
32
|
-
* all-or-nothing
|
|
32
|
+
* all-or-nothing: `alloc`'s own per-call guard would otherwise
|
|
33
33
|
* throw partway through the loop, leaving committed slots phantom-alive.
|
|
34
|
-
* Free-list reuse covers the first `freeCount` slots
|
|
34
|
+
* Free-list reuse covers the first `freeCount` slots. Only the remainder
|
|
35
35
|
* draws down the high-water headroom. */
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* generation so stale IDs read dead
|
|
39
|
-
* reserved tombstone the slot
|
|
36
|
+
assertCapacity(count: number): void;
|
|
37
|
+
/** Release a slot whose entity carried `generation`, for reuse or for
|
|
38
|
+
* retirement. Bumps the generation so stale IDs read dead. Once the counter
|
|
39
|
+
* would reach the reserved tombstone the slot retires instead of returning
|
|
40
|
+
* to the free list: stamp
|
|
40
41
|
* RETIRED_GENERATION (never issued to a live handle) and skip the
|
|
41
42
|
* free-list push, closing the ABA window. Burning one of 2^20 indices
|
|
42
|
-
* after 2047 reuses is cheap
|
|
43
|
+
* after 2047 reuses is cheap. The branch is predicted not-taken on
|
|
43
44
|
* essentially every destroy. */
|
|
44
|
-
|
|
45
|
+
release(index: number, generation: number): void;
|
|
45
46
|
/** Allocation-side liveness: the slot is in the issued range and its
|
|
46
47
|
* current generation matches the handle's. (`Store.isAlive` layers the
|
|
47
|
-
* malformed-handle guards
|
|
48
|
+
* malformed-handle guards on top of this.) */
|
|
48
49
|
isAliveIndex(index: number, generation: number): boolean;
|
|
49
|
-
/** Mirror the current high-water into the SAB `length` header
|
|
50
|
+
/** Mirror the current high-water into the SAB `length` header, called
|
|
50
51
|
* after a buffer replant so the fresh region carries the host value. */
|
|
51
52
|
publishLength(): void;
|
|
52
53
|
snapshotFreeIndices(): number[];
|
|
53
|
-
/** Restore path
|
|
54
|
-
* region's length header
|
|
54
|
+
/** Restore path. Adopt the high-water recovered from the restored
|
|
55
|
+
* region's length header, before the replant republishes it. */
|
|
55
56
|
setHighWater(value: number): void;
|
|
56
|
-
/** Restore path
|
|
57
|
+
/** Restore path. Adopt the captured free list and alive count, after
|
|
58
|
+
* `setHighWater` has taken the high-water. */
|
|
57
59
|
restoreHostState(freeIndices: readonly number[], aliveCount: number): void;
|
|
58
60
|
}
|
|
59
61
|
//# sourceMappingURL=entity_allocator.d.ts.map
|
|
@@ -1,59 +1,61 @@
|
|
|
1
1
|
import { EntityID } from './entity.js';
|
|
2
2
|
export declare class EntityAllocator {
|
|
3
|
-
/** SAB-backed per-slot generation counters
|
|
3
|
+
/** SAB-backed per-slot generation counters, replanted on restore. */
|
|
4
4
|
private _generations;
|
|
5
|
-
/** Single-slot view over the entity-index region's `length` header field
|
|
6
|
-
* replanted on restore. Written on every high-water bump
|
|
5
|
+
/** Single-slot view over the entity-index region's `length` header field,
|
|
6
|
+
* replanted on restore. Written on every high-water bump. */
|
|
7
7
|
private _lengthView;
|
|
8
8
|
private _highWater;
|
|
9
9
|
private readonly _freeIndices;
|
|
10
10
|
private _aliveCount;
|
|
11
11
|
private readonly _capacity;
|
|
12
|
-
/** Slot index of the entity allocated by the most recent `alloc` call
|
|
12
|
+
/** Slot index of the entity allocated by the most recent `alloc` call,
|
|
13
13
|
* alloc-free out-param, read immediately after the call (the `_spawnIndex`
|
|
14
14
|
* pattern the pre-extraction Store used). */
|
|
15
15
|
lastIndex: number;
|
|
16
16
|
constructor(capacity: number, generations: Int32Array, lengthView: Uint32Array);
|
|
17
17
|
/** Re-point the SAB views after the backing buffer was reallocated
|
|
18
|
-
* (grow
|
|
18
|
+
* (grow, extend and restore). Does not touch host-side counters. */
|
|
19
19
|
replantViews(generations: Int32Array, lengthView: Uint32Array): void;
|
|
20
20
|
/** The live generations view. Hot flush loops hoist this to a local once
|
|
21
|
-
* per flush
|
|
21
|
+
* per flush. Do not cache it across a potential SAB replant. */
|
|
22
22
|
get generations(): Int32Array;
|
|
23
23
|
get highWater(): number;
|
|
24
24
|
get aliveCount(): number;
|
|
25
25
|
get freeCount(): number;
|
|
26
|
-
/** Allocate a slot and return its packed id
|
|
26
|
+
/** Allocate a slot and return its packed id. The slot index is left in
|
|
27
27
|
* `lastIndex`. This *commits* the slot (bumps counts, stamps the generation
|
|
28
|
-
* so `isAliveIndex` is already true)
|
|
29
|
-
* archetype row must have reserved column capacity first
|
|
28
|
+
* so `isAliveIndex` is already true), a caller placing the entity into an
|
|
29
|
+
* archetype row must have reserved column capacity first. */
|
|
30
30
|
alloc(): EntityID;
|
|
31
31
|
/** Pre-check that `count` fresh slots fit, so a bulk-spawn commits
|
|
32
|
-
* all-or-nothing
|
|
32
|
+
* all-or-nothing: `alloc`'s own per-call guard would otherwise
|
|
33
33
|
* throw partway through the loop, leaving committed slots phantom-alive.
|
|
34
|
-
* Free-list reuse covers the first `freeCount` slots
|
|
34
|
+
* Free-list reuse covers the first `freeCount` slots. Only the remainder
|
|
35
35
|
* draws down the high-water headroom. */
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* generation so stale IDs read dead
|
|
39
|
-
* reserved tombstone the slot
|
|
36
|
+
assertCapacity(count: number): void;
|
|
37
|
+
/** Release a slot whose entity carried `generation`, for reuse or for
|
|
38
|
+
* retirement. Bumps the generation so stale IDs read dead. Once the counter
|
|
39
|
+
* would reach the reserved tombstone the slot retires instead of returning
|
|
40
|
+
* to the free list: stamp
|
|
40
41
|
* RETIRED_GENERATION (never issued to a live handle) and skip the
|
|
41
42
|
* free-list push, closing the ABA window. Burning one of 2^20 indices
|
|
42
|
-
* after 2047 reuses is cheap
|
|
43
|
+
* after 2047 reuses is cheap. The branch is predicted not-taken on
|
|
43
44
|
* essentially every destroy. */
|
|
44
|
-
|
|
45
|
+
release(index: number, generation: number): void;
|
|
45
46
|
/** Allocation-side liveness: the slot is in the issued range and its
|
|
46
47
|
* current generation matches the handle's. (`Store.isAlive` layers the
|
|
47
|
-
* malformed-handle guards
|
|
48
|
+
* malformed-handle guards on top of this.) */
|
|
48
49
|
isAliveIndex(index: number, generation: number): boolean;
|
|
49
|
-
/** Mirror the current high-water into the SAB `length` header
|
|
50
|
+
/** Mirror the current high-water into the SAB `length` header, called
|
|
50
51
|
* after a buffer replant so the fresh region carries the host value. */
|
|
51
52
|
publishLength(): void;
|
|
52
53
|
snapshotFreeIndices(): number[];
|
|
53
|
-
/** Restore path
|
|
54
|
-
* region's length header
|
|
54
|
+
/** Restore path. Adopt the high-water recovered from the restored
|
|
55
|
+
* region's length header, before the replant republishes it. */
|
|
55
56
|
setHighWater(value: number): void;
|
|
56
|
-
/** Restore path
|
|
57
|
+
/** Restore path. Adopt the captured free list and alive count, after
|
|
58
|
+
* `setHighWater` has taken the high-water. */
|
|
57
59
|
restoreHostState(freeIndices: readonly number[], aliveCount: number): void;
|
|
58
60
|
}
|
|
59
61
|
//# sourceMappingURL=entity_allocator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity_allocator.d.ts","sourceRoot":"","sources":["../../../src/core/ecs/entity_allocator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAGH,OAAO,EAAsC,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAG7E,qBAAa,eAAe;IAC3B,
|
|
1
|
+
{"version":3,"file":"entity_allocator.d.ts","sourceRoot":"","sources":["../../../src/core/ecs/entity_allocator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAGH,OAAO,EAAsC,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAG7E,qBAAa,eAAe;IAC3B,qEAAqE;IACrE,OAAO,CAAC,YAAY,CAAa;IACjC;iEAC6D;IAC7D,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,UAAU,CAAK;IACvB,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAgB;IAC7C,OAAO,CAAC,WAAW,CAAK;IACxB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IAEnC;;iDAE6C;IACtC,SAAS,SAAK;gBAET,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW;IAM9E;wEACoE;IAC7D,YAAY,CAAC,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,GAAG,IAAI;IAK3E;oEACgE;IAChE,IAAW,WAAW,IAAI,UAAU,CAEnC;IAED,IAAW,SAAS,IAAI,MAAM,CAE7B;IAED,IAAW,UAAU,IAAI,MAAM,CAE9B;IAED,IAAW,SAAS,IAAI,MAAM,CAE7B;IAED;;;iEAG6D;IACtD,KAAK,IAAI,QAAQ;IA8BxB;;;;6CAIyC;IAClC,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAY1C;;;;;;;oCAOgC;IACzB,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI;IAWvD;;kDAE8C;IACvC,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO;IAI/D;4EACwE;IACjE,aAAa,IAAI,IAAI;IAOrB,mBAAmB,IAAI,MAAM,EAAE;IAItC;oEACgE;IACzD,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAIxC;kDAC8C;IACvC,gBAAgB,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI;CAKjF"}
|
|
@@ -2,24 +2,24 @@ import { Brand } from '../../type_primitives/index.cjs';
|
|
|
2
2
|
export type EventID = Brand<number, "event_id">;
|
|
3
3
|
export declare const asEventId: (value: number) => EventID;
|
|
4
4
|
/** Event schema: field name → value type. Every value is a number at
|
|
5
|
-
* runtime
|
|
5
|
+
* runtime. The declared type may be a branded number (e.g. `EntityID`)
|
|
6
6
|
* so the brand survives the emit → read round trip at the type layer.
|
|
7
|
-
* This is the erased
|
|
7
|
+
* This is the erased and default schema type. The public surfaces constrain
|
|
8
8
|
* on `EventShape<S>` (below) instead, so schemas may be declared as type
|
|
9
|
-
* literals
|
|
9
|
+
* literals or interfaces, an interface lacks the implicit index
|
|
10
10
|
* signature literals get (and so isn't assignable to this `Record`
|
|
11
11
|
* alias), but satisfies the homomorphic `EventShape` check. */
|
|
12
12
|
export type EventSchema = Readonly<Record<string, number>>;
|
|
13
13
|
/**
|
|
14
|
-
* Homomorphic constraint for event-schema type params
|
|
15
|
-
* `S extends EventShape<S>` checks every property of `S` is a number
|
|
14
|
+
* Homomorphic constraint for event-schema type params:
|
|
15
|
+
* `S extends EventShape<S>` checks every property of `S` is a number without
|
|
16
16
|
* requiring an index signature, so `interface`-declared schemas (which lack
|
|
17
17
|
* the implicit index signature type literals get) are accepted too.
|
|
18
18
|
*/
|
|
19
19
|
export type EventShape<S> = {
|
|
20
20
|
readonly [K in keyof S]: number;
|
|
21
21
|
};
|
|
22
|
-
/** Schema of a signal
|
|
22
|
+
/** Schema of a signal, a zero-field event. */
|
|
23
23
|
export type EmptyEventSchema = Readonly<Record<never, number>>;
|
|
24
24
|
declare const __eventSchema: unique symbol;
|
|
25
25
|
export type EventDef<S extends EventShape<S> = EventSchema> = EventID & {
|
|
@@ -29,28 +29,42 @@ export type EventDef<S extends EventShape<S> = EventSchema> = EventID & {
|
|
|
29
29
|
* Reader view over an event channel's SoA columns. Columns are read-only
|
|
30
30
|
* arrays typed per the event schema: consumers index them and read
|
|
31
31
|
* `.length`. A field declared as a branded number (e.g. `EntityID`) reads
|
|
32
|
-
* back branded
|
|
32
|
+
* back branded, no cast at the consumer.
|
|
33
33
|
*
|
|
34
34
|
* The "cannot mutate the live channel through the reader" property is
|
|
35
|
-
* **advisory
|
|
36
|
-
* mutates
|
|
37
|
-
*
|
|
35
|
+
* **advisory**, the columns are the same live `number[]` objects the channel
|
|
36
|
+
* mutates, so the `readonly` typing blocks writes at the type layer only. A
|
|
37
|
+
* deliberate cast can still write through.
|
|
38
38
|
*/
|
|
39
39
|
export type EventReader<S extends EventShape<S>> = {
|
|
40
40
|
readonly length: number;
|
|
41
41
|
} & {
|
|
42
42
|
readonly [K in keyof S]: ReadonlyArray<S[K]>;
|
|
43
43
|
};
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
/** The event registry, as everything outside the plugin sees it.
|
|
45
|
+
*
|
|
46
|
+
* `Store.events` is public, so this is the whole crossing surface. The
|
|
47
|
+
* plugin's class implements it, and the compiler holds the two in step.
|
|
48
|
+
*
|
|
49
|
+
* `SystemContext` resolves a key and emits or reads through this. `ECS.update`
|
|
50
|
+
* clears the channels at the tick tail, and a `DEV` build samples the buffered
|
|
51
|
+
* count either side of the observer drain. */
|
|
52
|
+
export interface EventHooks {
|
|
53
|
+
/** Register a channel and take its def. The key form is what a caller
|
|
54
|
+
* uses, and this is the anonymous one the key form builds on. */
|
|
55
|
+
register<S extends EventShape<S>>(fields: readonly (keyof S & string)[]): EventDef<S>;
|
|
56
|
+
/** Register a channel under a module-scope key. Throws on a repeat. */
|
|
57
|
+
registerByKey<S extends EventShape<S>>(key: symbol, fields: readonly (keyof S & string)[]): EventDef<S>;
|
|
58
|
+
/** The def a key was registered under. Throws when it was not. */
|
|
59
|
+
defByKey(key: symbol): EventDef<any>;
|
|
60
|
+
hasKey(key: symbol): boolean;
|
|
61
|
+
emit(def: EventDef<any>, values: Record<string, number>): void;
|
|
62
|
+
emitSignal(def: EventDef<EmptyEventSchema>): void;
|
|
63
|
+
reader<S extends EventShape<S>>(def: EventDef<S>): EventReader<S>;
|
|
64
|
+
/** Drop every channel emitted to this tick. Runs once per `update()`. */
|
|
53
65
|
clear(): void;
|
|
66
|
+
/** `DEV` only. Events buffered across the dirty channels right now. */
|
|
67
|
+
devBufferedCount(): number;
|
|
54
68
|
}
|
|
55
69
|
declare const __eventKeySchema: unique symbol;
|
|
56
70
|
export type EventKey<S extends EventShape<S> = EventSchema> = symbol & {
|
|
@@ -62,17 +76,17 @@ export type SignalKey = EventKey<EmptyEventSchema> & {
|
|
|
62
76
|
};
|
|
63
77
|
/**
|
|
64
78
|
* Compile-time exact-cover check for `registerEvent`'s `fields` list. The
|
|
65
|
-
* element type (`keyof S & string`) already rejects foreign fields
|
|
66
|
-
* catches the inverse mistake
|
|
79
|
+
* element type (`keyof S & string`) already rejects foreign fields. This
|
|
80
|
+
* catches the inverse mistake, an under-registered channel. Registering
|
|
67
81
|
* `eventKey<{a; b}>` with `["a"]` used to compile, but `emit` requires the
|
|
68
82
|
* full payload while the channel only has an `a` column, so `b` was silently
|
|
69
83
|
* dropped and `reader.b` (typed as an array) was `undefined` at runtime.
|
|
70
84
|
* Resolves to `unknown` (intersection no-op) when `F` covers every key, and
|
|
71
85
|
* to an impossible tuple naming the missing fields otherwise. A schema with a
|
|
72
|
-
* string index signature (erased
|
|
86
|
+
* string index signature (erased or untyped keys) skips the check. There is no
|
|
73
87
|
* finite key set to cover.
|
|
74
88
|
*/
|
|
75
|
-
export type EventFieldsCover<S extends EventShape<S>, F extends readonly (keyof S & string)[]> = string extends keyof S ? unknown : Exclude<keyof S & string, F[number]> extends never ? unknown : readonly [`ERROR
|
|
89
|
+
export type EventFieldsCover<S extends EventShape<S>, F extends readonly (keyof S & string)[]> = string extends keyof S ? unknown : Exclude<keyof S & string, F[number]> extends never ? unknown : readonly [`ERROR, missing event field: ${Exclude<keyof S & string, F[number]>}`];
|
|
76
90
|
export declare function eventKey<S extends EventShape<S>>(name: string): EventKey<S>;
|
|
77
91
|
export declare function signalKey(name: string): SignalKey;
|
|
78
92
|
export {};
|
package/dist/core/ecs/event.d.ts
CHANGED
|
@@ -2,24 +2,24 @@ import { Brand } from '../../type_primitives/index.js';
|
|
|
2
2
|
export type EventID = Brand<number, "event_id">;
|
|
3
3
|
export declare const asEventId: (value: number) => EventID;
|
|
4
4
|
/** Event schema: field name → value type. Every value is a number at
|
|
5
|
-
* runtime
|
|
5
|
+
* runtime. The declared type may be a branded number (e.g. `EntityID`)
|
|
6
6
|
* so the brand survives the emit → read round trip at the type layer.
|
|
7
|
-
* This is the erased
|
|
7
|
+
* This is the erased and default schema type. The public surfaces constrain
|
|
8
8
|
* on `EventShape<S>` (below) instead, so schemas may be declared as type
|
|
9
|
-
* literals
|
|
9
|
+
* literals or interfaces, an interface lacks the implicit index
|
|
10
10
|
* signature literals get (and so isn't assignable to this `Record`
|
|
11
11
|
* alias), but satisfies the homomorphic `EventShape` check. */
|
|
12
12
|
export type EventSchema = Readonly<Record<string, number>>;
|
|
13
13
|
/**
|
|
14
|
-
* Homomorphic constraint for event-schema type params
|
|
15
|
-
* `S extends EventShape<S>` checks every property of `S` is a number
|
|
14
|
+
* Homomorphic constraint for event-schema type params:
|
|
15
|
+
* `S extends EventShape<S>` checks every property of `S` is a number without
|
|
16
16
|
* requiring an index signature, so `interface`-declared schemas (which lack
|
|
17
17
|
* the implicit index signature type literals get) are accepted too.
|
|
18
18
|
*/
|
|
19
19
|
export type EventShape<S> = {
|
|
20
20
|
readonly [K in keyof S]: number;
|
|
21
21
|
};
|
|
22
|
-
/** Schema of a signal
|
|
22
|
+
/** Schema of a signal, a zero-field event. */
|
|
23
23
|
export type EmptyEventSchema = Readonly<Record<never, number>>;
|
|
24
24
|
declare const __eventSchema: unique symbol;
|
|
25
25
|
export type EventDef<S extends EventShape<S> = EventSchema> = EventID & {
|
|
@@ -29,28 +29,42 @@ export type EventDef<S extends EventShape<S> = EventSchema> = EventID & {
|
|
|
29
29
|
* Reader view over an event channel's SoA columns. Columns are read-only
|
|
30
30
|
* arrays typed per the event schema: consumers index them and read
|
|
31
31
|
* `.length`. A field declared as a branded number (e.g. `EntityID`) reads
|
|
32
|
-
* back branded
|
|
32
|
+
* back branded, no cast at the consumer.
|
|
33
33
|
*
|
|
34
34
|
* The "cannot mutate the live channel through the reader" property is
|
|
35
|
-
* **advisory
|
|
36
|
-
* mutates
|
|
37
|
-
*
|
|
35
|
+
* **advisory**, the columns are the same live `number[]` objects the channel
|
|
36
|
+
* mutates, so the `readonly` typing blocks writes at the type layer only. A
|
|
37
|
+
* deliberate cast can still write through.
|
|
38
38
|
*/
|
|
39
39
|
export type EventReader<S extends EventShape<S>> = {
|
|
40
40
|
readonly length: number;
|
|
41
41
|
} & {
|
|
42
42
|
readonly [K in keyof S]: ReadonlyArray<S[K]>;
|
|
43
43
|
};
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
/** The event registry, as everything outside the plugin sees it.
|
|
45
|
+
*
|
|
46
|
+
* `Store.events` is public, so this is the whole crossing surface. The
|
|
47
|
+
* plugin's class implements it, and the compiler holds the two in step.
|
|
48
|
+
*
|
|
49
|
+
* `SystemContext` resolves a key and emits or reads through this. `ECS.update`
|
|
50
|
+
* clears the channels at the tick tail, and a `DEV` build samples the buffered
|
|
51
|
+
* count either side of the observer drain. */
|
|
52
|
+
export interface EventHooks {
|
|
53
|
+
/** Register a channel and take its def. The key form is what a caller
|
|
54
|
+
* uses, and this is the anonymous one the key form builds on. */
|
|
55
|
+
register<S extends EventShape<S>>(fields: readonly (keyof S & string)[]): EventDef<S>;
|
|
56
|
+
/** Register a channel under a module-scope key. Throws on a repeat. */
|
|
57
|
+
registerByKey<S extends EventShape<S>>(key: symbol, fields: readonly (keyof S & string)[]): EventDef<S>;
|
|
58
|
+
/** The def a key was registered under. Throws when it was not. */
|
|
59
|
+
defByKey(key: symbol): EventDef<any>;
|
|
60
|
+
hasKey(key: symbol): boolean;
|
|
61
|
+
emit(def: EventDef<any>, values: Record<string, number>): void;
|
|
62
|
+
emitSignal(def: EventDef<EmptyEventSchema>): void;
|
|
63
|
+
reader<S extends EventShape<S>>(def: EventDef<S>): EventReader<S>;
|
|
64
|
+
/** Drop every channel emitted to this tick. Runs once per `update()`. */
|
|
53
65
|
clear(): void;
|
|
66
|
+
/** `DEV` only. Events buffered across the dirty channels right now. */
|
|
67
|
+
devBufferedCount(): number;
|
|
54
68
|
}
|
|
55
69
|
declare const __eventKeySchema: unique symbol;
|
|
56
70
|
export type EventKey<S extends EventShape<S> = EventSchema> = symbol & {
|
|
@@ -62,17 +76,17 @@ export type SignalKey = EventKey<EmptyEventSchema> & {
|
|
|
62
76
|
};
|
|
63
77
|
/**
|
|
64
78
|
* Compile-time exact-cover check for `registerEvent`'s `fields` list. The
|
|
65
|
-
* element type (`keyof S & string`) already rejects foreign fields
|
|
66
|
-
* catches the inverse mistake
|
|
79
|
+
* element type (`keyof S & string`) already rejects foreign fields. This
|
|
80
|
+
* catches the inverse mistake, an under-registered channel. Registering
|
|
67
81
|
* `eventKey<{a; b}>` with `["a"]` used to compile, but `emit` requires the
|
|
68
82
|
* full payload while the channel only has an `a` column, so `b` was silently
|
|
69
83
|
* dropped and `reader.b` (typed as an array) was `undefined` at runtime.
|
|
70
84
|
* Resolves to `unknown` (intersection no-op) when `F` covers every key, and
|
|
71
85
|
* to an impossible tuple naming the missing fields otherwise. A schema with a
|
|
72
|
-
* string index signature (erased
|
|
86
|
+
* string index signature (erased or untyped keys) skips the check. There is no
|
|
73
87
|
* finite key set to cover.
|
|
74
88
|
*/
|
|
75
|
-
export type EventFieldsCover<S extends EventShape<S>, F extends readonly (keyof S & string)[]> = string extends keyof S ? unknown : Exclude<keyof S & string, F[number]> extends never ? unknown : readonly [`ERROR
|
|
89
|
+
export type EventFieldsCover<S extends EventShape<S>, F extends readonly (keyof S & string)[]> = string extends keyof S ? unknown : Exclude<keyof S & string, F[number]> extends never ? unknown : readonly [`ERROR, missing event field: ${Exclude<keyof S & string, F[number]>}`];
|
|
76
90
|
export declare function eventKey<S extends EventShape<S>>(name: string): EventKey<S>;
|
|
77
91
|
export declare function signalKey(name: string): SignalKey;
|
|
78
92
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../../src/core/ecs/event.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../../src/core/ecs/event.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,110 +1,14 @@
|
|
|
1
1
|
import { Store } from './store.cjs';
|
|
2
|
-
import { EntityID } from './entity.cjs';
|
|
3
|
-
import { OnDeleteTarget, RelationDef, RelationOptions } from './relation.cjs';
|
|
4
2
|
import { ResourceKey } from './resource.cjs';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*
|
|
8
|
-
* transition; ops are immediate and safe mid-tick. Traversal and wildcard
|
|
9
|
-
* reads are cold-path. */
|
|
10
|
-
export declare class ECSRelations {
|
|
11
|
-
private readonly store;
|
|
12
|
-
/** @internal constructed by `ECS`. */
|
|
13
|
-
constructor(store: Store);
|
|
14
|
-
/** Register a relation kind. Exclusive (default) stores one target per
|
|
15
|
-
* source; `{ multi: true }` stores a target set per source.
|
|
16
|
-
* `{ onDeleteTarget: "delete" | "clear" | "orphan" }` selects target-death
|
|
17
|
-
* cleanup (default `orphan`, #473).
|
|
18
|
-
*
|
|
19
|
-
* The overloads stamp the CARDINALITY into the handle type (typestate
|
|
20
|
-
* a173382 / POLISH_AUDIT #7), exactly like the flat `registerRelation`:
|
|
21
|
-
* the exclusive-only surfaces (`targetOf`, `ancestorsOf`/`rootOf`/
|
|
22
|
-
* `cascadeOf`, `Query.hierarchy`) accept only `RelationDef<"exclusive">`,
|
|
23
|
-
* so passing a `{ multi: true }` relation is a compile error. A
|
|
24
|
-
* dynamically-built options value falls to the erased overload and keeps
|
|
25
|
-
* the runtime check as its only guard. */
|
|
26
|
-
register(opts?: {
|
|
27
|
-
readonly exclusive?: true;
|
|
28
|
-
readonly multi?: false;
|
|
29
|
-
readonly onDeleteTarget?: OnDeleteTarget;
|
|
30
|
-
}): RelationDef<"exclusive">;
|
|
31
|
-
register(opts: {
|
|
32
|
-
readonly multi: true;
|
|
33
|
-
readonly exclusive?: false;
|
|
34
|
-
readonly onDeleteTarget?: OnDeleteTarget;
|
|
35
|
-
}): RelationDef<"multi">;
|
|
36
|
-
register(opts?: RelationOptions): RelationDef;
|
|
37
|
-
/** Count of registered relations. */
|
|
38
|
-
get count(): number;
|
|
39
|
-
/** Add a `(R, tgt)` pair to `src`. Exclusive replaces the existing target;
|
|
40
|
-
* multi adds to the set. No archetype transition. */
|
|
41
|
-
add(src: EntityID, def: RelationDef, tgt: EntityID): this;
|
|
42
|
-
/** Remove a `(R, tgt)` pair from `src`. For multi, omitting `tgt` removes
|
|
43
|
-
* all of `src`'s targets. No archetype transition. */
|
|
44
|
-
remove(src: EntityID, def: RelationDef, tgt?: EntityID): this;
|
|
45
|
-
/** Whether `src` holds any pair under `R`. */
|
|
46
|
-
has(src: EntityID, def: RelationDef): boolean;
|
|
47
|
-
/** The single target of `src` under an exclusive relation, or `undefined`. */
|
|
48
|
-
targetOf(src: EntityID, def: RelationDef<"exclusive">): EntityID | undefined;
|
|
49
|
-
/** All targets of `src` under `R`, ascending by id. */
|
|
50
|
-
targetsOf(src: EntityID, def: RelationDef): EntityID[];
|
|
51
|
-
/** Sources pointing at `tgt` under `R` (the reverse index), ascending by id.
|
|
52
|
-
* `(entity, def)` order, matching `targetOf` / `targetsOf`. */
|
|
53
|
-
sourcesOf(tgt: EntityID, def: RelationDef): EntityID[];
|
|
54
|
-
/** All `(source, target)` pairs of relation `R` — the `(R, *)` wildcard
|
|
55
|
-
* (#472). Sources in canonical entity-index order. Cold path. */
|
|
56
|
-
pairsOf(def: RelationDef): readonly (readonly [EntityID, EntityID])[];
|
|
57
|
-
/** Every `(relation, source)` pointing at `tgt`, across all relation kinds —
|
|
58
|
-
* the `(*, T)` wildcard (#472). Ordered by relation id then source id. */
|
|
59
|
-
sourcesOfAny(tgt: EntityID): readonly (readonly [RelationDef, EntityID])[];
|
|
60
|
-
/** Walk relation `R` up from `src` to its chain root, returning
|
|
61
|
-
* `[src, parent, …, root]` (nearest-ancestor-first). Exclusive only. */
|
|
62
|
-
ancestorsOf(src: EntityID, def: RelationDef<"exclusive">): EntityID[];
|
|
63
|
-
/** The root of `src`'s `R`-chain (`src` itself when it has no target).
|
|
64
|
-
* Exclusive only. */
|
|
65
|
-
rootOf(src: EntityID, def: RelationDef<"exclusive">): EntityID;
|
|
66
|
-
/** Walk relation `R` down from `root` over the reverse index, returning the
|
|
67
|
-
* subtree (including `root`) breadth-first — parents before children (the
|
|
68
|
-
* `cascade` order). Exclusive only. */
|
|
69
|
-
cascadeOf(root: EntityID, def: RelationDef<"exclusive">): EntityID[];
|
|
70
|
-
/** Reclaim relation reverse-index memory: drop every reverse entry whose
|
|
71
|
-
* target has been destroyed, returning the total dropped (#491). Purely
|
|
72
|
-
* cold-path, no observable state change — call at scene/snapshot
|
|
73
|
-
* boundaries. */
|
|
74
|
-
compact(): number;
|
|
75
|
-
}
|
|
76
|
-
/** Event channels and signals. Emit during one `update()`, visible to every
|
|
77
|
-
* later system in that call, cleared before the next. System-side reads and
|
|
78
|
-
* emits go through `ctx` — this facade is the HOST-side surface. */
|
|
79
|
-
export declare class ECSEvents {
|
|
80
|
-
private readonly store;
|
|
81
|
-
/** @internal constructed by `ECS`. */
|
|
82
|
-
constructor(store: Store);
|
|
83
|
-
/** Register an event channel at world setup, before anything emits on it.
|
|
84
|
-
* `fields` must name EVERY schema key — an under-registered channel would
|
|
85
|
-
* silently drop the missing fields at emit (see `EventFieldsCover`).
|
|
86
|
-
*
|
|
87
|
-
* @example
|
|
88
|
-
* const Damaged = eventKey<{ target: EntityID; amount: number }>("Damaged");
|
|
89
|
-
* ecs.events.register(Damaged, ["target", "amount"]);
|
|
90
|
-
* ecs.events.emit(Damaged, { target: e, amount: 10 }); // or ctx.emit inside a system
|
|
91
|
-
*/
|
|
92
|
-
register<S extends EventShape<S>, const F extends readonly (keyof S & string)[]>(key: EventKey<S>, fields: F & EventFieldsCover<S, F>): void;
|
|
93
|
-
/** Register a signal (empty-payload event channel). */
|
|
94
|
-
registerSignal(key: SignalKey): void;
|
|
95
|
-
emit(key: SignalKey): void;
|
|
96
|
-
emit<S extends EventShape<S>>(key: EventKey<S>, values: NoInfer<S>): void;
|
|
97
|
-
read<S extends EventShape<S>>(key: EventKey<S>): EventReader<S>;
|
|
98
|
-
}
|
|
99
|
-
/** World resources — singleton values keyed by `ResourceKey<T>`. Runtime
|
|
100
|
-
* mutations (`set` / `remove`) are access-checked as resource writes inside
|
|
101
|
-
* a system span; `register` is a one-time world-setup op. */
|
|
3
|
+
/** World resources, singleton values keyed by `ResourceKey<T>`. Runtime
|
|
4
|
+
* mutations (`set` and `remove`) are access-checked as resource writes inside
|
|
5
|
+
* a system span. `register` is a one-time world-setup op. */
|
|
102
6
|
export declare class ECSResources {
|
|
103
|
-
private readonly
|
|
7
|
+
private readonly _store;
|
|
104
8
|
/** @internal constructed by `ECS`. */
|
|
105
9
|
constructor(store: Store);
|
|
106
|
-
/** Register a resource at world setup. Reading
|
|
107
|
-
* key throws (fail-closed)
|
|
10
|
+
/** Register a resource at world setup. Reading and writing an unregistered
|
|
11
|
+
* key throws (fail-closed), registration is the explicit "this world has
|
|
108
12
|
* this singleton" declaration, not a lazy default.
|
|
109
13
|
*
|
|
110
14
|
* @example
|
|
@@ -115,44 +19,26 @@ export declare class ECSResources {
|
|
|
115
19
|
register<T>(key: ResourceKey<T>, value: NoInfer<T>): void;
|
|
116
20
|
get<T>(key: ResourceKey<T>): T;
|
|
117
21
|
set<T>(key: ResourceKey<T>, value: NoInfer<T>): void;
|
|
118
|
-
/** Drop a resource from the world
|
|
22
|
+
/** Drop a resource from the world. Access-checked as a *write*, and it
|
|
119
23
|
* fails closed on a missing key. Afterwards the key is free to `register`
|
|
120
|
-
* again
|
|
24
|
+
* again, the present → absent → present lifecycle. */
|
|
121
25
|
remove<T>(key: ResourceKey<T>): void;
|
|
122
26
|
has<T>(key: ResourceKey<T>): boolean;
|
|
123
27
|
}
|
|
124
|
-
/** The determinism surface
|
|
28
|
+
/** The determinism surface: world snapshot and resume and the
|
|
125
29
|
* canonical state digest. Every member except `deterministic` throws
|
|
126
30
|
* `DETERMINISM_DISABLED` unless the world was constructed with
|
|
127
|
-
* `{ deterministic: true }`. All cold-path
|
|
31
|
+
* `{ deterministic: true }`. All cold-path, take captures at tick
|
|
128
32
|
* boundaries (between `update()`s). */
|
|
129
33
|
export declare class ECSSnapshots {
|
|
130
|
-
|
|
34
|
+
protected readonly _store: Store;
|
|
131
35
|
/** @internal constructed by `ECS`. */
|
|
132
36
|
constructor(store: Store);
|
|
133
37
|
/** Whether the determinism surface is enabled. */
|
|
134
38
|
get deterministic(): boolean;
|
|
135
|
-
/** FNV-1a 32 digest over every archetype's live rows in id order
|
|
39
|
+
/** FNV-1a 32 digest over every archetype's live rows in id order, the
|
|
136
40
|
* canonical "live ECS state digest". Per-call cost scales with live
|
|
137
41
|
* entity count, not SAB capacity. */
|
|
138
42
|
stateHash(): number;
|
|
139
|
-
/** Capture the full live world (dense + sparse/relations + host-side
|
|
140
|
-
* bookkeeping) to one self-contained byte buffer that `restore` can mount
|
|
141
|
-
* back onto a live, ticking world (#789). v1 does NOT capture resources,
|
|
142
|
-
* events, or change-detection baselines (ADR-0031). */
|
|
143
|
-
capture(): Uint8Array;
|
|
144
|
-
/** Mount a `capture()` buffer onto this live world and keep ticking.
|
|
145
|
-
* Fails closed on a malformed frame or registration mismatch BEFORE
|
|
146
|
-
* mutating any live state. Requires a matching archetype set + column
|
|
147
|
-
* layout (prewarm so the set is stable). */
|
|
148
|
-
restore(bytes: Uint8Array): void;
|
|
149
|
-
/** Serialize the sparse stores + relations to a self-contained buffer —
|
|
150
|
-
* the sparse half of a world snapshot, canonical entity-index order
|
|
151
|
-
* (#470). Pairs with `restoreSparse`. */
|
|
152
|
-
captureSparse(): Uint8Array;
|
|
153
|
-
/** Repopulate the sparse stores + relation indices from `captureSparse`
|
|
154
|
-
* bytes. Sparse components must already be registered in the same order;
|
|
155
|
-
* throws `SparseRestoreError` on a shape or identity mismatch. */
|
|
156
|
-
restoreSparse(bytes: Uint8Array): void;
|
|
157
43
|
}
|
|
158
44
|
//# sourceMappingURL=facades.d.ts.map
|