@awesome-ecs/abstract 0.26.0 → 0.28.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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../src/entities/entity-queue.ts","../../src/entities/entity-scheduler.ts"],"sourcesContent":["import { IEntityModel } from './entity';\r\nimport { IEntityProxy } from './entity-proxies';\r\nimport { IEntitySnapshot } from './entity-snapshot';\r\n\r\n/**\r\n * Specifies the action to be performed on an entity.\r\n * Updates are categorized to enable different processing paths in the runtime.\r\n */\r\nexport enum EntityUpdateType {\r\n /**\r\n * Indicates the entity should be updated with new data.\r\n */\r\n update = 'update',\r\n /**\r\n * Indicates the entity should be removed from the system.\r\n */\r\n remove = 'remove'\r\n}\r\n\r\n/**\r\n * Represents a queued entity state change or removal.\r\n * Updates flow through the system to be processed by entity update handlers.\r\n */\r\nexport interface IEntityUpdate {\r\n /**\r\n * The type of operation: update or remove.\r\n */\r\n readonly type: EntityUpdateType;\r\n\r\n /**\r\n * The entity being affected by this update.\r\n */\r\n readonly entity: IEntityProxy;\r\n\r\n /**\r\n * Optional model data for initialization or reconfiguration.\r\n */\r\n readonly model?: IEntityModel;\r\n\r\n /**\r\n * Optional serialized state to apply to the entity.\r\n */\r\n readonly snapshot?: IEntitySnapshot;\r\n}\r\n\r\n/**\r\n * Queue interface for managing pending entity updates.\r\n * Different implementations may use different prioritization strategies (e.g., priority queues, FIFO, ordered by entity type).\r\n * Updates are consumed by the runtime and dispatched to appropriate entity systems.\r\n */\r\nexport interface IEntityUpdateQueue {\r\n /**\r\n * The current number of updates in the queue.\r\n */\r\n readonly size: number;\r\n\r\n /**\r\n * Adds an update to the queue for processing.\r\n * @param change - The update to queue.\r\n */\r\n enqueue(change: IEntityUpdate): void;\r\n\r\n /**\r\n * Removes and returns the next update from the queue.\r\n * The specific update returned depends on the queue's prioritization strategy.\r\n * @returns The next queued update.\r\n */\r\n dequeue(): IEntityUpdate;\r\n\r\n /**\r\n * Views the next update without removing it.\r\n * Useful for inspection before dequeuing.\r\n * @returns The next update in the queue.\r\n */\r\n peek(): IEntityUpdate;\r\n\r\n /**\r\n * Removes all updates from the queue.\r\n */\r\n clear(): void;\r\n}\r\n","import { EntityTypeUid } from './entity';\nimport { IEntityProxy } from './entity-proxies';\n\n/**\n * Describes a scheduled entity update, including the target entity and optional interval.\n */\nexport type EntitySchedule = {\n readonly proxy: IEntityProxy;\n readonly intervalMs?: number;\n};\n\n/**\n * Controls which scheduling modes are paused.\n */\nexport enum SchedulerPauseType {\n /** Pause both interval timers and frame subscriptions. */\n full = 'full',\n /** Pause only frame subscriptions. Interval timers continue firing. */\n perFrame = 'perFrame',\n /** Pause only interval timers. Frame subscriptions continue. */\n intervals = 'intervals'\n}\n\n/**\n * Manages time-based scheduling of entity updates.\n *\n * Entities can be scheduled with an interval (timer-driven) or without one (per-frame).\n * The runtime pulls pending entities each tick via the {@link pending} iterator,\n * which yields both per-frame subscriptions and interval entities whose timer has fired.\n */\nexport interface IEntityScheduler {\n /**\n * Returns all currently scheduled entities with their configuration.\n * Useful for inspection and debugging.\n */\n readonly schedules: ReadonlyArray<EntitySchedule>;\n\n /**\n * Yields entities pending processing this tick: per-frame subscriptions\n * followed by interval entities whose timer has fired since the last drain.\n * Iterating drains the due interval buckets; a second iteration without\n * timer advancement yields only per-frame subscriptions.\n */\n readonly pending: IterableIterator<IEntityProxy>;\n\n /**\n * The set of entities scheduled for per-frame updates (no interval).\n */\n readonly frameSubscriptions: ReadonlySet<IEntityProxy>;\n\n /**\n * The number of entities currently awaiting processing:\n * per-frame subscriptions (if not paused) plus interval entities whose timer has fired.\n */\n readonly pendingCount: number;\n\n /**\n * Whether the scheduler is currently paused in any mode.\n */\n readonly isPaused: boolean;\n\n /**\n * Registers an entity for updates.\n * @param entityProxy - The entity to schedule.\n * @param intervalMs - Update frequency in milliseconds. If omitted, the entity is scheduled per-frame.\n */\n schedule(entityProxy: IEntityProxy, intervalMs?: number): void;\n\n /**\n * Unregisters an entity from the scheduler.\n * @param entityProxy - The entity to unschedule.\n */\n remove(entityProxy: IEntityProxy): void;\n\n /**\n * Checks if an entity is currently scheduled for updates.\n * @param entityProxy - The entity to check.\n * @returns True if the entity is scheduled, false otherwise.\n */\n has(entityProxy: IEntityProxy): boolean;\n\n /**\n * Removes all schedules and clears all timers.\n */\n clear(): void;\n\n /**\n * Entity types currently excluded from {@link pending} iteration.\n */\n readonly skippedEntityTypes: ReadonlySet<EntityTypeUid>;\n\n /**\n * Excludes an entity type from {@link pending} iteration.\n * Entities remain registered; only yielding is suppressed.\n */\n skipEntityType(entityType: EntityTypeUid): void;\n\n /**\n * Re-includes a previously skipped entity type in {@link pending} iteration.\n */\n unskipEntityType(entityType: EntityTypeUid): void;\n\n /**\n * Pauses the scheduler.\n * @param type - Which scheduling modes to pause. Defaults to {@link SchedulerPauseType.full}.\n */\n pause(type?: SchedulerPauseType): void;\n\n /**\n * Resumes the scheduler from any paused state.\n */\n resume(): void;\n}\n"],"mappings":";;;;;;AAQA,IAAY,8DAAL;;;;AAIL;;;;AAIA;;;;;;;;;ACFF,IAAY,kEAAL;;AAEL;;AAEA;;AAEA"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../src/entities/entity-queue.ts","../../src/entities/entity-scheduler.ts"],"sourcesContent":["import { IEntityModel } from './entity';\r\nimport { IEntityProxy } from './entity-proxies';\r\nimport { IEntitySnapshot } from './entity-snapshot';\r\n\r\n/**\r\n * Specifies the action to be performed on an entity.\r\n * Updates are categorized to enable different processing paths in the runtime.\r\n */\r\nexport enum EntityUpdateType {\r\n /**\r\n * Indicates the entity should be updated with new data.\r\n */\r\n update = 'update',\r\n /**\r\n * Indicates the entity should be removed from the system.\r\n */\r\n remove = 'remove'\r\n}\r\n\r\n/**\r\n * Represents a queued entity state change or removal.\r\n * Updates flow through the system to be processed by entity update handlers.\r\n */\r\nexport interface IEntityUpdate {\r\n /**\r\n * The type of operation: update or remove.\r\n */\r\n readonly type: EntityUpdateType;\r\n\r\n /**\r\n * The entity being affected by this update.\r\n */\r\n readonly entity: IEntityProxy;\r\n\r\n /**\r\n * Optional model data for initialization or reconfiguration.\r\n */\r\n readonly model?: IEntityModel;\r\n\r\n /**\r\n * Optional serialized state to apply to the entity.\r\n */\r\n readonly snapshot?: IEntitySnapshot;\r\n}\r\n\r\n/**\r\n * Queue interface for managing pending entity updates.\r\n * Different implementations may use different prioritization strategies (e.g., priority queues, FIFO, ordered by entity type).\r\n * Updates are consumed by the runtime and dispatched to appropriate entity systems.\r\n */\r\nexport interface IEntityUpdateQueue {\r\n /**\r\n * The current number of updates in the queue.\r\n */\r\n readonly size: number;\r\n\r\n /**\r\n * Adds an update to the queue for processing.\r\n * @param change - The update to queue.\r\n */\r\n enqueue(change: IEntityUpdate): void;\r\n\r\n /**\r\n * Removes and returns the next update from the queue.\r\n * The specific update returned depends on the queue's prioritization strategy.\r\n * @returns The next queued update.\r\n */\r\n dequeue(): IEntityUpdate;\r\n\r\n /**\r\n * Views the next update without removing it.\r\n * Useful for inspection before dequeuing.\r\n * @returns The next update in the queue.\r\n */\r\n peek(): IEntityUpdate;\r\n\r\n /**\r\n * Removes all updates from the queue.\r\n */\r\n clear(): void;\r\n}\r\n","import { EntityTypeUid } from './entity';\r\nimport { IEntityProxy } from './entity-proxies';\r\n\r\n/**\r\n * Describes a scheduled entity update, including the target entity and optional interval.\r\n */\r\nexport type EntitySchedule = {\r\n readonly proxy: IEntityProxy;\r\n readonly intervalMs?: number;\r\n};\r\n\r\n/**\r\n * Controls which scheduling modes are paused.\r\n */\r\nexport enum SchedulerPauseType {\r\n /** Pause both interval timers and frame subscriptions. */\r\n full = 'full',\r\n /** Pause only frame subscriptions. Interval timers continue firing. */\r\n perFrame = 'perFrame',\r\n /** Pause only interval timers. Frame subscriptions continue. */\r\n intervals = 'intervals'\r\n}\r\n\r\n/**\r\n * Manages time-based scheduling of entity updates.\r\n *\r\n * Entities can be scheduled with an interval (timer-driven) or without one (per-frame).\r\n * The runtime pulls pending entities each tick via the {@link pending} iterator,\r\n * which yields both per-frame subscriptions and interval entities whose timer has fired.\r\n */\r\nexport interface IEntityScheduler {\r\n /**\r\n * Returns all currently scheduled entities with their configuration.\r\n * Useful for inspection and debugging.\r\n */\r\n readonly schedules: ReadonlyArray<EntitySchedule>;\r\n\r\n /**\r\n * Yields entities pending processing this tick: per-frame subscriptions\r\n * followed by interval entities whose timer has fired since the last drain.\r\n * Iterating drains the due interval buckets; a second iteration without\r\n * timer advancement yields only per-frame subscriptions.\r\n */\r\n readonly pending: IterableIterator<IEntityProxy>;\r\n\r\n /**\r\n * The set of entities scheduled for per-frame updates (no interval).\r\n */\r\n readonly frameSubscriptions: ReadonlySet<IEntityProxy>;\r\n\r\n /**\r\n * Entity types currently excluded from {@link pending} iteration.\r\n */\r\n readonly skippedEntityTypes: ReadonlySet<EntityTypeUid>;\r\n\r\n /**\r\n * The number of entities currently awaiting processing:\r\n * per-frame subscriptions (if not paused) plus interval entities whose timer has fired.\r\n */\r\n readonly pendingCount: number;\r\n\r\n /**\r\n * Whether the scheduler is currently paused in any mode.\r\n */\r\n readonly isPaused: boolean;\r\n\r\n /**\r\n * Registers an entity for updates.\r\n * @param entityProxy - The entity to schedule.\r\n * @param intervalMs - Update frequency in milliseconds. If omitted, the entity is scheduled per-frame.\r\n */\r\n schedule(entityProxy: IEntityProxy, intervalMs?: number): void;\r\n\r\n /**\r\n * Unregisters an entity from the scheduler.\r\n * @param entityProxy - The entity to unschedule.\r\n */\r\n remove(entityProxy: IEntityProxy): void;\r\n\r\n /**\r\n * Checks if an entity is currently scheduled for updates.\r\n * @param entityProxy - The entity to check.\r\n * @returns True if the entity is scheduled, false otherwise.\r\n */\r\n has(entityProxy: IEntityProxy): boolean;\r\n\r\n /**\r\n * Removes all schedules and clears all timers.\r\n */\r\n clear(): void;\r\n\r\n /**\r\n * Excludes an entity type from {@link pending} iteration.\r\n * Entities remain registered; only yielding is suppressed.\r\n */\r\n skipEntityType(entityType: EntityTypeUid): void;\r\n\r\n /**\r\n * Re-includes a previously skipped entity type in {@link pending} iteration.\r\n */\r\n unskipEntityType(entityType: EntityTypeUid): void;\r\n\r\n /**\r\n * Pauses the scheduler.\r\n * @param type - Which scheduling modes to pause. Defaults to {@link SchedulerPauseType.full}.\r\n */\r\n pause(type?: SchedulerPauseType): void;\r\n\r\n /**\r\n * Resumes the scheduler from any paused state.\r\n */\r\n resume(): void;\r\n}\r\n"],"mappings":";;;;;;AAQA,IAAY,8DAAL;;;;AAIL;;;;AAIA;;;;;;;;;ACFF,IAAY,kEAAL;;AAEL;;AAEA;;AAEA"}
@@ -1,3 +1,3 @@
1
1
  import { a as IEntity, c as IEntityProxy, d as TypedEntityProxy, i as EntityUid, l as IEntityProxyRepository, o as IEntityModel, r as EntityTypeUid, s as EntityProxy, u as RequiredProxies } from "../identity-component-uU0yDR-y.cjs";
2
- import { a as EntityUpdateType, c as IEntitySnapshot, d as EntityEventSubscriptionOptions, f as EntityEventUid, g as IEventData, h as IEntityEventsManager, i as IEntityRepository, l as IEntitySnapshotProvider, m as IEntityEventsDispatcher, n as IEntityScheduler, o as IEntityUpdate, p as IEntityEvent, r as SchedulerPauseType, s as IEntityUpdateQueue, t as EntitySchedule, u as EntityEventSubscriptionFilter } from "../index-D_z9RbVT.cjs";
2
+ import { a as EntityUpdateType, c as IEntitySnapshot, d as EntityEventSubscriptionOptions, f as EntityEventUid, g as IEventData, h as IEntityEventsManager, i as IEntityRepository, l as IEntitySnapshotProvider, m as IEntityEventsDispatcher, n as IEntityScheduler, o as IEntityUpdate, p as IEntityEvent, r as SchedulerPauseType, s as IEntityUpdateQueue, t as EntitySchedule, u as EntityEventSubscriptionFilter } from "../index-C1Ojam4M.cjs";
3
3
  export { EntityEventSubscriptionFilter, EntityEventSubscriptionOptions, EntityEventUid, EntityProxy, EntitySchedule, EntityTypeUid, EntityUid, EntityUpdateType, IEntity, IEntityEvent, IEntityEventsDispatcher, IEntityEventsManager, IEntityModel, IEntityProxy, IEntityProxyRepository, IEntityRepository, IEntityScheduler, IEntitySnapshot, IEntitySnapshotProvider, IEntityUpdate, IEntityUpdateQueue, IEventData, RequiredProxies, SchedulerPauseType, TypedEntityProxy };
@@ -1,3 +1,3 @@
1
1
  import { a as IEntity, c as IEntityProxy, d as TypedEntityProxy, i as EntityUid, l as IEntityProxyRepository, o as IEntityModel, r as EntityTypeUid, s as EntityProxy, u as RequiredProxies } from "../identity-component-CgzvgBVh.mjs";
2
- import { a as EntityUpdateType, c as IEntitySnapshot, d as EntityEventSubscriptionOptions, f as EntityEventUid, g as IEventData, h as IEntityEventsManager, i as IEntityRepository, l as IEntitySnapshotProvider, m as IEntityEventsDispatcher, n as IEntityScheduler, o as IEntityUpdate, p as IEntityEvent, r as SchedulerPauseType, s as IEntityUpdateQueue, t as EntitySchedule, u as EntityEventSubscriptionFilter } from "../index-ke1H7wmC.mjs";
2
+ import { a as EntityUpdateType, c as IEntitySnapshot, d as EntityEventSubscriptionOptions, f as EntityEventUid, g as IEventData, h as IEntityEventsManager, i as IEntityRepository, l as IEntitySnapshotProvider, m as IEntityEventsDispatcher, n as IEntityScheduler, o as IEntityUpdate, p as IEntityEvent, r as SchedulerPauseType, s as IEntityUpdateQueue, t as EntitySchedule, u as EntityEventSubscriptionFilter } from "../index-C0v9GTM7.mjs";
3
3
  export { EntityEventSubscriptionFilter, EntityEventSubscriptionOptions, EntityEventUid, EntityProxy, EntitySchedule, EntityTypeUid, EntityUid, EntityUpdateType, IEntity, IEntityEvent, IEntityEventsDispatcher, IEntityEventsManager, IEntityModel, IEntityProxy, IEntityProxyRepository, IEntityRepository, IEntityScheduler, IEntitySnapshot, IEntitySnapshotProvider, IEntityUpdate, IEntityUpdateQueue, IEventData, RequiredProxies, SchedulerPauseType, TypedEntityProxy };
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../src/entities/entity-queue.ts","../../src/entities/entity-scheduler.ts"],"sourcesContent":["import { IEntityModel } from './entity';\r\nimport { IEntityProxy } from './entity-proxies';\r\nimport { IEntitySnapshot } from './entity-snapshot';\r\n\r\n/**\r\n * Specifies the action to be performed on an entity.\r\n * Updates are categorized to enable different processing paths in the runtime.\r\n */\r\nexport enum EntityUpdateType {\r\n /**\r\n * Indicates the entity should be updated with new data.\r\n */\r\n update = 'update',\r\n /**\r\n * Indicates the entity should be removed from the system.\r\n */\r\n remove = 'remove'\r\n}\r\n\r\n/**\r\n * Represents a queued entity state change or removal.\r\n * Updates flow through the system to be processed by entity update handlers.\r\n */\r\nexport interface IEntityUpdate {\r\n /**\r\n * The type of operation: update or remove.\r\n */\r\n readonly type: EntityUpdateType;\r\n\r\n /**\r\n * The entity being affected by this update.\r\n */\r\n readonly entity: IEntityProxy;\r\n\r\n /**\r\n * Optional model data for initialization or reconfiguration.\r\n */\r\n readonly model?: IEntityModel;\r\n\r\n /**\r\n * Optional serialized state to apply to the entity.\r\n */\r\n readonly snapshot?: IEntitySnapshot;\r\n}\r\n\r\n/**\r\n * Queue interface for managing pending entity updates.\r\n * Different implementations may use different prioritization strategies (e.g., priority queues, FIFO, ordered by entity type).\r\n * Updates are consumed by the runtime and dispatched to appropriate entity systems.\r\n */\r\nexport interface IEntityUpdateQueue {\r\n /**\r\n * The current number of updates in the queue.\r\n */\r\n readonly size: number;\r\n\r\n /**\r\n * Adds an update to the queue for processing.\r\n * @param change - The update to queue.\r\n */\r\n enqueue(change: IEntityUpdate): void;\r\n\r\n /**\r\n * Removes and returns the next update from the queue.\r\n * The specific update returned depends on the queue's prioritization strategy.\r\n * @returns The next queued update.\r\n */\r\n dequeue(): IEntityUpdate;\r\n\r\n /**\r\n * Views the next update without removing it.\r\n * Useful for inspection before dequeuing.\r\n * @returns The next update in the queue.\r\n */\r\n peek(): IEntityUpdate;\r\n\r\n /**\r\n * Removes all updates from the queue.\r\n */\r\n clear(): void;\r\n}\r\n","import { EntityTypeUid } from './entity';\nimport { IEntityProxy } from './entity-proxies';\n\n/**\n * Describes a scheduled entity update, including the target entity and optional interval.\n */\nexport type EntitySchedule = {\n readonly proxy: IEntityProxy;\n readonly intervalMs?: number;\n};\n\n/**\n * Controls which scheduling modes are paused.\n */\nexport enum SchedulerPauseType {\n /** Pause both interval timers and frame subscriptions. */\n full = 'full',\n /** Pause only frame subscriptions. Interval timers continue firing. */\n perFrame = 'perFrame',\n /** Pause only interval timers. Frame subscriptions continue. */\n intervals = 'intervals'\n}\n\n/**\n * Manages time-based scheduling of entity updates.\n *\n * Entities can be scheduled with an interval (timer-driven) or without one (per-frame).\n * The runtime pulls pending entities each tick via the {@link pending} iterator,\n * which yields both per-frame subscriptions and interval entities whose timer has fired.\n */\nexport interface IEntityScheduler {\n /**\n * Returns all currently scheduled entities with their configuration.\n * Useful for inspection and debugging.\n */\n readonly schedules: ReadonlyArray<EntitySchedule>;\n\n /**\n * Yields entities pending processing this tick: per-frame subscriptions\n * followed by interval entities whose timer has fired since the last drain.\n * Iterating drains the due interval buckets; a second iteration without\n * timer advancement yields only per-frame subscriptions.\n */\n readonly pending: IterableIterator<IEntityProxy>;\n\n /**\n * The set of entities scheduled for per-frame updates (no interval).\n */\n readonly frameSubscriptions: ReadonlySet<IEntityProxy>;\n\n /**\n * The number of entities currently awaiting processing:\n * per-frame subscriptions (if not paused) plus interval entities whose timer has fired.\n */\n readonly pendingCount: number;\n\n /**\n * Whether the scheduler is currently paused in any mode.\n */\n readonly isPaused: boolean;\n\n /**\n * Registers an entity for updates.\n * @param entityProxy - The entity to schedule.\n * @param intervalMs - Update frequency in milliseconds. If omitted, the entity is scheduled per-frame.\n */\n schedule(entityProxy: IEntityProxy, intervalMs?: number): void;\n\n /**\n * Unregisters an entity from the scheduler.\n * @param entityProxy - The entity to unschedule.\n */\n remove(entityProxy: IEntityProxy): void;\n\n /**\n * Checks if an entity is currently scheduled for updates.\n * @param entityProxy - The entity to check.\n * @returns True if the entity is scheduled, false otherwise.\n */\n has(entityProxy: IEntityProxy): boolean;\n\n /**\n * Removes all schedules and clears all timers.\n */\n clear(): void;\n\n /**\n * Entity types currently excluded from {@link pending} iteration.\n */\n readonly skippedEntityTypes: ReadonlySet<EntityTypeUid>;\n\n /**\n * Excludes an entity type from {@link pending} iteration.\n * Entities remain registered; only yielding is suppressed.\n */\n skipEntityType(entityType: EntityTypeUid): void;\n\n /**\n * Re-includes a previously skipped entity type in {@link pending} iteration.\n */\n unskipEntityType(entityType: EntityTypeUid): void;\n\n /**\n * Pauses the scheduler.\n * @param type - Which scheduling modes to pause. Defaults to {@link SchedulerPauseType.full}.\n */\n pause(type?: SchedulerPauseType): void;\n\n /**\n * Resumes the scheduler from any paused state.\n */\n resume(): void;\n}\n"],"mappings":";;;;;AAQA,IAAY,8DAAL;;;;AAIL;;;;AAIA;;;;;;;;;ACFF,IAAY,kEAAL;;AAEL;;AAEA;;AAEA"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../src/entities/entity-queue.ts","../../src/entities/entity-scheduler.ts"],"sourcesContent":["import { IEntityModel } from './entity';\r\nimport { IEntityProxy } from './entity-proxies';\r\nimport { IEntitySnapshot } from './entity-snapshot';\r\n\r\n/**\r\n * Specifies the action to be performed on an entity.\r\n * Updates are categorized to enable different processing paths in the runtime.\r\n */\r\nexport enum EntityUpdateType {\r\n /**\r\n * Indicates the entity should be updated with new data.\r\n */\r\n update = 'update',\r\n /**\r\n * Indicates the entity should be removed from the system.\r\n */\r\n remove = 'remove'\r\n}\r\n\r\n/**\r\n * Represents a queued entity state change or removal.\r\n * Updates flow through the system to be processed by entity update handlers.\r\n */\r\nexport interface IEntityUpdate {\r\n /**\r\n * The type of operation: update or remove.\r\n */\r\n readonly type: EntityUpdateType;\r\n\r\n /**\r\n * The entity being affected by this update.\r\n */\r\n readonly entity: IEntityProxy;\r\n\r\n /**\r\n * Optional model data for initialization or reconfiguration.\r\n */\r\n readonly model?: IEntityModel;\r\n\r\n /**\r\n * Optional serialized state to apply to the entity.\r\n */\r\n readonly snapshot?: IEntitySnapshot;\r\n}\r\n\r\n/**\r\n * Queue interface for managing pending entity updates.\r\n * Different implementations may use different prioritization strategies (e.g., priority queues, FIFO, ordered by entity type).\r\n * Updates are consumed by the runtime and dispatched to appropriate entity systems.\r\n */\r\nexport interface IEntityUpdateQueue {\r\n /**\r\n * The current number of updates in the queue.\r\n */\r\n readonly size: number;\r\n\r\n /**\r\n * Adds an update to the queue for processing.\r\n * @param change - The update to queue.\r\n */\r\n enqueue(change: IEntityUpdate): void;\r\n\r\n /**\r\n * Removes and returns the next update from the queue.\r\n * The specific update returned depends on the queue's prioritization strategy.\r\n * @returns The next queued update.\r\n */\r\n dequeue(): IEntityUpdate;\r\n\r\n /**\r\n * Views the next update without removing it.\r\n * Useful for inspection before dequeuing.\r\n * @returns The next update in the queue.\r\n */\r\n peek(): IEntityUpdate;\r\n\r\n /**\r\n * Removes all updates from the queue.\r\n */\r\n clear(): void;\r\n}\r\n","import { EntityTypeUid } from './entity';\r\nimport { IEntityProxy } from './entity-proxies';\r\n\r\n/**\r\n * Describes a scheduled entity update, including the target entity and optional interval.\r\n */\r\nexport type EntitySchedule = {\r\n readonly proxy: IEntityProxy;\r\n readonly intervalMs?: number;\r\n};\r\n\r\n/**\r\n * Controls which scheduling modes are paused.\r\n */\r\nexport enum SchedulerPauseType {\r\n /** Pause both interval timers and frame subscriptions. */\r\n full = 'full',\r\n /** Pause only frame subscriptions. Interval timers continue firing. */\r\n perFrame = 'perFrame',\r\n /** Pause only interval timers. Frame subscriptions continue. */\r\n intervals = 'intervals'\r\n}\r\n\r\n/**\r\n * Manages time-based scheduling of entity updates.\r\n *\r\n * Entities can be scheduled with an interval (timer-driven) or without one (per-frame).\r\n * The runtime pulls pending entities each tick via the {@link pending} iterator,\r\n * which yields both per-frame subscriptions and interval entities whose timer has fired.\r\n */\r\nexport interface IEntityScheduler {\r\n /**\r\n * Returns all currently scheduled entities with their configuration.\r\n * Useful for inspection and debugging.\r\n */\r\n readonly schedules: ReadonlyArray<EntitySchedule>;\r\n\r\n /**\r\n * Yields entities pending processing this tick: per-frame subscriptions\r\n * followed by interval entities whose timer has fired since the last drain.\r\n * Iterating drains the due interval buckets; a second iteration without\r\n * timer advancement yields only per-frame subscriptions.\r\n */\r\n readonly pending: IterableIterator<IEntityProxy>;\r\n\r\n /**\r\n * The set of entities scheduled for per-frame updates (no interval).\r\n */\r\n readonly frameSubscriptions: ReadonlySet<IEntityProxy>;\r\n\r\n /**\r\n * Entity types currently excluded from {@link pending} iteration.\r\n */\r\n readonly skippedEntityTypes: ReadonlySet<EntityTypeUid>;\r\n\r\n /**\r\n * The number of entities currently awaiting processing:\r\n * per-frame subscriptions (if not paused) plus interval entities whose timer has fired.\r\n */\r\n readonly pendingCount: number;\r\n\r\n /**\r\n * Whether the scheduler is currently paused in any mode.\r\n */\r\n readonly isPaused: boolean;\r\n\r\n /**\r\n * Registers an entity for updates.\r\n * @param entityProxy - The entity to schedule.\r\n * @param intervalMs - Update frequency in milliseconds. If omitted, the entity is scheduled per-frame.\r\n */\r\n schedule(entityProxy: IEntityProxy, intervalMs?: number): void;\r\n\r\n /**\r\n * Unregisters an entity from the scheduler.\r\n * @param entityProxy - The entity to unschedule.\r\n */\r\n remove(entityProxy: IEntityProxy): void;\r\n\r\n /**\r\n * Checks if an entity is currently scheduled for updates.\r\n * @param entityProxy - The entity to check.\r\n * @returns True if the entity is scheduled, false otherwise.\r\n */\r\n has(entityProxy: IEntityProxy): boolean;\r\n\r\n /**\r\n * Removes all schedules and clears all timers.\r\n */\r\n clear(): void;\r\n\r\n /**\r\n * Excludes an entity type from {@link pending} iteration.\r\n * Entities remain registered; only yielding is suppressed.\r\n */\r\n skipEntityType(entityType: EntityTypeUid): void;\r\n\r\n /**\r\n * Re-includes a previously skipped entity type in {@link pending} iteration.\r\n */\r\n unskipEntityType(entityType: EntityTypeUid): void;\r\n\r\n /**\r\n * Pauses the scheduler.\r\n * @param type - Which scheduling modes to pause. Defaults to {@link SchedulerPauseType.full}.\r\n */\r\n pause(type?: SchedulerPauseType): void;\r\n\r\n /**\r\n * Resumes the scheduler from any paused state.\r\n */\r\n resume(): void;\r\n}\r\n"],"mappings":";;;;;AAQA,IAAY,8DAAL;;;;AAIL;;;;AAIA;;;;;;;;;ACFF,IAAY,kEAAL;;AAEL;;AAEA;;AAEA"}
@@ -1,6 +1,6 @@
1
1
  import { a as IEntity } from "../identity-component-uU0yDR-y.cjs";
2
- import { l as IPipelineContext, o as IPipeline } from "../index-cF9FviwN.cjs";
3
- import { n as ISystemsRuntimeContext, o as ISystemsModuleBuilder, u as ISystemContext } from "../index-BoBx4MQT.cjs";
2
+ import { l as IPipelineContext, o as IPipeline } from "../index-BQojRXVz.cjs";
3
+ import { n as ISystemsRuntimeContext, o as ISystemsModuleBuilder, u as ISystemContext } from "../index-CrMUhuEK.cjs";
4
4
 
5
5
  //#region src/factories/context-factory.d.ts
6
6
  interface IContextFactory {
@@ -1,6 +1,6 @@
1
1
  import { a as IEntity } from "../identity-component-CgzvgBVh.mjs";
2
- import { l as IPipelineContext, o as IPipeline } from "../index-CyoGuBNw.mjs";
3
- import { n as ISystemsRuntimeContext, o as ISystemsModuleBuilder, u as ISystemContext } from "../index-CBIhhk81.mjs";
2
+ import { l as IPipelineContext, o as IPipeline } from "../index-DeYfvKO0.mjs";
3
+ import { n as ISystemsRuntimeContext, o as ISystemsModuleBuilder, u as ISystemContext } from "../index-DQYLun1o.mjs";
4
4
 
5
5
  //#region src/factories/context-factory.d.ts
6
6
  interface IContextFactory {
@@ -1,5 +1,5 @@
1
1
  import { n as Immutable } from "./types-DLOd2zXO.cjs";
2
- import { r as PerformanceTimeEntry } from "./index-CmTRwW4W.cjs";
2
+ import { r as PerformanceTimeEntry } from "./index-Cs9Eerjt.cjs";
3
3
 
4
4
  //#region src/pipelines/pipeline-context.d.ts
5
5
  /**
@@ -221,4 +221,4 @@ interface IPipelineRunner<TContext extends IPipelineContext> {
221
221
  }
222
222
  //#endregion
223
223
  export { IParentMiddleware as a, IMiddleware as c, IParentContext as i, IPipelineContext as l, INestedContext as n, IPipeline as o, INestedMiddleware as r, IMiddlewareRunner as s, IPipelineRunner as t, PipelineRuntime as u };
224
- //# sourceMappingURL=index-cF9FviwN.d.cts.map
224
+ //# sourceMappingURL=index-BQojRXVz.d.cts.map
@@ -110,22 +110,38 @@ interface IEntityEventsManager {
110
110
  /**
111
111
  * Event dispatcher for publishing events to interested entities.
112
112
  * Responsible for routing events to their subscribers through the update queue.
113
+ *
114
+ * Use `dispatchEvent` / `dispatchEvents` for targeted delivery (requires explicit targets).
115
+ * Use `broadcastEvent` / `broadcastEvents` for subscription-based delivery to all subscribers.
113
116
  */
114
117
  interface IEntityEventsDispatcher {
115
118
  /**
116
- * Publishes a single event to subscribers.
117
- * The event is routed based on subscriptions or explicit target(s).
119
+ * Publishes a single event to one or more explicit targets.
120
+ * The event is sent only to the specified target(s) — it does NOT fall back to subscriptions.
118
121
  * @param event - The event to dispatch.
119
- * @param targets - Optional specific entities to send to. If provided, event is only sent to these targets.
122
+ * @param target - The entity or entities to send the event to.
120
123
  */
121
- dispatchEvent(event: IEntityEvent<IEventData>, ...targets: IEntityProxy[]): void;
124
+ dispatchEvent(event: IEntityEvent<IEventData>, target: IEntityProxy | IEntityProxy[]): void;
122
125
  /**
123
- * Publishes multiple events to subscribers.
124
- * Efficiently dispatches an array of events in bulk.
126
+ * Publishes multiple events to one or more explicit targets.
127
+ * Each target receives all events in a single update.
125
128
  * @param events - The events to dispatch.
126
- * @param targets - Optional specific entities to send to. If provided, events are only sent to these targets.
129
+ * @param target - The entity or entities to send the events to.
130
+ */
131
+ dispatchEvents(events: IEntityEvent<IEventData>[], target: IEntityProxy | IEntityProxy[]): void;
132
+ /**
133
+ * Broadcasts a single event to all subscribers registered for that event type.
134
+ * Uses the subscription registry to resolve targets. Use intentionally — this can
135
+ * generate O(N) queue entries where N is the subscriber count.
136
+ * @param event - The event to broadcast.
127
137
  */
128
- dispatchEvents(events: IEntityEvent<IEventData>[], ...targets: IEntityProxy[]): void;
138
+ broadcastEvent(event: IEntityEvent<IEventData>): void;
139
+ /**
140
+ * Broadcasts multiple events to all subscribers.
141
+ * Events are grouped per subscriber so each receives a single update.
142
+ * @param events - The events to broadcast.
143
+ */
144
+ broadcastEvents(events: IEntityEvent<IEventData>[]): void;
129
145
  }
130
146
  //#endregion
131
147
  //#region src/entities/entity-snapshot.d.ts
@@ -341,6 +357,10 @@ interface IEntityScheduler {
341
357
  * The set of entities scheduled for per-frame updates (no interval).
342
358
  */
343
359
  readonly frameSubscriptions: ReadonlySet<IEntityProxy>;
360
+ /**
361
+ * Entity types currently excluded from {@link pending} iteration.
362
+ */
363
+ readonly skippedEntityTypes: ReadonlySet<EntityTypeUid>;
344
364
  /**
345
365
  * The number of entities currently awaiting processing:
346
366
  * per-frame subscriptions (if not paused) plus interval entities whose timer has fired.
@@ -371,10 +391,6 @@ interface IEntityScheduler {
371
391
  * Removes all schedules and clears all timers.
372
392
  */
373
393
  clear(): void;
374
- /**
375
- * Entity types currently excluded from {@link pending} iteration.
376
- */
377
- readonly skippedEntityTypes: ReadonlySet<EntityTypeUid>;
378
394
  /**
379
395
  * Excludes an entity type from {@link pending} iteration.
380
396
  * Entities remain registered; only yielding is suppressed.
@@ -396,4 +412,4 @@ interface IEntityScheduler {
396
412
  }
397
413
  //#endregion
398
414
  export { EntityUpdateType as a, IEntitySnapshot as c, EntityEventSubscriptionOptions as d, EntityEventUid as f, IEventData as g, IEntityEventsManager as h, IEntityRepository as i, IEntitySnapshotProvider as l, IEntityEventsDispatcher as m, IEntityScheduler as n, IEntityUpdate as o, IEntityEvent as p, SchedulerPauseType as r, IEntityUpdateQueue as s, EntitySchedule as t, EntityEventSubscriptionFilter as u };
399
- //# sourceMappingURL=index-ke1H7wmC.d.mts.map
415
+ //# sourceMappingURL=index-C0v9GTM7.d.mts.map
@@ -110,22 +110,38 @@ interface IEntityEventsManager {
110
110
  /**
111
111
  * Event dispatcher for publishing events to interested entities.
112
112
  * Responsible for routing events to their subscribers through the update queue.
113
+ *
114
+ * Use `dispatchEvent` / `dispatchEvents` for targeted delivery (requires explicit targets).
115
+ * Use `broadcastEvent` / `broadcastEvents` for subscription-based delivery to all subscribers.
113
116
  */
114
117
  interface IEntityEventsDispatcher {
115
118
  /**
116
- * Publishes a single event to subscribers.
117
- * The event is routed based on subscriptions or explicit target(s).
119
+ * Publishes a single event to one or more explicit targets.
120
+ * The event is sent only to the specified target(s) — it does NOT fall back to subscriptions.
118
121
  * @param event - The event to dispatch.
119
- * @param targets - Optional specific entities to send to. If provided, event is only sent to these targets.
122
+ * @param target - The entity or entities to send the event to.
120
123
  */
121
- dispatchEvent(event: IEntityEvent<IEventData>, ...targets: IEntityProxy[]): void;
124
+ dispatchEvent(event: IEntityEvent<IEventData>, target: IEntityProxy | IEntityProxy[]): void;
122
125
  /**
123
- * Publishes multiple events to subscribers.
124
- * Efficiently dispatches an array of events in bulk.
126
+ * Publishes multiple events to one or more explicit targets.
127
+ * Each target receives all events in a single update.
125
128
  * @param events - The events to dispatch.
126
- * @param targets - Optional specific entities to send to. If provided, events are only sent to these targets.
129
+ * @param target - The entity or entities to send the events to.
130
+ */
131
+ dispatchEvents(events: IEntityEvent<IEventData>[], target: IEntityProxy | IEntityProxy[]): void;
132
+ /**
133
+ * Broadcasts a single event to all subscribers registered for that event type.
134
+ * Uses the subscription registry to resolve targets. Use intentionally — this can
135
+ * generate O(N) queue entries where N is the subscriber count.
136
+ * @param event - The event to broadcast.
127
137
  */
128
- dispatchEvents(events: IEntityEvent<IEventData>[], ...targets: IEntityProxy[]): void;
138
+ broadcastEvent(event: IEntityEvent<IEventData>): void;
139
+ /**
140
+ * Broadcasts multiple events to all subscribers.
141
+ * Events are grouped per subscriber so each receives a single update.
142
+ * @param events - The events to broadcast.
143
+ */
144
+ broadcastEvents(events: IEntityEvent<IEventData>[]): void;
129
145
  }
130
146
  //#endregion
131
147
  //#region src/entities/entity-snapshot.d.ts
@@ -341,6 +357,10 @@ interface IEntityScheduler {
341
357
  * The set of entities scheduled for per-frame updates (no interval).
342
358
  */
343
359
  readonly frameSubscriptions: ReadonlySet<IEntityProxy>;
360
+ /**
361
+ * Entity types currently excluded from {@link pending} iteration.
362
+ */
363
+ readonly skippedEntityTypes: ReadonlySet<EntityTypeUid>;
344
364
  /**
345
365
  * The number of entities currently awaiting processing:
346
366
  * per-frame subscriptions (if not paused) plus interval entities whose timer has fired.
@@ -371,10 +391,6 @@ interface IEntityScheduler {
371
391
  * Removes all schedules and clears all timers.
372
392
  */
373
393
  clear(): void;
374
- /**
375
- * Entity types currently excluded from {@link pending} iteration.
376
- */
377
- readonly skippedEntityTypes: ReadonlySet<EntityTypeUid>;
378
394
  /**
379
395
  * Excludes an entity type from {@link pending} iteration.
380
396
  * Entities remain registered; only yielding is suppressed.
@@ -396,4 +412,4 @@ interface IEntityScheduler {
396
412
  }
397
413
  //#endregion
398
414
  export { EntityUpdateType as a, IEntitySnapshot as c, EntityEventSubscriptionOptions as d, EntityEventUid as f, IEventData as g, IEntityEventsManager as h, IEntityRepository as i, IEntitySnapshotProvider as l, IEntityEventsDispatcher as m, IEntityScheduler as n, IEntityUpdate as o, IEntityEvent as p, SchedulerPauseType as r, IEntityUpdateQueue as s, EntitySchedule as t, EntityEventSubscriptionFilter as u };
399
- //# sourceMappingURL=index-D_z9RbVT.d.cts.map
415
+ //# sourceMappingURL=index-C1Ojam4M.d.cts.map
@@ -1,8 +1,8 @@
1
1
  import { a as IEntity, c as IEntityProxy, l as IEntityProxyRepository, o as IEntityModel, r as EntityTypeUid, s as EntityProxy } from "./identity-component-uU0yDR-y.cjs";
2
2
  import { n as Immutable } from "./types-DLOd2zXO.cjs";
3
- import { c as IEntitySnapshot, d as EntityEventSubscriptionOptions, f as EntityEventUid, g as IEventData, o as IEntityUpdate, p as IEntityEvent } from "./index-D_z9RbVT.cjs";
4
- import { a as ILogger, c as IJsonSerializer, r as PerformanceTimeEntry } from "./index-CmTRwW4W.cjs";
5
- import { c as IMiddleware, l as IPipelineContext, o as IPipeline } from "./index-cF9FviwN.cjs";
3
+ import { c as IEntitySnapshot, d as EntityEventSubscriptionOptions, f as EntityEventUid, g as IEventData, o as IEntityUpdate, p as IEntityEvent } from "./index-C1Ojam4M.cjs";
4
+ import { a as ILogger, c as IJsonSerializer, r as PerformanceTimeEntry } from "./index-Cs9Eerjt.cjs";
5
+ import { c as IMiddleware, l as IPipelineContext, o as IPipeline } from "./index-BQojRXVz.cjs";
6
6
 
7
7
  //#region src/systems/pipeline/system-context-events.d.ts
8
8
  /**
@@ -12,20 +12,31 @@ import { c as IMiddleware, l as IPipelineContext, o as IPipeline } from "./index
12
12
  */
13
13
  interface ISystemContextEvents {
14
14
  /**
15
- * Publishes an event to subscribers or specific targets.
16
- * If targets are provided, event is sent only to those entities.
17
- * Otherwise, event is routed to all subscribers based on subscription registry.
15
+ * Publishes an event to one or more explicit targets.
16
+ * The event is sent only to the specified target(s) — it does NOT fall back to subscriptions.
18
17
  * @param data - The event payload.
19
- * @param targets - Optional specific entities to send to.
18
+ * @param target - The entity or entities to send the event to.
20
19
  */
21
- dispatchEvent<TEventData extends IEventData>(data: TEventData, ...targets: IEntityProxy[]): void;
20
+ dispatchEvent<TEventData extends IEventData>(data: TEventData, target: IEntityProxy | IEntityProxy[]): void;
22
21
  /**
23
- * Publishes multiple events in bulk.
24
- * More efficient than calling dispatchEvent repeatedly.
22
+ * Publishes multiple events to one or more explicit targets.
23
+ * Each target receives all events in a single update.
25
24
  * @param data - Array of event payloads to dispatch.
26
- * @param targets - Optional specific entities to send to.
25
+ * @param target - The entity or entities to send the events to.
27
26
  */
28
- dispatchEvents<TEventData extends IEventData>(data: TEventData[], ...targets: IEntityProxy[]): void;
27
+ dispatchEvents<TEventData extends IEventData>(data: TEventData[], target: IEntityProxy | IEntityProxy[]): void;
28
+ /**
29
+ * Broadcasts an event to all subscribers registered for that event type.
30
+ * Uses the subscription registry to resolve targets.
31
+ * @param data - The event payload.
32
+ */
33
+ broadcastEvent<TEventData extends IEventData>(data: TEventData): void;
34
+ /**
35
+ * Broadcasts multiple events to all subscribers.
36
+ * Events are grouped per subscriber so each receives a single update.
37
+ * @param data - Array of event payloads to broadcast.
38
+ */
39
+ broadcastEvents<TEventData extends IEventData>(data: TEventData[]): void;
29
40
  /**
30
41
  * Retrieves an event from the current context by its identifier.
31
42
  * Useful for checking if an event was received this frame.
@@ -188,6 +199,12 @@ interface ISystemContextScheduler {
188
199
  * @param target - Optional entity to unschedule. Defaults to current entity in context.
189
200
  */
190
201
  removeSchedule(target?: IEntityProxy): void;
202
+ /**
203
+ * Checks whether an entity has a scheduled update.
204
+ * If no target is specified, checks the current entity.
205
+ * @param target - Optional entity to check. Defaults to current entity in context.
206
+ */
207
+ hasSchedule(target?: IEntityProxy): boolean;
191
208
  }
192
209
  //#endregion
193
210
  //#region src/systems/pipeline/system-context-snapshot.d.ts
@@ -365,6 +382,14 @@ interface ISystemsModuleBuilder<TEntity extends IEntity> {
365
382
  * Accessible during and after construction.
366
383
  */
367
384
  readonly pipelines: ReadonlyMap<SystemType, IPipeline<ISystemContext<TEntity>>>;
385
+ /**
386
+ * Whether this entity type is a scope root.
387
+ */
388
+ readonly scopeRoot: boolean;
389
+ /**
390
+ * Whether this entity type is a scoped proxy.
391
+ */
392
+ readonly scopedProxy: boolean;
368
393
  /**
369
394
  * Registers middleware systems for a specific pipeline stage.
370
395
  * The middleware are added to the pipeline in the order provided.
@@ -516,4 +541,4 @@ interface ISystemsRuntimeContext<TEntity extends IEntity> extends IPipelineConte
516
541
  type ISystemsRuntimeMiddleware<TEntity extends IEntity> = IMiddleware<ISystemsRuntimeContext<TEntity>>;
517
542
  //#endregion
518
543
  export { ISystemsModuleRepository as a, ISystemsModule as c, ISystemContextSnapshot as d, ISystemContextScheduler as f, ISystemContextEvents as h, ISystemContextEntity as i, SystemType as l, ISystemContextProxies as m, ISystemsRuntimeContext as n, ISystemsModuleBuilder as o, ISystemContextRepository as p, ISystemsRuntime as r, ISystemMiddleware as s, ISystemsRuntimeMiddleware as t, ISystemContext as u };
519
- //# sourceMappingURL=index-BoBx4MQT.d.cts.map
544
+ //# sourceMappingURL=index-CrMUhuEK.d.cts.map
@@ -1,3 +1,17 @@
1
+ //#region src/utils/dispatch-sequential.d.ts
2
+ /**
3
+ * Executes a function for each item in an iterable, sequentially.
4
+ *
5
+ * Uses a sync fast-path: iterates synchronously until the first Promise is
6
+ * encountered, then switches to async for the remainder. If no item produces
7
+ * a Promise, the entire call stays synchronous with zero async overhead.
8
+ *
9
+ * @param items - The iterable to iterate over.
10
+ * @param fn - The function to call for each item. May return void or a Promise.
11
+ * @returns void if all calls were synchronous, or a Promise if any were async.
12
+ */
13
+ declare function dispatchSequential<T>(items: Iterable<T>, fn: (item: T) => void | Promise<void>): void | Promise<void>;
14
+ //#endregion
1
15
  //#region src/utils/json-serializer.d.ts
2
16
  /**
3
17
  * Custom JSON serialization and deserialization interface.
@@ -157,5 +171,5 @@ interface IPerformanceTimer {
157
171
  endTimer(timerUid: PerformanceTimerUid): PerformanceTimeEntry;
158
172
  }
159
173
  //#endregion
160
- export { ILogger as a, IJsonSerializer as c, PerformanceTimerUid as i, PerformanceMetricOptions as n, ILoggerOptions as o, PerformanceTimeEntry as r, LogLevel as s, IPerformanceTimer as t };
161
- //# sourceMappingURL=index-Iqc9jR5E.d.mts.map
174
+ export { ILogger as a, IJsonSerializer as c, PerformanceTimerUid as i, dispatchSequential as l, PerformanceMetricOptions as n, ILoggerOptions as o, PerformanceTimeEntry as r, LogLevel as s, IPerformanceTimer as t };
175
+ //# sourceMappingURL=index-Cs9Eerjt.d.cts.map
@@ -1,8 +1,8 @@
1
1
  import { a as IEntity, c as IEntityProxy, l as IEntityProxyRepository, o as IEntityModel, r as EntityTypeUid, s as EntityProxy } from "./identity-component-CgzvgBVh.mjs";
2
2
  import { n as Immutable } from "./types-CnDtpKsY.mjs";
3
- import { c as IEntitySnapshot, d as EntityEventSubscriptionOptions, f as EntityEventUid, g as IEventData, o as IEntityUpdate, p as IEntityEvent } from "./index-ke1H7wmC.mjs";
4
- import { a as ILogger, c as IJsonSerializer, r as PerformanceTimeEntry } from "./index-Iqc9jR5E.mjs";
5
- import { c as IMiddleware, l as IPipelineContext, o as IPipeline } from "./index-CyoGuBNw.mjs";
3
+ import { c as IEntitySnapshot, d as EntityEventSubscriptionOptions, f as EntityEventUid, g as IEventData, o as IEntityUpdate, p as IEntityEvent } from "./index-C0v9GTM7.mjs";
4
+ import { a as ILogger, c as IJsonSerializer, r as PerformanceTimeEntry } from "./index-hHkhvmkO.mjs";
5
+ import { c as IMiddleware, l as IPipelineContext, o as IPipeline } from "./index-DeYfvKO0.mjs";
6
6
 
7
7
  //#region src/systems/pipeline/system-context-events.d.ts
8
8
  /**
@@ -12,20 +12,31 @@ import { c as IMiddleware, l as IPipelineContext, o as IPipeline } from "./index
12
12
  */
13
13
  interface ISystemContextEvents {
14
14
  /**
15
- * Publishes an event to subscribers or specific targets.
16
- * If targets are provided, event is sent only to those entities.
17
- * Otherwise, event is routed to all subscribers based on subscription registry.
15
+ * Publishes an event to one or more explicit targets.
16
+ * The event is sent only to the specified target(s) — it does NOT fall back to subscriptions.
18
17
  * @param data - The event payload.
19
- * @param targets - Optional specific entities to send to.
18
+ * @param target - The entity or entities to send the event to.
20
19
  */
21
- dispatchEvent<TEventData extends IEventData>(data: TEventData, ...targets: IEntityProxy[]): void;
20
+ dispatchEvent<TEventData extends IEventData>(data: TEventData, target: IEntityProxy | IEntityProxy[]): void;
22
21
  /**
23
- * Publishes multiple events in bulk.
24
- * More efficient than calling dispatchEvent repeatedly.
22
+ * Publishes multiple events to one or more explicit targets.
23
+ * Each target receives all events in a single update.
25
24
  * @param data - Array of event payloads to dispatch.
26
- * @param targets - Optional specific entities to send to.
25
+ * @param target - The entity or entities to send the events to.
27
26
  */
28
- dispatchEvents<TEventData extends IEventData>(data: TEventData[], ...targets: IEntityProxy[]): void;
27
+ dispatchEvents<TEventData extends IEventData>(data: TEventData[], target: IEntityProxy | IEntityProxy[]): void;
28
+ /**
29
+ * Broadcasts an event to all subscribers registered for that event type.
30
+ * Uses the subscription registry to resolve targets.
31
+ * @param data - The event payload.
32
+ */
33
+ broadcastEvent<TEventData extends IEventData>(data: TEventData): void;
34
+ /**
35
+ * Broadcasts multiple events to all subscribers.
36
+ * Events are grouped per subscriber so each receives a single update.
37
+ * @param data - Array of event payloads to broadcast.
38
+ */
39
+ broadcastEvents<TEventData extends IEventData>(data: TEventData[]): void;
29
40
  /**
30
41
  * Retrieves an event from the current context by its identifier.
31
42
  * Useful for checking if an event was received this frame.
@@ -188,6 +199,12 @@ interface ISystemContextScheduler {
188
199
  * @param target - Optional entity to unschedule. Defaults to current entity in context.
189
200
  */
190
201
  removeSchedule(target?: IEntityProxy): void;
202
+ /**
203
+ * Checks whether an entity has a scheduled update.
204
+ * If no target is specified, checks the current entity.
205
+ * @param target - Optional entity to check. Defaults to current entity in context.
206
+ */
207
+ hasSchedule(target?: IEntityProxy): boolean;
191
208
  }
192
209
  //#endregion
193
210
  //#region src/systems/pipeline/system-context-snapshot.d.ts
@@ -365,6 +382,14 @@ interface ISystemsModuleBuilder<TEntity extends IEntity> {
365
382
  * Accessible during and after construction.
366
383
  */
367
384
  readonly pipelines: ReadonlyMap<SystemType, IPipeline<ISystemContext<TEntity>>>;
385
+ /**
386
+ * Whether this entity type is a scope root.
387
+ */
388
+ readonly scopeRoot: boolean;
389
+ /**
390
+ * Whether this entity type is a scoped proxy.
391
+ */
392
+ readonly scopedProxy: boolean;
368
393
  /**
369
394
  * Registers middleware systems for a specific pipeline stage.
370
395
  * The middleware are added to the pipeline in the order provided.
@@ -516,4 +541,4 @@ interface ISystemsRuntimeContext<TEntity extends IEntity> extends IPipelineConte
516
541
  type ISystemsRuntimeMiddleware<TEntity extends IEntity> = IMiddleware<ISystemsRuntimeContext<TEntity>>;
517
542
  //#endregion
518
543
  export { ISystemsModuleRepository as a, ISystemsModule as c, ISystemContextSnapshot as d, ISystemContextScheduler as f, ISystemContextEvents as h, ISystemContextEntity as i, SystemType as l, ISystemContextProxies as m, ISystemsRuntimeContext as n, ISystemsModuleBuilder as o, ISystemContextRepository as p, ISystemsRuntime as r, ISystemMiddleware as s, ISystemsRuntimeMiddleware as t, ISystemContext as u };
519
- //# sourceMappingURL=index-CBIhhk81.d.mts.map
544
+ //# sourceMappingURL=index-DQYLun1o.d.mts.map
@@ -1,5 +1,5 @@
1
1
  import { n as Immutable } from "./types-CnDtpKsY.mjs";
2
- import { r as PerformanceTimeEntry } from "./index-Iqc9jR5E.mjs";
2
+ import { r as PerformanceTimeEntry } from "./index-hHkhvmkO.mjs";
3
3
 
4
4
  //#region src/pipelines/pipeline-context.d.ts
5
5
  /**
@@ -221,4 +221,4 @@ interface IPipelineRunner<TContext extends IPipelineContext> {
221
221
  }
222
222
  //#endregion
223
223
  export { IParentMiddleware as a, IMiddleware as c, IParentContext as i, IPipelineContext as l, INestedContext as n, IPipeline as o, INestedMiddleware as r, IMiddlewareRunner as s, IPipelineRunner as t, PipelineRuntime as u };
224
- //# sourceMappingURL=index-CyoGuBNw.d.mts.map
224
+ //# sourceMappingURL=index-DeYfvKO0.d.mts.map
@@ -1,3 +1,17 @@
1
+ //#region src/utils/dispatch-sequential.d.ts
2
+ /**
3
+ * Executes a function for each item in an iterable, sequentially.
4
+ *
5
+ * Uses a sync fast-path: iterates synchronously until the first Promise is
6
+ * encountered, then switches to async for the remainder. If no item produces
7
+ * a Promise, the entire call stays synchronous with zero async overhead.
8
+ *
9
+ * @param items - The iterable to iterate over.
10
+ * @param fn - The function to call for each item. May return void or a Promise.
11
+ * @returns void if all calls were synchronous, or a Promise if any were async.
12
+ */
13
+ declare function dispatchSequential<T>(items: Iterable<T>, fn: (item: T) => void | Promise<void>): void | Promise<void>;
14
+ //#endregion
1
15
  //#region src/utils/json-serializer.d.ts
2
16
  /**
3
17
  * Custom JSON serialization and deserialization interface.
@@ -157,5 +171,5 @@ interface IPerformanceTimer {
157
171
  endTimer(timerUid: PerformanceTimerUid): PerformanceTimeEntry;
158
172
  }
159
173
  //#endregion
160
- export { ILogger as a, IJsonSerializer as c, PerformanceTimerUid as i, PerformanceMetricOptions as n, ILoggerOptions as o, PerformanceTimeEntry as r, LogLevel as s, IPerformanceTimer as t };
161
- //# sourceMappingURL=index-CmTRwW4W.d.cts.map
174
+ export { ILogger as a, IJsonSerializer as c, PerformanceTimerUid as i, dispatchSequential as l, PerformanceMetricOptions as n, ILoggerOptions as o, PerformanceTimeEntry as r, LogLevel as s, IPerformanceTimer as t };
175
+ //# sourceMappingURL=index-hHkhvmkO.d.mts.map
@@ -1,2 +1,2 @@
1
- import { a as IParentMiddleware, c as IMiddleware, i as IParentContext, l as IPipelineContext, n as INestedContext, o as IPipeline, r as INestedMiddleware, s as IMiddlewareRunner, t as IPipelineRunner, u as PipelineRuntime } from "../index-cF9FviwN.cjs";
1
+ import { a as IParentMiddleware, c as IMiddleware, i as IParentContext, l as IPipelineContext, n as INestedContext, o as IPipeline, r as INestedMiddleware, s as IMiddlewareRunner, t as IPipelineRunner, u as PipelineRuntime } from "../index-BQojRXVz.cjs";
2
2
  export { IMiddleware, IMiddlewareRunner, INestedContext, INestedMiddleware, IParentContext, IParentMiddleware, IPipeline, IPipelineContext, IPipelineRunner, PipelineRuntime };
@@ -1,2 +1,2 @@
1
- import { a as IParentMiddleware, c as IMiddleware, i as IParentContext, l as IPipelineContext, n as INestedContext, o as IPipeline, r as INestedMiddleware, s as IMiddlewareRunner, t as IPipelineRunner, u as PipelineRuntime } from "../index-CyoGuBNw.mjs";
1
+ import { a as IParentMiddleware, c as IMiddleware, i as IParentContext, l as IPipelineContext, n as INestedContext, o as IPipeline, r as INestedMiddleware, s as IMiddlewareRunner, t as IPipelineRunner, u as PipelineRuntime } from "../index-DeYfvKO0.mjs";
2
2
  export { IMiddleware, IMiddlewareRunner, INestedContext, INestedMiddleware, IParentContext, IParentMiddleware, IPipeline, IPipelineContext, IPipelineRunner, PipelineRuntime };
@@ -1,2 +1,2 @@
1
- import { a as ISystemsModuleRepository, c as ISystemsModule, d as ISystemContextSnapshot, f as ISystemContextScheduler, h as ISystemContextEvents, i as ISystemContextEntity, l as SystemType, m as ISystemContextProxies, n as ISystemsRuntimeContext, o as ISystemsModuleBuilder, p as ISystemContextRepository, r as ISystemsRuntime, s as ISystemMiddleware, t as ISystemsRuntimeMiddleware, u as ISystemContext } from "../index-BoBx4MQT.cjs";
1
+ import { a as ISystemsModuleRepository, c as ISystemsModule, d as ISystemContextSnapshot, f as ISystemContextScheduler, h as ISystemContextEvents, i as ISystemContextEntity, l as SystemType, m as ISystemContextProxies, n as ISystemsRuntimeContext, o as ISystemsModuleBuilder, p as ISystemContextRepository, r as ISystemsRuntime, s as ISystemMiddleware, t as ISystemsRuntimeMiddleware, u as ISystemContext } from "../index-CrMUhuEK.cjs";
2
2
  export { ISystemContext, ISystemContextEntity, ISystemContextEvents, ISystemContextProxies, ISystemContextRepository, ISystemContextScheduler, ISystemContextSnapshot, ISystemMiddleware, ISystemsModule, ISystemsModuleBuilder, ISystemsModuleRepository, ISystemsRuntime, ISystemsRuntimeContext, ISystemsRuntimeMiddleware, SystemType };
@@ -1,2 +1,2 @@
1
- import { a as ISystemsModuleRepository, c as ISystemsModule, d as ISystemContextSnapshot, f as ISystemContextScheduler, h as ISystemContextEvents, i as ISystemContextEntity, l as SystemType, m as ISystemContextProxies, n as ISystemsRuntimeContext, o as ISystemsModuleBuilder, p as ISystemContextRepository, r as ISystemsRuntime, s as ISystemMiddleware, t as ISystemsRuntimeMiddleware, u as ISystemContext } from "../index-CBIhhk81.mjs";
1
+ import { a as ISystemsModuleRepository, c as ISystemsModule, d as ISystemContextSnapshot, f as ISystemContextScheduler, h as ISystemContextEvents, i as ISystemContextEntity, l as SystemType, m as ISystemContextProxies, n as ISystemsRuntimeContext, o as ISystemsModuleBuilder, p as ISystemContextRepository, r as ISystemsRuntime, s as ISystemMiddleware, t as ISystemsRuntimeMiddleware, u as ISystemContext } from "../index-DQYLun1o.mjs";
2
2
  export { ISystemContext, ISystemContextEntity, ISystemContextEvents, ISystemContextProxies, ISystemContextRepository, ISystemContextScheduler, ISystemContextSnapshot, ISystemMiddleware, ISystemsModule, ISystemsModuleBuilder, ISystemsModuleRepository, ISystemsRuntime, ISystemsRuntimeContext, ISystemsRuntimeMiddleware, SystemType };
@@ -1,4 +1,32 @@
1
1
 
2
+ //#region src/utils/dispatch-sequential.ts
3
+ /**
4
+ * Executes a function for each item in an iterable, sequentially.
5
+ *
6
+ * Uses a sync fast-path: iterates synchronously until the first Promise is
7
+ * encountered, then switches to async for the remainder. If no item produces
8
+ * a Promise, the entire call stays synchronous with zero async overhead.
9
+ *
10
+ * @param items - The iterable to iterate over.
11
+ * @param fn - The function to call for each item. May return void or a Promise.
12
+ * @returns void if all calls were synchronous, or a Promise if any were async.
13
+ */
14
+ function dispatchSequential(items, fn) {
15
+ const iterator = items[Symbol.iterator]();
16
+ for (let next = iterator.next(); !next.done; next = iterator.next()) {
17
+ const result = fn(next.value);
18
+ if (result instanceof Promise) return continueAsync(iterator, fn, result);
19
+ }
20
+ }
21
+ async function continueAsync(iterator, fn, pending) {
22
+ await pending;
23
+ for (let next = iterator.next(); !next.done; next = iterator.next()) {
24
+ const result = fn(next.value);
25
+ if (result instanceof Promise) await result;
26
+ }
27
+ }
28
+
29
+ //#endregion
2
30
  //#region src/utils/logger.ts
3
31
  /**
4
32
  * Logging severity levels in increasing order.
@@ -25,4 +53,5 @@ let LogLevel = /* @__PURE__ */ function(LogLevel) {
25
53
 
26
54
  //#endregion
27
55
  exports.LogLevel = LogLevel;
56
+ exports.dispatchSequential = dispatchSequential;
28
57
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../src/utils/logger.ts"],"sourcesContent":["/**\r\n * Logger interface for debug and diagnostic output.\r\n * Supports multiple log levels for controlling verbosity.\r\n * Implementations can target different outputs (console, file, remote, etc.).\r\n */\r\nexport interface ILogger {\r\n /**\r\n * Logs a message with a specified severity level.\r\n * @param level - The severity level of the message.\r\n * @param message - The primary message content.\r\n * @param args - Additional arguments to include in the log output.\r\n */\r\n log(level: LogLevel, message: any, ...args: any[]): void;\r\n\r\n /**\r\n * Logs detailed diagnostic information.\r\n * Typically the lowest level, most verbose output.\r\n * @param message - The message to log.\r\n * @param args - Additional data.\r\n */\r\n trace(message: any, ...args: any[]): void;\r\n\r\n /**\r\n * Logs debug-level information.\r\n * Useful during development and troubleshooting.\r\n * @param message - The message to log.\r\n * @param args - Additional data.\r\n */\r\n debug(message: any, ...args: any[]): void;\r\n\r\n /**\r\n * Logs warning-level messages.\r\n * Indicates potentially problematic conditions.\r\n * @param message - The message to log.\r\n * @param args - Additional data.\r\n */\r\n warn(message: any, ...args: any[]): void;\r\n\r\n /**\r\n * Logs error-level messages.\r\n * Indicates error conditions that may require attention.\r\n * @param message - The message to log.\r\n * @param args - Additional data.\r\n */\r\n error(message: any, ...args: any[]): void;\r\n}\r\n\r\n/**\r\n * Logging severity levels in increasing order.\r\n */\r\nexport enum LogLevel {\r\n /**\r\n * Most detailed, diagnostic-level logging.\r\n */\r\n trace,\r\n\r\n /**\r\n * Development and debugging information.\r\n */\r\n debug,\r\n\r\n /**\r\n * Warning-level conditions.\r\n */\r\n warn,\r\n\r\n /**\r\n * Error-level conditions.\r\n */\r\n error\r\n}\r\n\r\n/**\r\n * Configuration options for logger instances.\r\n */\r\nexport interface ILoggerOptions {\r\n /**\r\n * Enables/disables each log level.\r\n * If a level is disabled, log calls at that level are ignored.\r\n */\r\n enabled: Map<LogLevel, boolean>;\r\n}\r\n"],"mappings":";;;;;AAkDA,IAAY,8CAAL;;;;AAIL;;;;AAKA;;;;AAKA;;;;AAKA"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../src/utils/dispatch-sequential.ts","../../src/utils/logger.ts"],"sourcesContent":["/**\r\n * Executes a function for each item in an iterable, sequentially.\r\n *\r\n * Uses a sync fast-path: iterates synchronously until the first Promise is\r\n * encountered, then switches to async for the remainder. If no item produces\r\n * a Promise, the entire call stays synchronous with zero async overhead.\r\n *\r\n * @param items - The iterable to iterate over.\r\n * @param fn - The function to call for each item. May return void or a Promise.\r\n * @returns void if all calls were synchronous, or a Promise if any were async.\r\n */\r\nexport function dispatchSequential<T>(\r\n items: Iterable<T>,\r\n fn: (item: T) => void | Promise<void>\r\n): void | Promise<void> {\r\n const iterator = items[Symbol.iterator]();\r\n\r\n for (let next = iterator.next(); !next.done; next = iterator.next()) {\r\n const result = fn(next.value);\r\n\r\n if (result instanceof Promise) {\r\n return continueAsync(iterator, fn, result);\r\n }\r\n }\r\n}\r\n\r\nasync function continueAsync<T>(\r\n iterator: Iterator<T>,\r\n fn: (item: T) => void | Promise<void>,\r\n pending: Promise<void>\r\n): Promise<void> {\r\n await pending;\r\n\r\n for (let next = iterator.next(); !next.done; next = iterator.next()) {\r\n const result = fn(next.value);\r\n\r\n if (result instanceof Promise) {\r\n await result;\r\n }\r\n }\r\n}\r\n","/**\r\n * Logger interface for debug and diagnostic output.\r\n * Supports multiple log levels for controlling verbosity.\r\n * Implementations can target different outputs (console, file, remote, etc.).\r\n */\r\nexport interface ILogger {\r\n /**\r\n * Logs a message with a specified severity level.\r\n * @param level - The severity level of the message.\r\n * @param message - The primary message content.\r\n * @param args - Additional arguments to include in the log output.\r\n */\r\n log(level: LogLevel, message: any, ...args: any[]): void;\r\n\r\n /**\r\n * Logs detailed diagnostic information.\r\n * Typically the lowest level, most verbose output.\r\n * @param message - The message to log.\r\n * @param args - Additional data.\r\n */\r\n trace(message: any, ...args: any[]): void;\r\n\r\n /**\r\n * Logs debug-level information.\r\n * Useful during development and troubleshooting.\r\n * @param message - The message to log.\r\n * @param args - Additional data.\r\n */\r\n debug(message: any, ...args: any[]): void;\r\n\r\n /**\r\n * Logs warning-level messages.\r\n * Indicates potentially problematic conditions.\r\n * @param message - The message to log.\r\n * @param args - Additional data.\r\n */\r\n warn(message: any, ...args: any[]): void;\r\n\r\n /**\r\n * Logs error-level messages.\r\n * Indicates error conditions that may require attention.\r\n * @param message - The message to log.\r\n * @param args - Additional data.\r\n */\r\n error(message: any, ...args: any[]): void;\r\n}\r\n\r\n/**\r\n * Logging severity levels in increasing order.\r\n */\r\nexport enum LogLevel {\r\n /**\r\n * Most detailed, diagnostic-level logging.\r\n */\r\n trace,\r\n\r\n /**\r\n * Development and debugging information.\r\n */\r\n debug,\r\n\r\n /**\r\n * Warning-level conditions.\r\n */\r\n warn,\r\n\r\n /**\r\n * Error-level conditions.\r\n */\r\n error\r\n}\r\n\r\n/**\r\n * Configuration options for logger instances.\r\n */\r\nexport interface ILoggerOptions {\r\n /**\r\n * Enables/disables each log level.\r\n * If a level is disabled, log calls at that level are ignored.\r\n */\r\n enabled: Map<LogLevel, boolean>;\r\n}\r\n"],"mappings":";;;;;;;;;;;;;AAWA,SAAgB,mBACd,OACA,IACsB;CACtB,MAAM,WAAW,MAAM,OAAO,WAAW;AAEzC,MAAK,IAAI,OAAO,SAAS,MAAM,EAAE,CAAC,KAAK,MAAM,OAAO,SAAS,MAAM,EAAE;EACnE,MAAM,SAAS,GAAG,KAAK,MAAM;AAE7B,MAAI,kBAAkB,QACpB,QAAO,cAAc,UAAU,IAAI,OAAO;;;AAKhD,eAAe,cACb,UACA,IACA,SACe;AACf,OAAM;AAEN,MAAK,IAAI,OAAO,SAAS,MAAM,EAAE,CAAC,KAAK,MAAM,OAAO,SAAS,MAAM,EAAE;EACnE,MAAM,SAAS,GAAG,KAAK,MAAM;AAE7B,MAAI,kBAAkB,QACpB,OAAM;;;;;;;;;ACaZ,IAAY,8CAAL;;;;AAIL;;;;AAKA;;;;AAKA;;;;AAKA"}
@@ -1,3 +1,3 @@
1
1
  import { a as ImmutableObject, c as Mutable, i as ImmutableMap, l as MutableDeep, n as Immutable, o as ImmutableObjectDeep, r as ImmutableArray, s as ImmutableSet, t as BooleanProps } from "../types-DLOd2zXO.cjs";
2
- import { a as ILogger, c as IJsonSerializer, i as PerformanceTimerUid, n as PerformanceMetricOptions, o as ILoggerOptions, r as PerformanceTimeEntry, s as LogLevel, t as IPerformanceTimer } from "../index-CmTRwW4W.cjs";
3
- export { BooleanProps, IJsonSerializer, ILogger, ILoggerOptions, IPerformanceTimer, Immutable, ImmutableArray, ImmutableMap, ImmutableObject, ImmutableObjectDeep, ImmutableSet, LogLevel, Mutable, MutableDeep, PerformanceMetricOptions, PerformanceTimeEntry, PerformanceTimerUid };
2
+ import { a as ILogger, c as IJsonSerializer, i as PerformanceTimerUid, l as dispatchSequential, n as PerformanceMetricOptions, o as ILoggerOptions, r as PerformanceTimeEntry, s as LogLevel, t as IPerformanceTimer } from "../index-Cs9Eerjt.cjs";
3
+ export { BooleanProps, IJsonSerializer, ILogger, ILoggerOptions, IPerformanceTimer, Immutable, ImmutableArray, ImmutableMap, ImmutableObject, ImmutableObjectDeep, ImmutableSet, LogLevel, Mutable, MutableDeep, PerformanceMetricOptions, PerformanceTimeEntry, PerformanceTimerUid, dispatchSequential };
@@ -1,3 +1,3 @@
1
1
  import { a as ImmutableObject, c as Mutable, i as ImmutableMap, l as MutableDeep, n as Immutable, o as ImmutableObjectDeep, r as ImmutableArray, s as ImmutableSet, t as BooleanProps } from "../types-CnDtpKsY.mjs";
2
- import { a as ILogger, c as IJsonSerializer, i as PerformanceTimerUid, n as PerformanceMetricOptions, o as ILoggerOptions, r as PerformanceTimeEntry, s as LogLevel, t as IPerformanceTimer } from "../index-Iqc9jR5E.mjs";
3
- export { BooleanProps, IJsonSerializer, ILogger, ILoggerOptions, IPerformanceTimer, Immutable, ImmutableArray, ImmutableMap, ImmutableObject, ImmutableObjectDeep, ImmutableSet, LogLevel, Mutable, MutableDeep, PerformanceMetricOptions, PerformanceTimeEntry, PerformanceTimerUid };
2
+ import { a as ILogger, c as IJsonSerializer, i as PerformanceTimerUid, l as dispatchSequential, n as PerformanceMetricOptions, o as ILoggerOptions, r as PerformanceTimeEntry, s as LogLevel, t as IPerformanceTimer } from "../index-hHkhvmkO.mjs";
3
+ export { BooleanProps, IJsonSerializer, ILogger, ILoggerOptions, IPerformanceTimer, Immutable, ImmutableArray, ImmutableMap, ImmutableObject, ImmutableObjectDeep, ImmutableSet, LogLevel, Mutable, MutableDeep, PerformanceMetricOptions, PerformanceTimeEntry, PerformanceTimerUid, dispatchSequential };
@@ -1,3 +1,31 @@
1
+ //#region src/utils/dispatch-sequential.ts
2
+ /**
3
+ * Executes a function for each item in an iterable, sequentially.
4
+ *
5
+ * Uses a sync fast-path: iterates synchronously until the first Promise is
6
+ * encountered, then switches to async for the remainder. If no item produces
7
+ * a Promise, the entire call stays synchronous with zero async overhead.
8
+ *
9
+ * @param items - The iterable to iterate over.
10
+ * @param fn - The function to call for each item. May return void or a Promise.
11
+ * @returns void if all calls were synchronous, or a Promise if any were async.
12
+ */
13
+ function dispatchSequential(items, fn) {
14
+ const iterator = items[Symbol.iterator]();
15
+ for (let next = iterator.next(); !next.done; next = iterator.next()) {
16
+ const result = fn(next.value);
17
+ if (result instanceof Promise) return continueAsync(iterator, fn, result);
18
+ }
19
+ }
20
+ async function continueAsync(iterator, fn, pending) {
21
+ await pending;
22
+ for (let next = iterator.next(); !next.done; next = iterator.next()) {
23
+ const result = fn(next.value);
24
+ if (result instanceof Promise) await result;
25
+ }
26
+ }
27
+
28
+ //#endregion
1
29
  //#region src/utils/logger.ts
2
30
  /**
3
31
  * Logging severity levels in increasing order.
@@ -23,5 +51,5 @@ let LogLevel = /* @__PURE__ */ function(LogLevel) {
23
51
  }({});
24
52
 
25
53
  //#endregion
26
- export { LogLevel };
54
+ export { LogLevel, dispatchSequential };
27
55
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../src/utils/logger.ts"],"sourcesContent":["/**\r\n * Logger interface for debug and diagnostic output.\r\n * Supports multiple log levels for controlling verbosity.\r\n * Implementations can target different outputs (console, file, remote, etc.).\r\n */\r\nexport interface ILogger {\r\n /**\r\n * Logs a message with a specified severity level.\r\n * @param level - The severity level of the message.\r\n * @param message - The primary message content.\r\n * @param args - Additional arguments to include in the log output.\r\n */\r\n log(level: LogLevel, message: any, ...args: any[]): void;\r\n\r\n /**\r\n * Logs detailed diagnostic information.\r\n * Typically the lowest level, most verbose output.\r\n * @param message - The message to log.\r\n * @param args - Additional data.\r\n */\r\n trace(message: any, ...args: any[]): void;\r\n\r\n /**\r\n * Logs debug-level information.\r\n * Useful during development and troubleshooting.\r\n * @param message - The message to log.\r\n * @param args - Additional data.\r\n */\r\n debug(message: any, ...args: any[]): void;\r\n\r\n /**\r\n * Logs warning-level messages.\r\n * Indicates potentially problematic conditions.\r\n * @param message - The message to log.\r\n * @param args - Additional data.\r\n */\r\n warn(message: any, ...args: any[]): void;\r\n\r\n /**\r\n * Logs error-level messages.\r\n * Indicates error conditions that may require attention.\r\n * @param message - The message to log.\r\n * @param args - Additional data.\r\n */\r\n error(message: any, ...args: any[]): void;\r\n}\r\n\r\n/**\r\n * Logging severity levels in increasing order.\r\n */\r\nexport enum LogLevel {\r\n /**\r\n * Most detailed, diagnostic-level logging.\r\n */\r\n trace,\r\n\r\n /**\r\n * Development and debugging information.\r\n */\r\n debug,\r\n\r\n /**\r\n * Warning-level conditions.\r\n */\r\n warn,\r\n\r\n /**\r\n * Error-level conditions.\r\n */\r\n error\r\n}\r\n\r\n/**\r\n * Configuration options for logger instances.\r\n */\r\nexport interface ILoggerOptions {\r\n /**\r\n * Enables/disables each log level.\r\n * If a level is disabled, log calls at that level are ignored.\r\n */\r\n enabled: Map<LogLevel, boolean>;\r\n}\r\n"],"mappings":";;;;AAkDA,IAAY,8CAAL;;;;AAIL;;;;AAKA;;;;AAKA;;;;AAKA"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../src/utils/dispatch-sequential.ts","../../src/utils/logger.ts"],"sourcesContent":["/**\r\n * Executes a function for each item in an iterable, sequentially.\r\n *\r\n * Uses a sync fast-path: iterates synchronously until the first Promise is\r\n * encountered, then switches to async for the remainder. If no item produces\r\n * a Promise, the entire call stays synchronous with zero async overhead.\r\n *\r\n * @param items - The iterable to iterate over.\r\n * @param fn - The function to call for each item. May return void or a Promise.\r\n * @returns void if all calls were synchronous, or a Promise if any were async.\r\n */\r\nexport function dispatchSequential<T>(\r\n items: Iterable<T>,\r\n fn: (item: T) => void | Promise<void>\r\n): void | Promise<void> {\r\n const iterator = items[Symbol.iterator]();\r\n\r\n for (let next = iterator.next(); !next.done; next = iterator.next()) {\r\n const result = fn(next.value);\r\n\r\n if (result instanceof Promise) {\r\n return continueAsync(iterator, fn, result);\r\n }\r\n }\r\n}\r\n\r\nasync function continueAsync<T>(\r\n iterator: Iterator<T>,\r\n fn: (item: T) => void | Promise<void>,\r\n pending: Promise<void>\r\n): Promise<void> {\r\n await pending;\r\n\r\n for (let next = iterator.next(); !next.done; next = iterator.next()) {\r\n const result = fn(next.value);\r\n\r\n if (result instanceof Promise) {\r\n await result;\r\n }\r\n }\r\n}\r\n","/**\r\n * Logger interface for debug and diagnostic output.\r\n * Supports multiple log levels for controlling verbosity.\r\n * Implementations can target different outputs (console, file, remote, etc.).\r\n */\r\nexport interface ILogger {\r\n /**\r\n * Logs a message with a specified severity level.\r\n * @param level - The severity level of the message.\r\n * @param message - The primary message content.\r\n * @param args - Additional arguments to include in the log output.\r\n */\r\n log(level: LogLevel, message: any, ...args: any[]): void;\r\n\r\n /**\r\n * Logs detailed diagnostic information.\r\n * Typically the lowest level, most verbose output.\r\n * @param message - The message to log.\r\n * @param args - Additional data.\r\n */\r\n trace(message: any, ...args: any[]): void;\r\n\r\n /**\r\n * Logs debug-level information.\r\n * Useful during development and troubleshooting.\r\n * @param message - The message to log.\r\n * @param args - Additional data.\r\n */\r\n debug(message: any, ...args: any[]): void;\r\n\r\n /**\r\n * Logs warning-level messages.\r\n * Indicates potentially problematic conditions.\r\n * @param message - The message to log.\r\n * @param args - Additional data.\r\n */\r\n warn(message: any, ...args: any[]): void;\r\n\r\n /**\r\n * Logs error-level messages.\r\n * Indicates error conditions that may require attention.\r\n * @param message - The message to log.\r\n * @param args - Additional data.\r\n */\r\n error(message: any, ...args: any[]): void;\r\n}\r\n\r\n/**\r\n * Logging severity levels in increasing order.\r\n */\r\nexport enum LogLevel {\r\n /**\r\n * Most detailed, diagnostic-level logging.\r\n */\r\n trace,\r\n\r\n /**\r\n * Development and debugging information.\r\n */\r\n debug,\r\n\r\n /**\r\n * Warning-level conditions.\r\n */\r\n warn,\r\n\r\n /**\r\n * Error-level conditions.\r\n */\r\n error\r\n}\r\n\r\n/**\r\n * Configuration options for logger instances.\r\n */\r\nexport interface ILoggerOptions {\r\n /**\r\n * Enables/disables each log level.\r\n * If a level is disabled, log calls at that level are ignored.\r\n */\r\n enabled: Map<LogLevel, boolean>;\r\n}\r\n"],"mappings":";;;;;;;;;;;;AAWA,SAAgB,mBACd,OACA,IACsB;CACtB,MAAM,WAAW,MAAM,OAAO,WAAW;AAEzC,MAAK,IAAI,OAAO,SAAS,MAAM,EAAE,CAAC,KAAK,MAAM,OAAO,SAAS,MAAM,EAAE;EACnE,MAAM,SAAS,GAAG,KAAK,MAAM;AAE7B,MAAI,kBAAkB,QACpB,QAAO,cAAc,UAAU,IAAI,OAAO;;;AAKhD,eAAe,cACb,UACA,IACA,SACe;AACf,OAAM;AAEN,MAAK,IAAI,OAAO,SAAS,MAAM,EAAE,CAAC,KAAK,MAAM,OAAO,SAAS,MAAM,EAAE;EACnE,MAAM,SAAS,GAAG,KAAK,MAAM;AAE7B,MAAI,kBAAkB,QACpB,OAAM;;;;;;;;;ACaZ,IAAY,8CAAL;;;;AAIL;;;;AAKA;;;;AAKA;;;;AAKA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awesome-ecs/abstract",
3
- "version": "0.26.0",
3
+ "version": "0.28.0",
4
4
  "description": "A comprehensive Entity-Component-System (ECS) Architecture implementation. Abstract components.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -97,5 +97,5 @@
97
97
  "url": "https://github.com/privatebytes/awesome-ecs/issues"
98
98
  },
99
99
  "homepage": "https://github.com/privatebytes/awesome-ecs#readme",
100
- "gitHead": "455478d411536325b36f39780c59941b14e633c4"
100
+ "gitHead": "41492d7ce0a5e4182798619fe238d0a6d4af6e5a"
101
101
  }