@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,22 +0,0 @@
|
|
|
1
|
-
import { EmptyEventSchema, EventDef, EventReader, EventShape } from './event.cjs';
|
|
2
|
-
export declare class EventRegistry {
|
|
3
|
-
private readonly channels;
|
|
4
|
-
private readonly dirtyChannels;
|
|
5
|
-
private count;
|
|
6
|
-
private readonly keyMap;
|
|
7
|
-
registerEvent<S extends EventShape<S>>(fields: readonly (keyof S & string)[]): EventDef<S>;
|
|
8
|
-
emitEvent(def: EventDef<any>, values: Record<string, number>): void;
|
|
9
|
-
emitSignal(def: EventDef<EmptyEventSchema>): void;
|
|
10
|
-
getEventReader<S extends EventShape<S>>(def: EventDef<S>): EventReader<S>;
|
|
11
|
-
clearEvents(): void;
|
|
12
|
-
/** `DEV`-only: total events currently buffered across the dirty channels.
|
|
13
|
-
* `ECS.update` samples this either side of `dispatchSet` to assert an onSet
|
|
14
|
-
* observer emitted nothing — its emissions would be wiped by the tick-tail
|
|
15
|
-
* `clearEvents` and break the empty-channel-at-boundary invariant snapshot /
|
|
16
|
-
* restore relies on (#586). Walks only the dirty list, never the hot emit path. */
|
|
17
|
-
devBufferedEventCount(): number;
|
|
18
|
-
registerEventByKey<S extends EventShape<S>>(key: symbol, fields: readonly (keyof S & string)[]): EventDef<S>;
|
|
19
|
-
getEventDefByKey(key: symbol): EventDef<any>;
|
|
20
|
-
hasEventKey(key: symbol): boolean;
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=event_registry.d.ts.map
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { EmptyEventSchema, EventDef, EventReader, EventShape } from './event.js';
|
|
2
|
-
export declare class EventRegistry {
|
|
3
|
-
private readonly channels;
|
|
4
|
-
private readonly dirtyChannels;
|
|
5
|
-
private count;
|
|
6
|
-
private readonly keyMap;
|
|
7
|
-
registerEvent<S extends EventShape<S>>(fields: readonly (keyof S & string)[]): EventDef<S>;
|
|
8
|
-
emitEvent(def: EventDef<any>, values: Record<string, number>): void;
|
|
9
|
-
emitSignal(def: EventDef<EmptyEventSchema>): void;
|
|
10
|
-
getEventReader<S extends EventShape<S>>(def: EventDef<S>): EventReader<S>;
|
|
11
|
-
clearEvents(): void;
|
|
12
|
-
/** `DEV`-only: total events currently buffered across the dirty channels.
|
|
13
|
-
* `ECS.update` samples this either side of `dispatchSet` to assert an onSet
|
|
14
|
-
* observer emitted nothing — its emissions would be wiped by the tick-tail
|
|
15
|
-
* `clearEvents` and break the empty-channel-at-boundary invariant snapshot /
|
|
16
|
-
* restore relies on (#586). Walks only the dirty list, never the hot emit path. */
|
|
17
|
-
devBufferedEventCount(): number;
|
|
18
|
-
registerEventByKey<S extends EventShape<S>>(key: symbol, fields: readonly (keyof S & string)[]): EventDef<S>;
|
|
19
|
-
getEventDefByKey(key: symbol): EventDef<any>;
|
|
20
|
-
hasEventKey(key: symbol): boolean;
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=event_registry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"event_registry.d.ts","sourceRoot":"","sources":["../../../src/core/ecs/event_registry.ts"],"names":[],"mappings":"AAAA;;;;;;;KAOK;AAGL,OAAO,EAGN,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,MAAM,SAAS,CAAC;AAGjB,qBAAa,aAAa;IAEzB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAsB;IAK/C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgB;IAC9C,OAAO,CAAC,KAAK,CAAK;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AAiB,EAAE,EAC3C,eAAe,EAAE,SAAS,SAAS,EAAE,EACrC,QAAQ,EAAE,WAAW,EACrB,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,OAAO,EACxB,EAAE,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,GAC9B,IAAI;IAmEP;;;;;;;;uEAQmE;IACnE,OAAO,CAAC,iBAAiB;CAuDzB"}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { ArchetypeViews } from '../store/index.cjs';
|
|
2
|
-
/** Magic for the combined world-snapshot frame (`"WRS0"` little-endian). Distinct
|
|
3
|
-
* from the SAB `STORE_MAGIC` so a bare dense snapshot fed to `restoreInto` is
|
|
4
|
-
* rejected with a clear error instead of being mis-parsed as a combined frame. */
|
|
5
|
-
export declare const WORLD_SNAPSHOT_MAGIC = 810766935;
|
|
6
|
-
/** Combined-frame format version. Bumped if the section framing or host-state
|
|
7
|
-
* layout changes. Independent of `SIM_ABI_VERSION` (which gates the dense bytes). */
|
|
8
|
-
export declare const ECS_SNAPSHOT_VERSION = 1;
|
|
9
|
-
/** Thrown by `Store.restoreInto` (and the helpers here) when a combined snapshot
|
|
10
|
-
* is malformed, carries the wrong magic/version, or targets a world whose
|
|
11
|
-
* archetype/component registration doesn't match the snapshot. Mirrors
|
|
12
|
-
* `StoreRestoreError` / `SparseRestoreError` so callers see one error class per
|
|
13
|
-
* restore failure mode. */
|
|
14
|
-
export declare class ECSRestoreError extends Error {
|
|
15
|
-
constructor(message: string);
|
|
16
|
-
}
|
|
17
|
-
/** Per-archetype host-side row bookkeeping the SAB doesn't carry authoritatively. */
|
|
18
|
-
export interface ArchetypeRowState {
|
|
19
|
-
readonly archetypeId: number;
|
|
20
|
-
/** Total live rows (enabled + disabled). */
|
|
21
|
-
readonly length: number;
|
|
22
|
-
/** Enabled-row partition boundary (#577): rows `[0, enabledCount)` enabled. */
|
|
23
|
-
readonly enabledCount: number;
|
|
24
|
-
}
|
|
25
|
-
/** The host-side state a snapshot captures alongside the dense + sparse bytes. */
|
|
26
|
-
export interface HostState {
|
|
27
|
-
/** World tick at snapshot time (`Store._tick`). */
|
|
28
|
-
readonly tick: number;
|
|
29
|
-
/** Entity-index high-water (count of slots ever issued). Also mirrored in the
|
|
30
|
-
* SAB region's `length` header; carried here for a cross-check on restore. */
|
|
31
|
-
readonly entityHighWater: number;
|
|
32
|
-
/** Live entity count. */
|
|
33
|
-
readonly entityAliveCount: number;
|
|
34
|
-
/** Recycle free-list in live order (LIFO: the last element is the next slot
|
|
35
|
-
* `createEntity` hands out). */
|
|
36
|
-
readonly freeIndices: readonly number[];
|
|
37
|
-
/** Per-archetype row state, one entry per SAB-backed archetype. */
|
|
38
|
-
readonly archetypeRows: readonly ArchetypeRowState[];
|
|
39
|
-
}
|
|
40
|
-
/** Serialize host-state to a self-contained little-endian byte buffer. Layout:
|
|
41
|
-
*
|
|
42
|
-
* [u32 tick][u32 highWater][u32 alive_count]
|
|
43
|
-
* [u32 freeCount][u32 free_index × freeCount]
|
|
44
|
-
* [u32 archCount][(u32 id, u32 length, u32 enabled_count) × archCount]
|
|
45
|
-
*/
|
|
46
|
-
export declare function serializeHostState(hs: HostState): Uint8Array;
|
|
47
|
-
/** Parse host-state bytes produced by `serializeHostState`. Throws
|
|
48
|
-
* `ECSRestoreError` on truncation or a trailing-byte (non-canonical) buffer. */
|
|
49
|
-
export declare function parseHostState(bytes: Uint8Array): HostState;
|
|
50
|
-
/** Assemble the combined world-snapshot frame from its three sections. Layout:
|
|
51
|
-
*
|
|
52
|
-
* [u32 magic][u32 version][u32 denseLen][u32 sparseLen][u32 hostLen]
|
|
53
|
-
* [dense][sparse][host]
|
|
54
|
-
*/
|
|
55
|
-
export declare function frameWorldSnapshot(dense: Uint8Array, sparse: Uint8Array, host: Uint8Array): Uint8Array;
|
|
56
|
-
/** The three sections of a combined frame, as zero-copy subviews over `bytes`. */
|
|
57
|
-
export interface WorldSnapshotSections {
|
|
58
|
-
readonly dense: Uint8Array;
|
|
59
|
-
readonly sparse: Uint8Array;
|
|
60
|
-
readonly host: Uint8Array;
|
|
61
|
-
}
|
|
62
|
-
/** Split a combined frame back into its sections. Validates magic, version, and
|
|
63
|
-
* an exact (no trailing bytes) frame; throws `ECSRestoreError` otherwise. */
|
|
64
|
-
export declare function unframeWorldSnapshot(bytes: Uint8Array): WorldSnapshotSections;
|
|
65
|
-
/**
|
|
66
|
-
* Fail-closed registration guard, read **directly from the snapshot's dense
|
|
67
|
-
* bytes** so it can run BEFORE the dense backing is touched. `restoreInto`
|
|
68
|
-
* builds the restored store through the live world's in-place allocator
|
|
69
|
-
* (ADR-0008), which reuses the live backing buffer — so validating a
|
|
70
|
-
* *materialised* `ColumnStore` would already have overwritten live column data
|
|
71
|
-
* (the buffer is overwritten inside `restoreColumnStore`, before any post-build
|
|
72
|
-
* check could run). Parsing the descriptors off the raw `dense` `Uint8Array`
|
|
73
|
-
* keeps the check non-mutating, so a mismatch leaves the live world untouched.
|
|
74
|
-
*
|
|
75
|
-
* Asserts: the dense section's SAB magic + ABI, that its archetype set +
|
|
76
|
-
* per-archetype `componentMask` + per-column `(componentId, fieldId, typeTag)`
|
|
77
|
-
* match the live store's exactly (so every live `Archetype.refreshViews` finds
|
|
78
|
-
* its region and no snapshot archetype is orphaned), and that the entity-index
|
|
79
|
-
* capacity matches (the region is sized once at construction). The archetype
|
|
80
|
-
* graph is rebuilt from registration code, not the snapshot (mirroring
|
|
81
|
-
* `restoreSparse`'s "registered in the same order" contract). Throws
|
|
82
|
-
* `ECSRestoreError` on any mismatch / malformed section.
|
|
83
|
-
*/
|
|
84
|
-
export declare function assertDenseLayoutMatchesLive(dense: Uint8Array, live: ReadonlyMap<number, ArchetypeViews>, liveEntityIndexCapacity: number): void;
|
|
85
|
-
//# sourceMappingURL=resume.d.ts.map
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { ArchetypeViews } from '../store/index.js';
|
|
2
|
-
/** Magic for the combined world-snapshot frame (`"WRS0"` little-endian). Distinct
|
|
3
|
-
* from the SAB `STORE_MAGIC` so a bare dense snapshot fed to `restoreInto` is
|
|
4
|
-
* rejected with a clear error instead of being mis-parsed as a combined frame. */
|
|
5
|
-
export declare const WORLD_SNAPSHOT_MAGIC = 810766935;
|
|
6
|
-
/** Combined-frame format version. Bumped if the section framing or host-state
|
|
7
|
-
* layout changes. Independent of `SIM_ABI_VERSION` (which gates the dense bytes). */
|
|
8
|
-
export declare const ECS_SNAPSHOT_VERSION = 1;
|
|
9
|
-
/** Thrown by `Store.restoreInto` (and the helpers here) when a combined snapshot
|
|
10
|
-
* is malformed, carries the wrong magic/version, or targets a world whose
|
|
11
|
-
* archetype/component registration doesn't match the snapshot. Mirrors
|
|
12
|
-
* `StoreRestoreError` / `SparseRestoreError` so callers see one error class per
|
|
13
|
-
* restore failure mode. */
|
|
14
|
-
export declare class ECSRestoreError extends Error {
|
|
15
|
-
constructor(message: string);
|
|
16
|
-
}
|
|
17
|
-
/** Per-archetype host-side row bookkeeping the SAB doesn't carry authoritatively. */
|
|
18
|
-
export interface ArchetypeRowState {
|
|
19
|
-
readonly archetypeId: number;
|
|
20
|
-
/** Total live rows (enabled + disabled). */
|
|
21
|
-
readonly length: number;
|
|
22
|
-
/** Enabled-row partition boundary (#577): rows `[0, enabledCount)` enabled. */
|
|
23
|
-
readonly enabledCount: number;
|
|
24
|
-
}
|
|
25
|
-
/** The host-side state a snapshot captures alongside the dense + sparse bytes. */
|
|
26
|
-
export interface HostState {
|
|
27
|
-
/** World tick at snapshot time (`Store._tick`). */
|
|
28
|
-
readonly tick: number;
|
|
29
|
-
/** Entity-index high-water (count of slots ever issued). Also mirrored in the
|
|
30
|
-
* SAB region's `length` header; carried here for a cross-check on restore. */
|
|
31
|
-
readonly entityHighWater: number;
|
|
32
|
-
/** Live entity count. */
|
|
33
|
-
readonly entityAliveCount: number;
|
|
34
|
-
/** Recycle free-list in live order (LIFO: the last element is the next slot
|
|
35
|
-
* `createEntity` hands out). */
|
|
36
|
-
readonly freeIndices: readonly number[];
|
|
37
|
-
/** Per-archetype row state, one entry per SAB-backed archetype. */
|
|
38
|
-
readonly archetypeRows: readonly ArchetypeRowState[];
|
|
39
|
-
}
|
|
40
|
-
/** Serialize host-state to a self-contained little-endian byte buffer. Layout:
|
|
41
|
-
*
|
|
42
|
-
* [u32 tick][u32 highWater][u32 alive_count]
|
|
43
|
-
* [u32 freeCount][u32 free_index × freeCount]
|
|
44
|
-
* [u32 archCount][(u32 id, u32 length, u32 enabled_count) × archCount]
|
|
45
|
-
*/
|
|
46
|
-
export declare function serializeHostState(hs: HostState): Uint8Array;
|
|
47
|
-
/** Parse host-state bytes produced by `serializeHostState`. Throws
|
|
48
|
-
* `ECSRestoreError` on truncation or a trailing-byte (non-canonical) buffer. */
|
|
49
|
-
export declare function parseHostState(bytes: Uint8Array): HostState;
|
|
50
|
-
/** Assemble the combined world-snapshot frame from its three sections. Layout:
|
|
51
|
-
*
|
|
52
|
-
* [u32 magic][u32 version][u32 denseLen][u32 sparseLen][u32 hostLen]
|
|
53
|
-
* [dense][sparse][host]
|
|
54
|
-
*/
|
|
55
|
-
export declare function frameWorldSnapshot(dense: Uint8Array, sparse: Uint8Array, host: Uint8Array): Uint8Array;
|
|
56
|
-
/** The three sections of a combined frame, as zero-copy subviews over `bytes`. */
|
|
57
|
-
export interface WorldSnapshotSections {
|
|
58
|
-
readonly dense: Uint8Array;
|
|
59
|
-
readonly sparse: Uint8Array;
|
|
60
|
-
readonly host: Uint8Array;
|
|
61
|
-
}
|
|
62
|
-
/** Split a combined frame back into its sections. Validates magic, version, and
|
|
63
|
-
* an exact (no trailing bytes) frame; throws `ECSRestoreError` otherwise. */
|
|
64
|
-
export declare function unframeWorldSnapshot(bytes: Uint8Array): WorldSnapshotSections;
|
|
65
|
-
/**
|
|
66
|
-
* Fail-closed registration guard, read **directly from the snapshot's dense
|
|
67
|
-
* bytes** so it can run BEFORE the dense backing is touched. `restoreInto`
|
|
68
|
-
* builds the restored store through the live world's in-place allocator
|
|
69
|
-
* (ADR-0008), which reuses the live backing buffer — so validating a
|
|
70
|
-
* *materialised* `ColumnStore` would already have overwritten live column data
|
|
71
|
-
* (the buffer is overwritten inside `restoreColumnStore`, before any post-build
|
|
72
|
-
* check could run). Parsing the descriptors off the raw `dense` `Uint8Array`
|
|
73
|
-
* keeps the check non-mutating, so a mismatch leaves the live world untouched.
|
|
74
|
-
*
|
|
75
|
-
* Asserts: the dense section's SAB magic + ABI, that its archetype set +
|
|
76
|
-
* per-archetype `componentMask` + per-column `(componentId, fieldId, typeTag)`
|
|
77
|
-
* match the live store's exactly (so every live `Archetype.refreshViews` finds
|
|
78
|
-
* its region and no snapshot archetype is orphaned), and that the entity-index
|
|
79
|
-
* capacity matches (the region is sized once at construction). The archetype
|
|
80
|
-
* graph is rebuilt from registration code, not the snapshot (mirroring
|
|
81
|
-
* `restoreSparse`'s "registered in the same order" contract). Throws
|
|
82
|
-
* `ECSRestoreError` on any mismatch / malformed section.
|
|
83
|
-
*/
|
|
84
|
-
export declare function assertDenseLayoutMatchesLive(dense: Uint8Array, live: ReadonlyMap<number, ArchetypeViews>, liveEntityIndexCapacity: number): void;
|
|
85
|
-
//# sourceMappingURL=resume.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resume.d.ts","sourceRoot":"","sources":["../../../src/core/ecs/resume.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAUN,KAAK,cAAc,EACnB,MAAM,UAAU,CAAC;AAElB;;kFAEkF;AAClF,eAAO,MAAM,oBAAoB,YAAa,CAAC;AAE/C;qFACqF;AACrF,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC;;;;2BAI2B;AAC3B,qBAAa,eAAgB,SAAQ,KAAK;gBAC7B,OAAO,EAAE,MAAM;CAI3B;AAED,qFAAqF;AACrF,MAAM,WAAW,iBAAiB;IACjC,QAAQ,CAAC,WAAW,EAAE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|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { Archetype } from './archetype.cjs';
|
|
2
|
-
import { EntityAllocator } from './entity_allocator.cjs';
|
|
3
|
-
import { SparseComponentStore } from './sparse_store.cjs';
|
|
4
|
-
import { RelationStore } from './relation.cjs';
|
|
5
|
-
import { ColumnStore, InPlaceBufferAllocator } from '../store/index.cjs';
|
|
6
|
-
import { HostState } from './resume.cjs';
|
|
7
|
-
/** What the snapshot/resume orchestration needs from `Store` — closure-
|
|
8
|
-
* injected (the `RelationServiceHost` style). Accessors re-read live fields
|
|
9
|
-
* per call (the column store and the entity-index views are replaced on
|
|
10
|
-
* restore); the three mutation members keep Store-owned state transitions on
|
|
11
|
-
* the Store side. All cold-path. */
|
|
12
|
-
export interface SnapshotHost {
|
|
13
|
-
readonly sparseStores: () => readonly SparseComponentStore[];
|
|
14
|
-
readonly relationStores: () => readonly RelationStore[];
|
|
15
|
-
/** Live SAB generations view (replanted on restore) — for rebuilding
|
|
16
|
-
* relation ids from entity indices. */
|
|
17
|
-
readonly generations: () => Int32Array;
|
|
18
|
-
readonly archetypes: () => readonly Archetype[];
|
|
19
|
-
readonly columnStore: () => ColumnStore;
|
|
20
|
-
readonly bufferAllocator: () => InPlaceBufferAllocator;
|
|
21
|
-
readonly entityIndexCapacity: () => number;
|
|
22
|
-
readonly tick: () => number;
|
|
23
|
-
readonly setTick: (tick: number) => void;
|
|
24
|
-
/** Stamp live row counts into the dense descriptors so a bare dense
|
|
25
|
-
* reader of the snapshot sees self-consistent counts. */
|
|
26
|
-
readonly publishRowCounts: () => void;
|
|
27
|
-
/** Adopt a restored dense store: swap the live backing, refresh archetype
|
|
28
|
-
* views, recover the allocator high-water from the restored region, and
|
|
29
|
-
* republish (the grow tail). Owned by Store — see `_mountRestoredDense`. */
|
|
30
|
-
readonly mountRestoredDense: (restored: ColumnStore) => void;
|
|
31
|
-
/** Rebuild each archetype's host-side `length`/`enabledCount`/entity-id
|
|
32
|
-
* back-references from the restored entity-index region + captured host
|
|
33
|
-
* state. Owned by Store — see `_reconstructHostRows`. */
|
|
34
|
-
readonly reconstructHostRows: (host: HostState) => void;
|
|
35
|
-
/** Every archetype's membership just changed — bump the query epoch and
|
|
36
|
-
* force the next descriptor publish. */
|
|
37
|
-
readonly invalidateQueryCaches: () => void;
|
|
38
|
-
}
|
|
39
|
-
export declare class SnapshotService {
|
|
40
|
-
private readonly host;
|
|
41
|
-
/** The allocator IS its own snapshot seam (H1 step 3): free-list copy on
|
|
42
|
-
* capture; `setHighWater` + `restoreHostState` on mount. */
|
|
43
|
-
private readonly allocator;
|
|
44
|
-
constructor(host: SnapshotHost, allocator: EntityAllocator);
|
|
45
|
-
/** Serialize the sparse stores **and** relation side data to a self-contained
|
|
46
|
-
* byte buffer — the sparse half of a world snapshot (the dense half is the
|
|
47
|
-
* SAB snapshot). Two framed sections: the sparse stores (`snapshotSparseStores`
|
|
48
|
-
* — exclusive relation targets + multi membership ride here) followed
|
|
49
|
-
* by the relation side data (`snapshotRelations` — multi forward target
|
|
50
|
-
* sets, which live outside the sparse store). Both are written in canonical
|
|
51
|
-
* entity-index order, so two worlds with identical contents inserted in
|
|
52
|
-
* different orders snapshot byte-for-byte the same (#470). The reverse index
|
|
53
|
-
* is derived and never serialized — `restoreSparse` rebuilds it. */
|
|
54
|
-
snapshotSparse(): Uint8Array;
|
|
55
|
-
/** Repopulate the sparse stores from `snapshotSparse` bytes, replacing all
|
|
56
|
-
* current sparse data (full-equality round-trip of membership + data), then
|
|
57
|
-
* rebuild every relation's derived side indices: multi forward sets from the
|
|
58
|
-
* relation section, and the reverse index for both cardinalities (exclusive
|
|
59
|
-
* from the just-restored sparse target field, multi from the rebuilt forward
|
|
60
|
-
* sets). The sparse components and relations must already be registered in
|
|
61
|
-
* the same order — restore carries data, not the registration (which is
|
|
62
|
-
* code). Throws `SparseRestoreError` if the snapshot's shape, field identity,
|
|
63
|
-
* entity-index bounds, or frame length don't validate. */
|
|
64
|
-
restoreSparse(bytes: Uint8Array): void;
|
|
65
|
-
/** Rebuild every relation's derived side indices after the sparse stores have
|
|
66
|
-
* been restored. `restoreRelations` resets all relations, rebuilds the multi
|
|
67
|
-
* forward sets + their reverse edges from `relBytes`, and validates shape.
|
|
68
|
-
* The exclusive reverse index can't be carried in the bytes (it's derivable),
|
|
69
|
-
* so it's rebuilt here from the backing sparse store: every member row holds
|
|
70
|
-
* `(source index → target EntityID)`, which is exactly one reverse edge. */
|
|
71
|
-
private rebuildRelationIndices;
|
|
72
|
-
/** Capture the full live world to one self-contained byte buffer that
|
|
73
|
-
* `restoreInto` can mount back onto a live, ticking world (#789). Three
|
|
74
|
-
* sections (see `resume.ts`): the dense SAB column bytes, the sparse +
|
|
75
|
-
* relation bytes, and the host-side bookkeeping the SAB omits. */
|
|
76
|
-
snapshot(): Uint8Array;
|
|
77
|
-
/** Gather the host-side state a snapshot carries alongside the dense + sparse
|
|
78
|
-
* bytes — see `snapshot()`. The free-list is copied (it's a live mutable). */
|
|
79
|
-
private collectHostState;
|
|
80
|
-
/** Mount a `snapshot()` buffer onto the live world and leave it ready to keep
|
|
81
|
-
* ticking. Fails closed on a malformed frame or a registration mismatch
|
|
82
|
-
* BEFORE any live state is touched. */
|
|
83
|
-
restoreInto(bytes: Uint8Array): void;
|
|
84
|
-
/** Read-only validation of a `snapshotSparse` SECTION (the framed
|
|
85
|
-
* `[sparseLen][relLen][sparse][rel]` buffer) against the live registry, used
|
|
86
|
-
* by `restoreInto` to fail closed on a sparse-registration mismatch BEFORE the
|
|
87
|
-
* dense mount commits. Mirrors `restoreSparse`'s frame check, then validates the
|
|
88
|
-
* sparse-stores sub-section without mutating. A relation-registration difference
|
|
89
|
-
* surfaces here too: every `registerRelation` adds a backing sparse store, so a
|
|
90
|
-
* differing relation set changes the sparse store count / schema. Throws
|
|
91
|
-
* `SparseRestoreError` on a mismatch. */
|
|
92
|
-
private assertSparseSectionMatches;
|
|
93
|
-
}
|
|
94
|
-
//# sourceMappingURL=snapshot_service.d.ts.map
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { Archetype } from './archetype.js';
|
|
2
|
-
import { EntityAllocator } from './entity_allocator.js';
|
|
3
|
-
import { SparseComponentStore } from './sparse_store.js';
|
|
4
|
-
import { RelationStore } from './relation.js';
|
|
5
|
-
import { ColumnStore, InPlaceBufferAllocator } from '../store/index.js';
|
|
6
|
-
import { HostState } from './resume.js';
|
|
7
|
-
/** What the snapshot/resume orchestration needs from `Store` — closure-
|
|
8
|
-
* injected (the `RelationServiceHost` style). Accessors re-read live fields
|
|
9
|
-
* per call (the column store and the entity-index views are replaced on
|
|
10
|
-
* restore); the three mutation members keep Store-owned state transitions on
|
|
11
|
-
* the Store side. All cold-path. */
|
|
12
|
-
export interface SnapshotHost {
|
|
13
|
-
readonly sparseStores: () => readonly SparseComponentStore[];
|
|
14
|
-
readonly relationStores: () => readonly RelationStore[];
|
|
15
|
-
/** Live SAB generations view (replanted on restore) — for rebuilding
|
|
16
|
-
* relation ids from entity indices. */
|
|
17
|
-
readonly generations: () => Int32Array;
|
|
18
|
-
readonly archetypes: () => readonly Archetype[];
|
|
19
|
-
readonly columnStore: () => ColumnStore;
|
|
20
|
-
readonly bufferAllocator: () => InPlaceBufferAllocator;
|
|
21
|
-
readonly entityIndexCapacity: () => number;
|
|
22
|
-
readonly tick: () => number;
|
|
23
|
-
readonly setTick: (tick: number) => void;
|
|
24
|
-
/** Stamp live row counts into the dense descriptors so a bare dense
|
|
25
|
-
* reader of the snapshot sees self-consistent counts. */
|
|
26
|
-
readonly publishRowCounts: () => void;
|
|
27
|
-
/** Adopt a restored dense store: swap the live backing, refresh archetype
|
|
28
|
-
* views, recover the allocator high-water from the restored region, and
|
|
29
|
-
* republish (the grow tail). Owned by Store — see `_mountRestoredDense`. */
|
|
30
|
-
readonly mountRestoredDense: (restored: ColumnStore) => void;
|
|
31
|
-
/** Rebuild each archetype's host-side `length`/`enabledCount`/entity-id
|
|
32
|
-
* back-references from the restored entity-index region + captured host
|
|
33
|
-
* state. Owned by Store — see `_reconstructHostRows`. */
|
|
34
|
-
readonly reconstructHostRows: (host: HostState) => void;
|
|
35
|
-
/** Every archetype's membership just changed — bump the query epoch and
|
|
36
|
-
* force the next descriptor publish. */
|
|
37
|
-
readonly invalidateQueryCaches: () => void;
|
|
38
|
-
}
|
|
39
|
-
export declare class SnapshotService {
|
|
40
|
-
private readonly host;
|
|
41
|
-
/** The allocator IS its own snapshot seam (H1 step 3): free-list copy on
|
|
42
|
-
* capture; `setHighWater` + `restoreHostState` on mount. */
|
|
43
|
-
private readonly allocator;
|
|
44
|
-
constructor(host: SnapshotHost, allocator: EntityAllocator);
|
|
45
|
-
/** Serialize the sparse stores **and** relation side data to a self-contained
|
|
46
|
-
* byte buffer — the sparse half of a world snapshot (the dense half is the
|
|
47
|
-
* SAB snapshot). Two framed sections: the sparse stores (`snapshotSparseStores`
|
|
48
|
-
* — exclusive relation targets + multi membership ride here) followed
|
|
49
|
-
* by the relation side data (`snapshotRelations` — multi forward target
|
|
50
|
-
* sets, which live outside the sparse store). Both are written in canonical
|
|
51
|
-
* entity-index order, so two worlds with identical contents inserted in
|
|
52
|
-
* different orders snapshot byte-for-byte the same (#470). The reverse index
|
|
53
|
-
* is derived and never serialized — `restoreSparse` rebuilds it. */
|
|
54
|
-
snapshotSparse(): Uint8Array;
|
|
55
|
-
/** Repopulate the sparse stores from `snapshotSparse` bytes, replacing all
|
|
56
|
-
* current sparse data (full-equality round-trip of membership + data), then
|
|
57
|
-
* rebuild every relation's derived side indices: multi forward sets from the
|
|
58
|
-
* relation section, and the reverse index for both cardinalities (exclusive
|
|
59
|
-
* from the just-restored sparse target field, multi from the rebuilt forward
|
|
60
|
-
* sets). The sparse components and relations must already be registered in
|
|
61
|
-
* the same order — restore carries data, not the registration (which is
|
|
62
|
-
* code). Throws `SparseRestoreError` if the snapshot's shape, field identity,
|
|
63
|
-
* entity-index bounds, or frame length don't validate. */
|
|
64
|
-
restoreSparse(bytes: Uint8Array): void;
|
|
65
|
-
/** Rebuild every relation's derived side indices after the sparse stores have
|
|
66
|
-
* been restored. `restoreRelations` resets all relations, rebuilds the multi
|
|
67
|
-
* forward sets + their reverse edges from `relBytes`, and validates shape.
|
|
68
|
-
* The exclusive reverse index can't be carried in the bytes (it's derivable),
|
|
69
|
-
* so it's rebuilt here from the backing sparse store: every member row holds
|
|
70
|
-
* `(source index → target EntityID)`, which is exactly one reverse edge. */
|
|
71
|
-
private rebuildRelationIndices;
|
|
72
|
-
/** Capture the full live world to one self-contained byte buffer that
|
|
73
|
-
* `restoreInto` can mount back onto a live, ticking world (#789). Three
|
|
74
|
-
* sections (see `resume.ts`): the dense SAB column bytes, the sparse +
|
|
75
|
-
* relation bytes, and the host-side bookkeeping the SAB omits. */
|
|
76
|
-
snapshot(): Uint8Array;
|
|
77
|
-
/** Gather the host-side state a snapshot carries alongside the dense + sparse
|
|
78
|
-
* bytes — see `snapshot()`. The free-list is copied (it's a live mutable). */
|
|
79
|
-
private collectHostState;
|
|
80
|
-
/** Mount a `snapshot()` buffer onto the live world and leave it ready to keep
|
|
81
|
-
* ticking. Fails closed on a malformed frame or a registration mismatch
|
|
82
|
-
* BEFORE any live state is touched. */
|
|
83
|
-
restoreInto(bytes: Uint8Array): void;
|
|
84
|
-
/** Read-only validation of a `snapshotSparse` SECTION (the framed
|
|
85
|
-
* `[sparseLen][relLen][sparse][rel]` buffer) against the live registry, used
|
|
86
|
-
* by `restoreInto` to fail closed on a sparse-registration mismatch BEFORE the
|
|
87
|
-
* dense mount commits. Mirrors `restoreSparse`'s frame check, then validates the
|
|
88
|
-
* sparse-stores sub-section without mutating. A relation-registration difference
|
|
89
|
-
* surfaces here too: every `registerRelation` adds a backing sparse store, so a
|
|
90
|
-
* differing relation set changes the sparse store count / schema. Throws
|
|
91
|
-
* `SparseRestoreError` on a mismatch. */
|
|
92
|
-
private assertSparseSectionMatches;
|
|
93
|
-
}
|
|
94
|
-
//# sourceMappingURL=snapshot_service.d.ts.map
|
|
@@ -1 +0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,WAAW;CAOnB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"field_handle.d.ts","sourceRoot":"","sources":["../../../src/extensions/editor/field_handle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC9E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC3B;;;;;OAKG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,8EAA8E;IAC9E,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB;;;;;;;OAOG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;CACrC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,eAAe,EACpD,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,GAAG,EAAE,YAAY,CAAC,CAAC,CAAC,EACpB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,EACvB,IAAI,CAAC,EAAE,MAAM,MAAM,GAAG,SAAS,GAC7B,WAAW,CAYb"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function o(r,t,e){return`${r}:${t.id}:${e}`}const a=new WeakMap;class h{constructor(t,e){this.readField=t,this.shadow=e,a.set(this,{forward:[],inverse:[]})}staged=new Map;get _txn(){return a.get(this)}spawn(t,e){const s={kind:"despawn",eid:0};return this._txn.inverse.push(s),this._txn.forward.push({kind:"spawn",components:t,onSpawned:n=>{s.eid=n,e?.(n)}}),this}despawn(t,e){const s={kind:"despawn",eid:t};return this._txn.forward.push(s),this._txn.inverse.push({kind:"spawn",components:e,onSpawned:n=>{s.eid=n}}),this}setField(t,e,s,n){const i=o(t,e,s),d=this.staged.get(i)??this.shadow.get(i)??this.readField(t,e,s)??0;return this.staged.set(i,n),this._txn.forward.push({kind:"set_field",eid:t,def:e,field:s,value:n}),this._txn.inverse.push({kind:"set_field",eid:t,def:e,field:s,value:d}),this}add(t,e,s){return this._txn.forward.push({kind:"add_component",eid:t,def:e,values:s}),this._txn.inverse.push({kind:"remove_component",eid:t,def:e}),this}remove(t,e,s){return this._txn.forward.push({kind:"remove_component",eid:t,def:e}),this._txn.inverse.push({kind:"add_component",eid:t,def:e,values:s}),this}disable(t){return this._txn.forward.push({kind:"disable",eid:t}),this._txn.inverse.push({kind:"enable",eid:t}),this}enable(t){return this._txn.forward.push({kind:"enable",eid:t}),this._txn.inverse.push({kind:"disable",eid:t}),this}}class u{constructor(t,e){this.queue=t,this.readField=e}undoStack=[];redoStack=[];listeners=[];shadow=new Map;transaction(t){const e=new h(this.readField,this.shadow);return t(e),this.commit(a.get(e))}spawn(t,e){return this.transaction(s=>s.spawn(t,e))}despawn(t,e){return this.transaction(s=>s.despawn(t,e))}setField(t,e,s,n){return this.transaction(i=>i.setField(t,e,s,n))}add(t,e,s){return this.transaction(n=>n.add(t,e,s))}remove(t,e,s){return this.transaction(n=>n.remove(t,e,s))}disable(t){return this.transaction(e=>e.disable(t))}enable(t){return this.transaction(e=>e.enable(t))}undo(){const t=this.undoStack.pop();if(t===void 0)return!1;const e=t.inverse.slice().reverse();for(const s of e)this.queue.push(s);return this.applyShadow(e),this.redoStack.push(t),this.notify(),!0}redo(){const t=this.redoStack.pop();if(t===void 0)return!1;for(const e of t.forward)this.queue.push(e);return this.applyShadow(t.forward),this.undoStack.push(t),this.notify(),!0}clear(){this.undoStack.length=0,this.redoStack.length=0,this.shadow.clear(),this.notify()}depths(){return{undo:this.undoStack.length,redo:this.redoStack.length}}get canUndo(){return this.undoStack.length>0}get canRedo(){return this.redoStack.length>0}onChange(t){return this.listeners.push(t),()=>{const e=this.listeners.indexOf(t);e!==-1&&this.listeners.splice(e,1)}}notify(){for(const t of this.listeners.slice())t()}committedField(t,e,s){return this.readField(t,e,s)}pendingField(t,e,s){const n=o(t,e,s),i=this.shadow.get(n);if(i===void 0)return;const d=this.readField(t,e,s);if(d===i||d===void 0){this.shadow.delete(n);return}return i}commit(t){if(t.forward.length===0)return t;for(const e of t.forward)this.queue.push(e);return this.applyShadow(t.forward),this.undoStack.push(t),this.redoStack.length=0,this.notify(),t}applyShadow(t){for(const e of t)e.kind==="set_field"&&this.shadow.set(o(e.eid,e.def,e.field),e.value)}}function c(r,t,e,s,n){return{get value(){return n!==void 0?n():r.committedField(t,e,s)},set(i){r.setField(t,e,s,i)},get pending(){return r.pendingField(t,e,s)}}}exports.Editor=u;exports.TransactionBuilder=h;exports.fieldHandle=c;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The host write seam's EDITOR layer (#701) — layer 2 of #681 / PATTERNS §85.
|
|
3
|
-
*
|
|
4
|
-
* Reified undo/redo + the inspector field-handle, built on the shipped typed
|
|
5
|
-
* `HostCommandQueue` (#698). Application policy, so it lives here in
|
|
6
|
-
* `engine-extensions`, not engine core — and it pulls NO third-party / framework
|
|
7
|
-
* dependency (the field-handle reads through a caller-supplied thunk).
|
|
8
|
-
*
|
|
9
|
-
* - `Editor` — reified `EditorTransaction`s on undo/redo stacks, with
|
|
10
|
-
* transaction grouping; `undo()`/`redo()` enqueue the inverse/forward on the
|
|
11
|
-
* SAME bus, applied at the next schedule head (undo is just another command).
|
|
12
|
-
* - `fieldHandle` — pairs a reactive-channel read with a `setField` command, so
|
|
13
|
-
* an inspector field feels two-way while staying safe and undoable.
|
|
14
|
-
*
|
|
15
|
-
* Reachable as `@oasys/oecs/editor`. Pair it with
|
|
16
|
-
* `@oasys/oecs/reactive-sync`'s `syncFieldsToMap` /
|
|
17
|
-
* `syncSingletonToStruct` for the read channel the field-handle reads through.
|
|
18
|
-
*/
|
|
19
|
-
export { Editor, TransactionBuilder, type EditorTransaction, type FieldReader } from './editor.cjs';
|
|
20
|
-
export { fieldHandle, type FieldHandle } from './field_handle.cjs';
|
|
21
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The host write seam's EDITOR layer (#701) — layer 2 of #681 / PATTERNS §85.
|
|
3
|
-
*
|
|
4
|
-
* Reified undo/redo + the inspector field-handle, built on the shipped typed
|
|
5
|
-
* `HostCommandQueue` (#698). Application policy, so it lives here in
|
|
6
|
-
* `engine-extensions`, not engine core — and it pulls NO third-party / framework
|
|
7
|
-
* dependency (the field-handle reads through a caller-supplied thunk).
|
|
8
|
-
*
|
|
9
|
-
* - `Editor` — reified `EditorTransaction`s on undo/redo stacks, with
|
|
10
|
-
* transaction grouping; `undo()`/`redo()` enqueue the inverse/forward on the
|
|
11
|
-
* SAME bus, applied at the next schedule head (undo is just another command).
|
|
12
|
-
* - `fieldHandle` — pairs a reactive-channel read with a `setField` command, so
|
|
13
|
-
* an inspector field feels two-way while staying safe and undoable.
|
|
14
|
-
*
|
|
15
|
-
* Reachable as `@oasys/oecs/editor`. Pair it with
|
|
16
|
-
* `@oasys/oecs/reactive-sync`'s `syncFieldsToMap` /
|
|
17
|
-
* `syncSingletonToStruct` for the read channel the field-handle reads through.
|
|
18
|
-
*/
|
|
19
|
-
export { Editor, TransactionBuilder, type EditorTransaction, type FieldReader } from './editor.js';
|
|
20
|
-
export { fieldHandle, type FieldHandle } from './field_handle.js';
|
|
21
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/extensions/editor/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,KAAK,iBAAiB,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAChG,OAAO,EAAE,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function o(r,t,e){return`${r}:${t.id}:${e}`}const a=new WeakMap;class h{constructor(t,e){this.readField=t,this.shadow=e,a.set(this,{forward:[],inverse:[]})}staged=new Map;get _txn(){return a.get(this)}spawn(t,e){const s={kind:"despawn",eid:0};return this._txn.inverse.push(s),this._txn.forward.push({kind:"spawn",components:t,onSpawned:n=>{s.eid=n,e?.(n)}}),this}despawn(t,e){const s={kind:"despawn",eid:t};return this._txn.forward.push(s),this._txn.inverse.push({kind:"spawn",components:e,onSpawned:n=>{s.eid=n}}),this}setField(t,e,s,n){const i=o(t,e,s),d=this.staged.get(i)??this.shadow.get(i)??this.readField(t,e,s)??0;return this.staged.set(i,n),this._txn.forward.push({kind:"set_field",eid:t,def:e,field:s,value:n}),this._txn.inverse.push({kind:"set_field",eid:t,def:e,field:s,value:d}),this}add(t,e,s){return this._txn.forward.push({kind:"add_component",eid:t,def:e,values:s}),this._txn.inverse.push({kind:"remove_component",eid:t,def:e}),this}remove(t,e,s){return this._txn.forward.push({kind:"remove_component",eid:t,def:e}),this._txn.inverse.push({kind:"add_component",eid:t,def:e,values:s}),this}disable(t){return this._txn.forward.push({kind:"disable",eid:t}),this._txn.inverse.push({kind:"enable",eid:t}),this}enable(t){return this._txn.forward.push({kind:"enable",eid:t}),this._txn.inverse.push({kind:"disable",eid:t}),this}}class u{constructor(t,e){this.queue=t,this.readField=e}undoStack=[];redoStack=[];listeners=[];shadow=new Map;transaction(t){const e=new h(this.readField,this.shadow);return t(e),this.commit(a.get(e))}spawn(t,e){return this.transaction(s=>s.spawn(t,e))}despawn(t,e){return this.transaction(s=>s.despawn(t,e))}setField(t,e,s,n){return this.transaction(i=>i.setField(t,e,s,n))}add(t,e,s){return this.transaction(n=>n.add(t,e,s))}remove(t,e,s){return this.transaction(n=>n.remove(t,e,s))}disable(t){return this.transaction(e=>e.disable(t))}enable(t){return this.transaction(e=>e.enable(t))}undo(){const t=this.undoStack.pop();if(t===void 0)return!1;const e=t.inverse.slice().reverse();for(const s of e)this.queue.push(s);return this.applyShadow(e),this.redoStack.push(t),this.notify(),!0}redo(){const t=this.redoStack.pop();if(t===void 0)return!1;for(const e of t.forward)this.queue.push(e);return this.applyShadow(t.forward),this.undoStack.push(t),this.notify(),!0}clear(){this.undoStack.length=0,this.redoStack.length=0,this.shadow.clear(),this.notify()}depths(){return{undo:this.undoStack.length,redo:this.redoStack.length}}get canUndo(){return this.undoStack.length>0}get canRedo(){return this.redoStack.length>0}onChange(t){return this.listeners.push(t),()=>{const e=this.listeners.indexOf(t);e!==-1&&this.listeners.splice(e,1)}}notify(){for(const t of this.listeners.slice())t()}committedField(t,e,s){return this.readField(t,e,s)}pendingField(t,e,s){const n=o(t,e,s),i=this.shadow.get(n);if(i===void 0)return;const d=this.readField(t,e,s);if(d===i||d===void 0){this.shadow.delete(n);return}return i}commit(t){if(t.forward.length===0)return t;for(const e of t.forward)this.queue.push(e);return this.applyShadow(t.forward),this.undoStack.push(t),this.redoStack.length=0,this.notify(),t}applyShadow(t){for(const e of t)e.kind==="set_field"&&this.shadow.set(o(e.eid,e.def,e.field),e.value)}}function c(r,t,e,s,n){return{get value(){return n!==void 0?n():r.committedField(t,e,s)},set(i){r.setField(t,e,s,i)},get pending(){return r.pendingField(t,e,s)}}}exports.Editor=u;exports.TransactionBuilder=h;exports.fieldHandle=c;
|