@oasys/oecs 0.5.4 → 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 +1223 -266
- package/README.md +217 -112
- package/dist/core/ecs/access_check.d.cts +29 -29
- package/dist/core/ecs/access_check.d.ts +29 -29
- package/dist/core/ecs/access_check.d.ts.map +1 -1
- package/dist/core/ecs/archetype.d.cts +217 -209
- package/dist/core/ecs/archetype.d.ts +217 -209
- 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 +33 -33
- package/dist/core/ecs/archetype_graph.d.ts +33 -33
- 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 +26 -26
- package/dist/core/ecs/command_log.d.ts +26 -26
- package/dist/core/ecs/command_log.d.ts.map +1 -1
- package/dist/core/ecs/component.d.cts +43 -42
- package/dist/core/ecs/component.d.ts +43 -42
- 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 +289 -270
- package/dist/core/ecs/ecs.d.ts +289 -270
- 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 +20 -18
- package/dist/core/ecs/entity_allocator.d.ts +20 -18
- package/dist/core/ecs/entity_allocator.d.ts.map +1 -1
- package/dist/core/ecs/event.d.cts +36 -22
- package/dist/core/ecs/event.d.ts +36 -22
- 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 +32 -32
- package/dist/core/ecs/frame_trace.d.ts +32 -32
- package/dist/core/ecs/frame_trace.d.ts.map +1 -1
- package/dist/core/ecs/host_commands.d.cts +103 -85
- package/dist/core/ecs/host_commands.d.ts +103 -85
- package/dist/core/ecs/host_commands.d.ts.map +1 -1
- package/dist/core/ecs/index.d.cts +21 -11
- package/dist/core/ecs/index.d.ts +21 -11
- package/dist/core/ecs/index.d.ts.map +1 -1
- package/dist/core/ecs/observer.d.cts +39 -120
- package/dist/core/ecs/observer.d.ts +39 -120
- 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 +208 -578
- package/dist/core/ecs/query.d.ts +208 -578
- 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 +100 -39
- package/dist/core/ecs/ref.d.ts +100 -39
- package/dist/core/ecs/ref.d.ts.map +1 -1
- package/dist/core/ecs/relation.d.cts +101 -182
- package/dist/core/ecs/relation.d.ts +101 -182
- package/dist/core/ecs/relation.d.ts.map +1 -1
- package/dist/core/ecs/resource.d.cts +13 -13
- package/dist/core/ecs/resource.d.ts +13 -13
- package/dist/core/ecs/resource_registry.d.cts +5 -5
- package/dist/core/ecs/resource_registry.d.ts +5 -5
- 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 +91 -120
- package/dist/core/ecs/schedule.d.ts +91 -120
- 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 +108 -51
- package/dist/core/ecs/sparse_store.d.ts +108 -51
- package/dist/core/ecs/sparse_store.d.ts.map +1 -1
- package/dist/core/ecs/store.d.cts +527 -473
- package/dist/core/ecs/store.d.ts +527 -473
- package/dist/core/ecs/store.d.ts.map +1 -1
- package/dist/core/ecs/store_layout_listener.d.cts +6 -6
- package/dist/core/ecs/store_layout_listener.d.ts +6 -6
- 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 +146 -61
- package/dist/core/ecs/system.d.ts +146 -61
- 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 +82 -6
- package/dist/core/ecs/utils/error.d.ts +82 -6
- 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 +44 -44
- package/dist/core/store/action_ring.d.ts +44 -44
- package/dist/core/store/action_ring.d.ts.map +1 -1
- package/dist/core/store/allocator.d.cts +149 -95
- package/dist/core/store/allocator.d.ts +149 -95
- package/dist/core/store/allocator.d.ts.map +1 -1
- package/dist/core/store/buffer_backed_column.d.cts +17 -17
- package/dist/core/store/buffer_backed_column.d.ts +17 -17
- package/dist/core/store/buffer_backed_column.d.ts.map +1 -1
- package/dist/core/store/column_store.d.cts +124 -86
- package/dist/core/store/column_store.d.ts +124 -86
- 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 +36 -39
- package/dist/core/store/command_ring.d.ts +36 -39
- package/dist/core/store/command_ring.d.ts.map +1 -1
- package/dist/core/store/descriptor.d.cts +34 -17
- package/dist/core/store/descriptor.d.ts +34 -17
- 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 +36 -38
- package/dist/core/store/event_ring.d.ts +36 -38
- package/dist/core/store/event_ring.d.ts.map +1 -1
- package/dist/core/store/extend.d.cts +13 -7
- package/dist/core/store/extend.d.ts +13 -7
- package/dist/core/store/extend.d.ts.map +1 -1
- package/dist/core/store/grow.d.cts +2 -2
- package/dist/core/store/grow.d.ts +2 -2
- package/dist/core/store/grow.d.ts.map +1 -1
- package/dist/core/store/header.d.cts +31 -27
- package/dist/core/store/header.d.ts +31 -27
- 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 +71 -62
- package/dist/core/store/layout_ops.d.ts +71 -62
- 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 +12 -12
- package/dist/core/store/state_hash.d.ts +12 -12
- 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 +15 -10
- package/dist/index.d.ts +15 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.development.cjs +1 -1
- package/dist/index.development.js +5804 -5203
- package/dist/index.js +5323 -4764
- 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 +54 -54
- package/dist/{extensions → plugins}/editor/editor.d.ts +54 -54
- package/dist/plugins/editor/editor.d.ts.map +1 -0
- package/dist/{extensions → plugins}/editor/field_handle.d.cts +12 -12
- package/dist/{extensions → plugins}/editor/field_handle.d.ts +12 -12
- 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} +81 -64
- package/dist/{extensions/editor/index.js → plugins/editor.js} +81 -64
- 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 +85 -97
- package/dist/{core/ecs → plugins/relations}/relation_service.d.ts +85 -97
- 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 +16 -15
- package/dist/type_primitives/typed_arrays/typed_arrays.d.ts +16 -15
- 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 +3 -3
- package/dist/version.d.ts +3 -3
- 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-BlR3oZ3x.js +0 -2406
- package/dist/host_commands-C2cpU3yC.cjs +0 -1
- package/dist/internal-BoxWl4dG.js +0 -2565
- package/dist/internal-CGBEwfeB.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-Bs39EPh1.js +0 -150
- package/dist/shallow-C5YmTbtb.cjs +0 -1
- package/dist/shallow-CiFC70Dz.js +0 -159
- package/dist/shallow-DQ8aG51_.cjs +0 -1
- package/dist/shared-B4v0L1cw.js +0 -109
- package/dist/shared-DU78k0pU.cjs +0 -1
- package/dist/topological_sort-BDvEyb9W.cjs +0 -1
- package/dist/topological_sort-DK6EjpWa.js +0 -135
- package/dist/typed_arrays-D3NmwtCG.cjs +0 -1
- package/dist/typed_arrays-DIVwVy5_.js +0 -258
|
@@ -1,110 +1,14 @@
|
|
|
1
1
|
import { Store } from './store.js';
|
|
2
|
-
import { EntityID } from './entity.js';
|
|
3
|
-
import { OnDeleteTarget, RelationDef, RelationOptions } from './relation.js';
|
|
4
2
|
import { ResourceKey } from './resource.js';
|
|
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`).
|
|
18
|
-
*
|
|
19
|
-
* The overloads stamp the CARDINALITY into the handle type, exactly like
|
|
20
|
-
* 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
|
-
* 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. 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. 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. Access-checked as a *write
|
|
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: world snapshot
|
|
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. v1 does NOT capture resources,
|
|
142
|
-
* events, or change-detection baselines. */
|
|
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
|
-
* 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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"facades.d.ts","sourceRoot":"","sources":["../../../src/core/ecs/facades.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"facades.d.ts","sourceRoot":"","sources":["../../../src/core/ecs/facades.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAO9C;;6DAE6D;AAC7D,qBAAa,YAAY;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAQ;IAC/B,sCAAsC;gBAC1B,KAAK,EAAE,KAAK;IAIxB;;;;;;;;OAQG;IACI,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI;IAOzD,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC;IAU9B,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI;IAU3D;;0DAEsD;IAC/C,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,IAAI;IAUpC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,OAAO;CAG3C;AAED;;;;uCAIuC;AACvC,qBAAa,YAAY;IAGxB,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC;IACjC,sCAAsC;gBAC1B,KAAK,EAAE,KAAK;IAIxB,kDAAkD;IAClD,IAAW,aAAa,IAAI,OAAO,CAElC;IAED;;yCAEqC;IAC9B,SAAS,IAAI,MAAM;CAG1B"}
|
|
@@ -6,11 +6,11 @@ export interface FrameStepperOptions {
|
|
|
6
6
|
/** Delta used by `step()` when no dt is supplied, in seconds. Default 1/60. */
|
|
7
7
|
readonly fixedDt?: number;
|
|
8
8
|
/** Clamp browser-frame deltas before forwarding them to `ECS.update()`, in
|
|
9
|
-
* seconds. Default 0.25. A backgrounded tab suspends rAF
|
|
9
|
+
* seconds. Default 0.25. A backgrounded tab suspends rAF. The first frame
|
|
10
10
|
* after it resumes carries the whole suspended interval as one delta, and
|
|
11
11
|
* without the clamp that lands in `update()`'s accumulator as a giant
|
|
12
12
|
* catch-up burst (bounded by `maxFixedSteps`, but still a burst). Manual
|
|
13
|
-
* `step()` deltas are deliberately not clamped
|
|
13
|
+
* `step()` deltas are deliberately not clamped, an explicit dt is trusted. */
|
|
14
14
|
readonly maxDt?: number;
|
|
15
15
|
/** Dependency injection for tests or non-browser hosts. Defaults to `requestAnimationFrame`. */
|
|
16
16
|
readonly requestFrame?: RequestFrame;
|
|
@@ -23,16 +23,16 @@ export interface FrameStepperOptions {
|
|
|
23
23
|
* Small host-side controller for manual ECS frame stepping.
|
|
24
24
|
*
|
|
25
25
|
* `ECS.update(dt)` is already the authoritative "run one frame" primitive.
|
|
26
|
-
* This class wraps it with pause
|
|
26
|
+
* This class wraps it with pause and play controls for browser loops and an explicit
|
|
27
27
|
* `step()` method for debuggers, tests, editor tools, and rollback playback.
|
|
28
28
|
*/
|
|
29
29
|
export declare class FrameStepper {
|
|
30
|
-
private readonly
|
|
31
|
-
private readonly
|
|
32
|
-
private readonly
|
|
33
|
-
private
|
|
34
|
-
private
|
|
35
|
-
private
|
|
30
|
+
private readonly _ecs;
|
|
31
|
+
private readonly _requestFrame?;
|
|
32
|
+
private readonly _cancelFrame?;
|
|
33
|
+
private _frameHandle;
|
|
34
|
+
private _lastTimestampMs;
|
|
35
|
+
private _running;
|
|
36
36
|
private _fixedDt;
|
|
37
37
|
private _maxDt;
|
|
38
38
|
constructor(ecs: ECS, options?: FrameStepperOptions);
|
|
@@ -45,14 +45,14 @@ export declare class FrameStepper {
|
|
|
45
45
|
step(dt?: number): void;
|
|
46
46
|
/** Advance several fixed-size frames, useful for replaying a paused sim. */
|
|
47
47
|
stepFrames(count: number, dt?: number): void;
|
|
48
|
-
/** Start ticking with `requestAnimationFrame
|
|
48
|
+
/** Start ticking with `requestAnimationFrame`. No-op when already running. */
|
|
49
49
|
play(): void;
|
|
50
50
|
/** Stop the automatic frame loop. Manual `step()` still works while paused. */
|
|
51
51
|
pause(): void;
|
|
52
52
|
toggle(): void;
|
|
53
53
|
dispose(): void;
|
|
54
|
-
private
|
|
55
|
-
private readonly
|
|
54
|
+
private _requestNextFrame;
|
|
55
|
+
private readonly _onFrame;
|
|
56
56
|
}
|
|
57
57
|
export {};
|
|
58
58
|
//# sourceMappingURL=frame_stepper.d.ts.map
|
|
@@ -6,11 +6,11 @@ export interface FrameStepperOptions {
|
|
|
6
6
|
/** Delta used by `step()` when no dt is supplied, in seconds. Default 1/60. */
|
|
7
7
|
readonly fixedDt?: number;
|
|
8
8
|
/** Clamp browser-frame deltas before forwarding them to `ECS.update()`, in
|
|
9
|
-
* seconds. Default 0.25. A backgrounded tab suspends rAF
|
|
9
|
+
* seconds. Default 0.25. A backgrounded tab suspends rAF. The first frame
|
|
10
10
|
* after it resumes carries the whole suspended interval as one delta, and
|
|
11
11
|
* without the clamp that lands in `update()`'s accumulator as a giant
|
|
12
12
|
* catch-up burst (bounded by `maxFixedSteps`, but still a burst). Manual
|
|
13
|
-
* `step()` deltas are deliberately not clamped
|
|
13
|
+
* `step()` deltas are deliberately not clamped, an explicit dt is trusted. */
|
|
14
14
|
readonly maxDt?: number;
|
|
15
15
|
/** Dependency injection for tests or non-browser hosts. Defaults to `requestAnimationFrame`. */
|
|
16
16
|
readonly requestFrame?: RequestFrame;
|
|
@@ -23,16 +23,16 @@ export interface FrameStepperOptions {
|
|
|
23
23
|
* Small host-side controller for manual ECS frame stepping.
|
|
24
24
|
*
|
|
25
25
|
* `ECS.update(dt)` is already the authoritative "run one frame" primitive.
|
|
26
|
-
* This class wraps it with pause
|
|
26
|
+
* This class wraps it with pause and play controls for browser loops and an explicit
|
|
27
27
|
* `step()` method for debuggers, tests, editor tools, and rollback playback.
|
|
28
28
|
*/
|
|
29
29
|
export declare class FrameStepper {
|
|
30
|
-
private readonly
|
|
31
|
-
private readonly
|
|
32
|
-
private readonly
|
|
33
|
-
private
|
|
34
|
-
private
|
|
35
|
-
private
|
|
30
|
+
private readonly _ecs;
|
|
31
|
+
private readonly _requestFrame?;
|
|
32
|
+
private readonly _cancelFrame?;
|
|
33
|
+
private _frameHandle;
|
|
34
|
+
private _lastTimestampMs;
|
|
35
|
+
private _running;
|
|
36
36
|
private _fixedDt;
|
|
37
37
|
private _maxDt;
|
|
38
38
|
constructor(ecs: ECS, options?: FrameStepperOptions);
|
|
@@ -45,14 +45,14 @@ export declare class FrameStepper {
|
|
|
45
45
|
step(dt?: number): void;
|
|
46
46
|
/** Advance several fixed-size frames, useful for replaying a paused sim. */
|
|
47
47
|
stepFrames(count: number, dt?: number): void;
|
|
48
|
-
/** Start ticking with `requestAnimationFrame
|
|
48
|
+
/** Start ticking with `requestAnimationFrame`. No-op when already running. */
|
|
49
49
|
play(): void;
|
|
50
50
|
/** Stop the automatic frame loop. Manual `step()` still works while paused. */
|
|
51
51
|
pause(): void;
|
|
52
52
|
toggle(): void;
|
|
53
53
|
dispose(): void;
|
|
54
|
-
private
|
|
55
|
-
private readonly
|
|
54
|
+
private _requestNextFrame;
|
|
55
|
+
private readonly _onFrame;
|
|
56
56
|
}
|
|
57
57
|
export {};
|
|
58
58
|
//# sourceMappingURL=frame_stepper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frame_stepper.d.ts","sourceRoot":"","sources":["../../../src/core/ecs/frame_stepper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGjC,KAAK,aAAa,GAAG,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;AACnD,KAAK,YAAY,GAAG,CAAC,QAAQ,EAAE,aAAa,KAAK,MAAM,CAAC;AACxD,KAAK,WAAW,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;AAM5C,MAAM,WAAW,mBAAmB;IACnC,+EAA+E;IAC/E,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;;
|
|
1
|
+
{"version":3,"file":"frame_stepper.d.ts","sourceRoot":"","sources":["../../../src/core/ecs/frame_stepper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGjC,KAAK,aAAa,GAAG,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;AACnD,KAAK,YAAY,GAAG,CAAC,QAAQ,EAAE,aAAa,KAAK,MAAM,CAAC;AACxD,KAAK,WAAW,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;AAM5C,MAAM,WAAW,mBAAmB;IACnC,+EAA+E;IAC/E,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;;kFAK8E;IAC9E,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,gGAAgG;IAChG,QAAQ,CAAC,YAAY,CAAC,EAAE,YAAY,CAAC;IACrC,+FAA+F;IAC/F,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC;IACnC,kDAAkD;IAClD,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;CAC7B;AAsBD;;;;;;GAMG;AACH,qBAAa,YAAY;IACxB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAM;IAC3B,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAe;IAC9C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAc;IAC5C,OAAO,CAAC,YAAY,CAAuB;IAC3C,OAAO,CAAC,gBAAgB,CAAuB;IAC/C,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,MAAM,CAAS;gBAEJ,GAAG,EAAE,GAAG,EAAE,OAAO,GAAE,mBAAwB;IAW9D,IAAW,OAAO,IAAI,MAAM,CAE3B;IAED,IAAW,OAAO,CAAC,KAAK,EAAE,MAAM,EAE/B;IAED,IAAW,KAAK,IAAI,MAAM,CAEzB;IAED,IAAW,KAAK,CAAC,KAAK,EAAE,MAAM,EAE7B;IAED,IAAW,SAAS,IAAI,OAAO,CAE9B;IAED,qCAAqC;IAC9B,IAAI,CAAC,EAAE,GAAE,MAAsB,GAAG,IAAI;IAI7C,4EAA4E;IACrE,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAE,MAAsB,GAAG,IAAI;IAMlE,8EAA8E;IACvE,IAAI,IAAI,IAAI;IAanB,+EAA+E;IACxE,KAAK,IAAI,IAAI;IASb,MAAM,IAAI,IAAI;IAKd,OAAO,IAAI,IAAI;IAItB,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAQvB;CACF"}
|
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
import { EntityID } from './entity.cjs';
|
|
2
2
|
import { SystemDescriptor } from './system.cjs';
|
|
3
|
-
import {
|
|
4
|
-
/** A deferred structural command issued through `ctx.commands.*` (`
|
|
5
|
-
* `spawn
|
|
3
|
+
import { PhaseName } from './phase.cjs';
|
|
4
|
+
/** A deferred structural command issued through `ctx.commands.*` (`system_context.ts`).
|
|
5
|
+
* `spawn`, `despawn`, `enable` and `disable` carry a `null` component. `add` and `remove`
|
|
6
6
|
* carry the affected component's id. */
|
|
7
7
|
export type StructuralOp = "spawn" | "despawn" | "add" | "remove" | "enable" | "disable";
|
|
8
|
-
/** An observer edge that fired at a flush (`add
|
|
8
|
+
/** An observer edge that fired at a flush (`add`, `remove`, `enable` and `disable`) or
|
|
9
9
|
* at the post-update onSet detection point (`set`). */
|
|
10
10
|
export type ObserverOp = "add" | "remove" | "set" | "enable" | "disable";
|
|
11
11
|
/**
|
|
12
12
|
* The push sink. All callers are `DEV`-gated, so the methods receive raw ids
|
|
13
|
-
* and descriptor references
|
|
13
|
+
* and descriptor references, with no string-building on the hot path. The recorder
|
|
14
14
|
* decides what to retain. Implementations must be side-effect-free with respect
|
|
15
|
-
* to the ECS
|
|
15
|
+
* to the ECS. They observe, never mutate.
|
|
16
16
|
*/
|
|
17
17
|
export interface FrameTraceSink {
|
|
18
18
|
/** Opens a frame. Fired first in `ecs.update`, before any phase runs. */
|
|
19
19
|
tickBegin(tick: number, dt: number): void;
|
|
20
|
-
/** Closes the frame opened by `tickBegin` (after onSet
|
|
20
|
+
/** Closes the frame opened by `tickBegin` (after the onSet dispatch and the event clear). */
|
|
21
21
|
tickEnd(tick: number): void;
|
|
22
22
|
/** A scheduled system is about to run, in the given phase. */
|
|
23
|
-
|
|
24
|
-
/** The system that
|
|
23
|
+
systemBegin(system: SystemDescriptor, phase: PhaseName): void;
|
|
24
|
+
/** The system that `systemBegin` opened has returned. */
|
|
25
25
|
systemEnd(system: SystemDescriptor): void;
|
|
26
26
|
/** A deferred structural command was enqueued (applied at the next flush). */
|
|
27
27
|
commandQueued(op: StructuralOp, entity: EntityID, component: number | null): void;
|
|
28
28
|
/** The deferred command buffer is about to drain for this phase. */
|
|
29
|
-
flushBegin(phase:
|
|
29
|
+
flushBegin(phase: PhaseName): void;
|
|
30
30
|
/** The deferred command buffer (and any observer cascade) has settled. */
|
|
31
|
-
flushEnd(phase:
|
|
31
|
+
flushEnd(phase: PhaseName): void;
|
|
32
32
|
/**
|
|
33
|
-
* A schedule phase has fully settled
|
|
34
|
-
* deferred command buffer (plus any observer cascade) flushed
|
|
35
|
-
* world sits at a consistent, fingerprint-able point
|
|
33
|
+
* A schedule phase has fully settled, every system in `phase` ran and the
|
|
34
|
+
* deferred command buffer (plus any observer cascade) flushed, so the live
|
|
35
|
+
* world sits at a consistent, fingerprint-able point within the frame. Fired
|
|
36
36
|
* once per phase that runs (each startup phase, each fixed step, and each
|
|
37
37
|
* update phase), immediately after `flushEnd(phase)`.
|
|
38
38
|
*
|
|
@@ -40,22 +40,22 @@ export interface FrameTraceSink {
|
|
|
40
40
|
* phases of one `update()` and bisect a divergence to the exact phase that
|
|
41
41
|
* introduced it. `flushEnd` marks the same instant, but it
|
|
42
42
|
* is an observation of the flush *mechanism*, not a "safe to read consistent
|
|
43
|
-
* state" contract
|
|
43
|
+
* state" contract, so per-phase fingerprinting binds to this method, not to a
|
|
44
44
|
* flush-internal name. Like every sink method the call is read-only w.r.t. the
|
|
45
45
|
* ECS: reading `stateHash()` here cannot perturb the per-tick hash or ordering.
|
|
46
46
|
*
|
|
47
|
-
* Caveat: the POST_UPDATE boundary fires
|
|
48
|
-
* dispatch
|
|
47
|
+
* Caveat: the POST_UPDATE boundary fires before the tick-tail onSet-observer
|
|
48
|
+
* dispatch and the event clear, so for a world with onSet observers the final
|
|
49
49
|
* per-tick `stateHash` (after `update()` returns) may differ from the
|
|
50
50
|
* POST_UPDATE phase hash. A world with no onSet observers reconciles exactly.
|
|
51
51
|
*/
|
|
52
|
-
phaseBoundary(phase:
|
|
52
|
+
phaseBoundary(phase: PhaseName): void;
|
|
53
53
|
/** An observer callback fired for one entity (`entity === -1` for an
|
|
54
54
|
* archetype-granular onSet, which has no per-entity id). */
|
|
55
55
|
observerFired(op: ObserverOp, component: number, entity: number, observer: SystemDescriptor): void;
|
|
56
56
|
/** A system emitted an event on `key` (the channel's symbol description). */
|
|
57
57
|
eventEmitted(key: string): void;
|
|
58
|
-
/** A system read an event channel
|
|
58
|
+
/** A system read an event channel. `count` is how many events it saw. */
|
|
59
59
|
eventRead(key: string, count: number): void;
|
|
60
60
|
}
|
|
61
61
|
/** One captured event, as plain JSON-serialisable data (string names + numeric
|
|
@@ -63,7 +63,7 @@ export interface FrameTraceSink {
|
|
|
63
63
|
export type FrameTraceEvent = {
|
|
64
64
|
readonly kind: "system_start";
|
|
65
65
|
readonly system: string;
|
|
66
|
-
readonly phase:
|
|
66
|
+
readonly phase: PhaseName;
|
|
67
67
|
} | {
|
|
68
68
|
readonly kind: "system_end";
|
|
69
69
|
readonly system: string;
|
|
@@ -74,10 +74,10 @@ export type FrameTraceEvent = {
|
|
|
74
74
|
readonly component: number | null;
|
|
75
75
|
} | {
|
|
76
76
|
readonly kind: "flush_begin";
|
|
77
|
-
readonly phase:
|
|
77
|
+
readonly phase: PhaseName;
|
|
78
78
|
} | {
|
|
79
79
|
readonly kind: "flush_end";
|
|
80
|
-
readonly phase:
|
|
80
|
+
readonly phase: PhaseName;
|
|
81
81
|
} | {
|
|
82
82
|
readonly kind: "observer_fired";
|
|
83
83
|
readonly op: ObserverOp;
|
|
@@ -99,10 +99,10 @@ export interface FrameTrace {
|
|
|
99
99
|
readonly events: FrameTraceEvent[];
|
|
100
100
|
}
|
|
101
101
|
/**
|
|
102
|
-
* The in-tree `FrameTraceSink`. Mirrors `
|
|
103
|
-
*
|
|
102
|
+
* The in-tree `FrameTraceSink`. Mirrors the `openTick` and `RecordedTick`
|
|
103
|
+
* shape of `command_log.ts`: `tickBegin` opens a fresh `FrameTrace`, every other
|
|
104
104
|
* method appends to it, `tickEnd` closes it. Events arriving with no open
|
|
105
|
-
* frame (e.g. a stray pre-`update` flush) are ignored rather than throwing
|
|
105
|
+
* frame (e.g. a stray pre-`update` flush) are ignored rather than throwing,
|
|
106
106
|
* the recorder is a passive observer.
|
|
107
107
|
*/
|
|
108
108
|
export declare class FrameTraceRecorder implements FrameTraceSink {
|
|
@@ -110,18 +110,18 @@ export declare class FrameTraceRecorder implements FrameTraceSink {
|
|
|
110
110
|
private _current;
|
|
111
111
|
tickBegin(tick: number, dt: number): void;
|
|
112
112
|
tickEnd(_tick: number): void;
|
|
113
|
-
|
|
113
|
+
systemBegin(system: SystemDescriptor, phase: PhaseName): void;
|
|
114
114
|
systemEnd(system: SystemDescriptor): void;
|
|
115
115
|
commandQueued(op: StructuralOp, entity: EntityID, component: number | null): void;
|
|
116
|
-
flushBegin(phase:
|
|
117
|
-
flushEnd(phase:
|
|
116
|
+
flushBegin(phase: PhaseName): void;
|
|
117
|
+
flushEnd(phase: PhaseName): void;
|
|
118
118
|
/** No-op. The recorder already marks this instant with
|
|
119
|
-
* `flushEnd`, and a per-phase fingerprint is a consumer concern
|
|
120
|
-
* holds no world reference to hash. The seam exists so a consumer's
|
|
121
|
-
* run code (e.g. `stateHash()`) at the safe post-flush point
|
|
119
|
+
* `flushEnd`, and a per-phase fingerprint is a consumer concern, the recorder
|
|
120
|
+
* holds no world reference to hash. The seam exists so a consumer's own sink can
|
|
121
|
+
* run code (e.g. `stateHash()`) at the safe post-flush point. The in-tree
|
|
122
122
|
* event-stream recorder has nothing to add, so it stays a stream of causal
|
|
123
123
|
* events, not fingerprints. */
|
|
124
|
-
phaseBoundary(_phase:
|
|
124
|
+
phaseBoundary(_phase: PhaseName): void;
|
|
125
125
|
observerFired(op: ObserverOp, component: number, entity: number, observer: SystemDescriptor): void;
|
|
126
126
|
eventEmitted(key: string): void;
|
|
127
127
|
eventRead(key: string, count: number): void;
|
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
import { EntityID } from './entity.js';
|
|
2
2
|
import { SystemDescriptor } from './system.js';
|
|
3
|
-
import {
|
|
4
|
-
/** A deferred structural command issued through `ctx.commands.*` (`
|
|
5
|
-
* `spawn
|
|
3
|
+
import { PhaseName } from './phase.js';
|
|
4
|
+
/** A deferred structural command issued through `ctx.commands.*` (`system_context.ts`).
|
|
5
|
+
* `spawn`, `despawn`, `enable` and `disable` carry a `null` component. `add` and `remove`
|
|
6
6
|
* carry the affected component's id. */
|
|
7
7
|
export type StructuralOp = "spawn" | "despawn" | "add" | "remove" | "enable" | "disable";
|
|
8
|
-
/** An observer edge that fired at a flush (`add
|
|
8
|
+
/** An observer edge that fired at a flush (`add`, `remove`, `enable` and `disable`) or
|
|
9
9
|
* at the post-update onSet detection point (`set`). */
|
|
10
10
|
export type ObserverOp = "add" | "remove" | "set" | "enable" | "disable";
|
|
11
11
|
/**
|
|
12
12
|
* The push sink. All callers are `DEV`-gated, so the methods receive raw ids
|
|
13
|
-
* and descriptor references
|
|
13
|
+
* and descriptor references, with no string-building on the hot path. The recorder
|
|
14
14
|
* decides what to retain. Implementations must be side-effect-free with respect
|
|
15
|
-
* to the ECS
|
|
15
|
+
* to the ECS. They observe, never mutate.
|
|
16
16
|
*/
|
|
17
17
|
export interface FrameTraceSink {
|
|
18
18
|
/** Opens a frame. Fired first in `ecs.update`, before any phase runs. */
|
|
19
19
|
tickBegin(tick: number, dt: number): void;
|
|
20
|
-
/** Closes the frame opened by `tickBegin` (after onSet
|
|
20
|
+
/** Closes the frame opened by `tickBegin` (after the onSet dispatch and the event clear). */
|
|
21
21
|
tickEnd(tick: number): void;
|
|
22
22
|
/** A scheduled system is about to run, in the given phase. */
|
|
23
|
-
|
|
24
|
-
/** The system that
|
|
23
|
+
systemBegin(system: SystemDescriptor, phase: PhaseName): void;
|
|
24
|
+
/** The system that `systemBegin` opened has returned. */
|
|
25
25
|
systemEnd(system: SystemDescriptor): void;
|
|
26
26
|
/** A deferred structural command was enqueued (applied at the next flush). */
|
|
27
27
|
commandQueued(op: StructuralOp, entity: EntityID, component: number | null): void;
|
|
28
28
|
/** The deferred command buffer is about to drain for this phase. */
|
|
29
|
-
flushBegin(phase:
|
|
29
|
+
flushBegin(phase: PhaseName): void;
|
|
30
30
|
/** The deferred command buffer (and any observer cascade) has settled. */
|
|
31
|
-
flushEnd(phase:
|
|
31
|
+
flushEnd(phase: PhaseName): void;
|
|
32
32
|
/**
|
|
33
|
-
* A schedule phase has fully settled
|
|
34
|
-
* deferred command buffer (plus any observer cascade) flushed
|
|
35
|
-
* world sits at a consistent, fingerprint-able point
|
|
33
|
+
* A schedule phase has fully settled, every system in `phase` ran and the
|
|
34
|
+
* deferred command buffer (plus any observer cascade) flushed, so the live
|
|
35
|
+
* world sits at a consistent, fingerprint-able point within the frame. Fired
|
|
36
36
|
* once per phase that runs (each startup phase, each fixed step, and each
|
|
37
37
|
* update phase), immediately after `flushEnd(phase)`.
|
|
38
38
|
*
|
|
@@ -40,22 +40,22 @@ export interface FrameTraceSink {
|
|
|
40
40
|
* phases of one `update()` and bisect a divergence to the exact phase that
|
|
41
41
|
* introduced it. `flushEnd` marks the same instant, but it
|
|
42
42
|
* is an observation of the flush *mechanism*, not a "safe to read consistent
|
|
43
|
-
* state" contract
|
|
43
|
+
* state" contract, so per-phase fingerprinting binds to this method, not to a
|
|
44
44
|
* flush-internal name. Like every sink method the call is read-only w.r.t. the
|
|
45
45
|
* ECS: reading `stateHash()` here cannot perturb the per-tick hash or ordering.
|
|
46
46
|
*
|
|
47
|
-
* Caveat: the POST_UPDATE boundary fires
|
|
48
|
-
* dispatch
|
|
47
|
+
* Caveat: the POST_UPDATE boundary fires before the tick-tail onSet-observer
|
|
48
|
+
* dispatch and the event clear, so for a world with onSet observers the final
|
|
49
49
|
* per-tick `stateHash` (after `update()` returns) may differ from the
|
|
50
50
|
* POST_UPDATE phase hash. A world with no onSet observers reconciles exactly.
|
|
51
51
|
*/
|
|
52
|
-
phaseBoundary(phase:
|
|
52
|
+
phaseBoundary(phase: PhaseName): void;
|
|
53
53
|
/** An observer callback fired for one entity (`entity === -1` for an
|
|
54
54
|
* archetype-granular onSet, which has no per-entity id). */
|
|
55
55
|
observerFired(op: ObserverOp, component: number, entity: number, observer: SystemDescriptor): void;
|
|
56
56
|
/** A system emitted an event on `key` (the channel's symbol description). */
|
|
57
57
|
eventEmitted(key: string): void;
|
|
58
|
-
/** A system read an event channel
|
|
58
|
+
/** A system read an event channel. `count` is how many events it saw. */
|
|
59
59
|
eventRead(key: string, count: number): void;
|
|
60
60
|
}
|
|
61
61
|
/** One captured event, as plain JSON-serialisable data (string names + numeric
|
|
@@ -63,7 +63,7 @@ export interface FrameTraceSink {
|
|
|
63
63
|
export type FrameTraceEvent = {
|
|
64
64
|
readonly kind: "system_start";
|
|
65
65
|
readonly system: string;
|
|
66
|
-
readonly phase:
|
|
66
|
+
readonly phase: PhaseName;
|
|
67
67
|
} | {
|
|
68
68
|
readonly kind: "system_end";
|
|
69
69
|
readonly system: string;
|
|
@@ -74,10 +74,10 @@ export type FrameTraceEvent = {
|
|
|
74
74
|
readonly component: number | null;
|
|
75
75
|
} | {
|
|
76
76
|
readonly kind: "flush_begin";
|
|
77
|
-
readonly phase:
|
|
77
|
+
readonly phase: PhaseName;
|
|
78
78
|
} | {
|
|
79
79
|
readonly kind: "flush_end";
|
|
80
|
-
readonly phase:
|
|
80
|
+
readonly phase: PhaseName;
|
|
81
81
|
} | {
|
|
82
82
|
readonly kind: "observer_fired";
|
|
83
83
|
readonly op: ObserverOp;
|
|
@@ -99,10 +99,10 @@ export interface FrameTrace {
|
|
|
99
99
|
readonly events: FrameTraceEvent[];
|
|
100
100
|
}
|
|
101
101
|
/**
|
|
102
|
-
* The in-tree `FrameTraceSink`. Mirrors `
|
|
103
|
-
*
|
|
102
|
+
* The in-tree `FrameTraceSink`. Mirrors the `openTick` and `RecordedTick`
|
|
103
|
+
* shape of `command_log.ts`: `tickBegin` opens a fresh `FrameTrace`, every other
|
|
104
104
|
* method appends to it, `tickEnd` closes it. Events arriving with no open
|
|
105
|
-
* frame (e.g. a stray pre-`update` flush) are ignored rather than throwing
|
|
105
|
+
* frame (e.g. a stray pre-`update` flush) are ignored rather than throwing,
|
|
106
106
|
* the recorder is a passive observer.
|
|
107
107
|
*/
|
|
108
108
|
export declare class FrameTraceRecorder implements FrameTraceSink {
|
|
@@ -110,18 +110,18 @@ export declare class FrameTraceRecorder implements FrameTraceSink {
|
|
|
110
110
|
private _current;
|
|
111
111
|
tickBegin(tick: number, dt: number): void;
|
|
112
112
|
tickEnd(_tick: number): void;
|
|
113
|
-
|
|
113
|
+
systemBegin(system: SystemDescriptor, phase: PhaseName): void;
|
|
114
114
|
systemEnd(system: SystemDescriptor): void;
|
|
115
115
|
commandQueued(op: StructuralOp, entity: EntityID, component: number | null): void;
|
|
116
|
-
flushBegin(phase:
|
|
117
|
-
flushEnd(phase:
|
|
116
|
+
flushBegin(phase: PhaseName): void;
|
|
117
|
+
flushEnd(phase: PhaseName): void;
|
|
118
118
|
/** No-op. The recorder already marks this instant with
|
|
119
|
-
* `flushEnd`, and a per-phase fingerprint is a consumer concern
|
|
120
|
-
* holds no world reference to hash. The seam exists so a consumer's
|
|
121
|
-
* run code (e.g. `stateHash()`) at the safe post-flush point
|
|
119
|
+
* `flushEnd`, and a per-phase fingerprint is a consumer concern, the recorder
|
|
120
|
+
* holds no world reference to hash. The seam exists so a consumer's own sink can
|
|
121
|
+
* run code (e.g. `stateHash()`) at the safe post-flush point. The in-tree
|
|
122
122
|
* event-stream recorder has nothing to add, so it stays a stream of causal
|
|
123
123
|
* events, not fingerprints. */
|
|
124
|
-
phaseBoundary(_phase:
|
|
124
|
+
phaseBoundary(_phase: PhaseName): void;
|
|
125
125
|
observerFired(op: ObserverOp, component: number, entity: number, observer: SystemDescriptor): void;
|
|
126
126
|
eventEmitted(key: string): void;
|
|
127
127
|
eventRead(key: string, count: number): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frame_trace.d.ts","sourceRoot":"","sources":["../../../src/core/ecs/frame_trace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"frame_trace.d.ts","sourceRoot":"","sources":["../../../src/core/ecs/frame_trace.ts"],"names":[],"mappings":"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"}
|