@awesome-ecs/abstract 0.29.0 → 0.31.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.
Files changed (35) hide show
  1. package/dist/components/index.d.cts +1 -1
  2. package/dist/components/index.d.mts +1 -1
  3. package/dist/entities/index.cjs.map +1 -1
  4. package/dist/entities/index.d.cts +3 -3
  5. package/dist/entities/index.d.mts +3 -3
  6. package/dist/entities/index.mjs.map +1 -1
  7. package/dist/factories/index.cjs.map +1 -1
  8. package/dist/factories/index.d.cts +2 -95
  9. package/dist/factories/index.d.mts +2 -95
  10. package/dist/factories/index.mjs.map +1 -1
  11. package/dist/{identity-component-B3VGtdQW.d.mts → identity-component-CuWHf7jX.d.mts} +76 -10
  12. package/dist/{identity-component-CsU-wYTX.d.cts → identity-component-DLDaOTyK.d.cts} +76 -10
  13. package/dist/{index-DTHsTJ1j.d.cts → index-BguFn1Xj.d.cts} +62 -3
  14. package/dist/index-DZlhICMZ.d.mts +1137 -0
  15. package/dist/{index-CBxqWVDf.d.mts → index-kNcUiDBd.d.mts} +62 -3
  16. package/dist/index-zohK7ftH.d.cts +1137 -0
  17. package/dist/pipelines/index.d.cts +1 -1
  18. package/dist/pipelines/index.d.mts +1 -1
  19. package/dist/systems/index.cjs +11 -0
  20. package/dist/systems/index.cjs.map +1 -1
  21. package/dist/systems/index.d.cts +2 -2
  22. package/dist/systems/index.d.mts +2 -2
  23. package/dist/systems/index.mjs +11 -1
  24. package/dist/systems/index.mjs.map +1 -1
  25. package/dist/utils/index.d.cts +3 -3
  26. package/dist/utils/index.d.mts +3 -3
  27. package/package.json +2 -2
  28. package/dist/index-BC8RgFVd.d.mts +0 -544
  29. package/dist/index-BRkKPsOV.d.cts +0 -224
  30. package/dist/index-C8yZ7-zP.d.mts +0 -224
  31. package/dist/index-DCx0PjvH.d.cts +0 -175
  32. package/dist/index-Df4VhCPr.d.cts +0 -544
  33. package/dist/index-EpAQRAeF.d.mts +0 -175
  34. package/dist/types-DqWnkvhp.d.cts +0 -70
  35. package/dist/types-aD9p7TDy.d.mts +0 -70
@@ -1,2 +1,2 @@
1
- import { f as ComponentTypeUid, n as IdentityComponent, p as IComponent, t as BasicComponentType } from "../identity-component-CsU-wYTX.cjs";
1
+ import { S as IComponent, n as IdentityComponent, t as BasicComponentType, x as ComponentTypeUid } from "../identity-component-DLDaOTyK.cjs";
2
2
  export { BasicComponentType, ComponentTypeUid, IComponent, IdentityComponent };
@@ -1,2 +1,2 @@
1
- import { f as ComponentTypeUid, n as IdentityComponent, p as IComponent, t as BasicComponentType } from "../identity-component-B3VGtdQW.mjs";
1
+ import { S as IComponent, n as IdentityComponent, t as BasicComponentType, x as ComponentTypeUid } from "../identity-component-CuWHf7jX.mjs";
2
2
  export { BasicComponentType, ComponentTypeUid, IComponent, IdentityComponent };
@@ -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';\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,mBAAL,yBAAA,kBAAA;;;;AAIL,kBAAA,YAAA;;;;AAIA,kBAAA,YAAA;;KACD;;;;;;ACHD,IAAY,qBAAL,yBAAA,oBAAA;;AAEL,oBAAA,UAAA;;AAEA,oBAAA,cAAA;;AAEA,oBAAA,eAAA;;KACD"}
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 * Returns a read-only snapshot of all queued updates without removing them.\r\n * Useful for inspection/debugging UIs.\r\n * @returns An array of all currently queued updates.\r\n */\r\n items(): ReadonlyArray<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,mBAAL,yBAAA,kBAAA;;;;AAIL,kBAAA,YAAA;;;;AAIA,kBAAA,YAAA;;KACD;;;;;;ACHD,IAAY,qBAAL,yBAAA,oBAAA;;AAEL,oBAAA,UAAA;;AAEA,oBAAA,cAAA;;AAEA,oBAAA,eAAA;;KACD"}
@@ -1,3 +1,3 @@
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-CsU-wYTX.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-DTHsTJ1j.cjs";
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
+ import { _ as IEntityProxy, b as TypedEntityProxy, f as EntityTypeUid, g as EntityProxy, h as IEntityModel, m as IEntity, p as EntityUid, v as IEntityProxyRepository, y as RequiredProxies } from "../identity-component-DLDaOTyK.cjs";
2
+ import { _ as IEntityContextCache, 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-BguFn1Xj.cjs";
3
+ export { EntityEventSubscriptionFilter, EntityEventSubscriptionOptions, EntityEventUid, EntityProxy, EntitySchedule, EntityTypeUid, EntityUid, EntityUpdateType, IEntity, IEntityContextCache, IEntityEvent, IEntityEventsDispatcher, IEntityEventsManager, IEntityModel, IEntityProxy, IEntityProxyRepository, IEntityRepository, IEntityScheduler, IEntitySnapshot, IEntitySnapshotProvider, IEntityUpdate, IEntityUpdateQueue, IEventData, RequiredProxies, SchedulerPauseType, TypedEntityProxy };
@@ -1,3 +1,3 @@
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-B3VGtdQW.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-CBxqWVDf.mjs";
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
+ import { _ as IEntityProxy, b as TypedEntityProxy, f as EntityTypeUid, g as EntityProxy, h as IEntityModel, m as IEntity, p as EntityUid, v as IEntityProxyRepository, y as RequiredProxies } from "../identity-component-CuWHf7jX.mjs";
2
+ import { _ as IEntityContextCache, 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-kNcUiDBd.mjs";
3
+ export { EntityEventSubscriptionFilter, EntityEventSubscriptionOptions, EntityEventUid, EntityProxy, EntitySchedule, EntityTypeUid, EntityUid, EntityUpdateType, IEntity, IEntityContextCache, 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';\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,mBAAL,yBAAA,kBAAA;;;;AAIL,kBAAA,YAAA;;;;AAIA,kBAAA,YAAA;;KACD;;;;;;ACHD,IAAY,qBAAL,yBAAA,oBAAA;;AAEL,oBAAA,UAAA;;AAEA,oBAAA,cAAA;;AAEA,oBAAA,eAAA;;KACD"}
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 * Returns a read-only snapshot of all queued updates without removing them.\r\n * Useful for inspection/debugging UIs.\r\n * @returns An array of all currently queued updates.\r\n */\r\n items(): ReadonlyArray<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,mBAAL,yBAAA,kBAAA;;;;AAIL,kBAAA,YAAA;;;;AAIA,kBAAA,YAAA;;KACD;;;;;;ACHD,IAAY,qBAAL,yBAAA,oBAAA;;AAEL,oBAAA,UAAA;;AAEA,oBAAA,cAAA;;AAEA,oBAAA,eAAA;;KACD"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../src/factories/pipeline-factory.ts"],"sourcesContent":["import { IPipelineContext } from '../pipelines';\r\nimport { IPipeline } from '../pipelines/pipeline';\r\n\r\n/**\r\n * Category identifier for grouping performance metrics.\r\n * Typed as string to allow extension beyond the built-in {@link PipelineCategory} values.\r\n */\r\nexport type PipelineCategoryName = string;\r\n\r\n/**\r\n * Built-in metric categories for classifying pipeline and middleware performance entries.\r\n *\r\n * - `module` — System module pipelines (initialize, update, render, sync phases).\r\n * - `runtime` — Runtime orchestration pipeline and its middleware.\r\n * - `system` — Individual system middleware within a module pipeline.\r\n */\r\nexport enum PipelineCategory {\r\n module = 'module',\r\n runtime = 'runtime',\r\n system = 'system'\r\n}\r\n\r\n/**\r\n * Options for identifying and categorizing performance metrics on pipelines.\r\n */\r\nexport type PipelineMetricOptions = {\r\n /** Display name for the pipeline in performance metrics. */\r\n pipelineName: string;\r\n /** Category assigned to pipeline-level metric entries. */\r\n pipelineCategory: PipelineCategoryName;\r\n /** Category assigned to per-middleware metric entries within this pipeline. */\r\n middlewareCategory: PipelineCategoryName;\r\n};\r\n\r\n/**\r\n * Creates pipeline instances for various contexts.\r\n * Abstracts pipeline creation to support different implementations.\r\n * Used by the system to instantiate pipelines without coupling to specific implementations.\r\n */\r\nexport interface IPipelineFactory {\r\n /**\r\n * Creates a new pipeline for the specified context type.\r\n * @template TContext - The context type for the pipeline. Must extend IPipelineContext.\r\n * @param options - Optional performance metric options (name, category) for the pipeline.\r\n * @returns A new pipeline instance ready for middleware registration.\r\n */\r\n createPipeline<TContext extends IPipelineContext>(\r\n options?: PipelineMetricOptions\r\n ): IPipeline<TContext>;\r\n}\r\n"],"mappings":";;;;;;;;;AAgBA,IAAY,mBAAL,yBAAA,kBAAA;AACL,kBAAA,YAAA;AACA,kBAAA,aAAA;AACA,kBAAA,YAAA;;KACD"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../src/factories/pipeline-factory.ts"],"sourcesContent":["import { IPipelineContext } from '../pipelines';\r\nimport { IPipeline } from '../pipelines/pipeline';\r\n\r\n/**\r\n * Category identifier for grouping performance metrics.\r\n * Typed as string to allow extension beyond the built-in {@link PipelineCategory} values.\r\n */\r\nexport type PipelineCategoryName = string;\r\n\r\n/**\r\n * Built-in metric categories for classifying pipeline and middleware performance entries.\r\n *\r\n * - `module` — System module pipelines (initialize, update, render, sync phases).\r\n * - `runtime` — Runtime orchestration pipeline and its middleware.\r\n * - `system` — Individual system middleware within a module pipeline.\r\n */\r\nexport enum PipelineCategory {\r\n module = 'module',\r\n runtime = 'runtime',\r\n system = 'system'\r\n}\r\n\r\n/**\r\n * Options for identifying and categorizing performance metrics on pipelines.\r\n */\r\nexport type PipelineOptions = {\r\n /** Display name for the pipeline in performance metrics. */\r\n pipelineName: string;\r\n /** Category assigned to pipeline-level metric entries. */\r\n pipelineCategory: PipelineCategoryName;\r\n /** Category assigned to per-middleware metric entries within this pipeline. */\r\n middlewareCategory: PipelineCategoryName;\r\n};\r\n\r\n/**\r\n * Creates pipeline instances for various contexts.\r\n * Abstracts pipeline creation to support different implementations.\r\n * Used by the system to instantiate pipelines without coupling to specific implementations.\r\n */\r\nexport interface IPipelineFactory {\r\n /**\r\n * Creates a new pipeline for the specified context type.\r\n * @template TContext - The context type for the pipeline. Must extend IPipelineContext.\r\n * @param options - Optional performance metric options (name, category) for the pipeline.\r\n * @returns A new pipeline instance ready for middleware registration.\r\n */\r\n createPipeline<TContext extends IPipelineContext>(options?: PipelineOptions): IPipeline<TContext>;\r\n}\r\n"],"mappings":";;;;;;;;;AAgBA,IAAY,mBAAL,yBAAA,kBAAA;AACL,kBAAA,YAAA;AACA,kBAAA,aAAA;AACA,kBAAA,YAAA;;KACD"}
@@ -1,95 +1,2 @@
1
- import { a as IEntity } from "../identity-component-CsU-wYTX.cjs";
2
- import { l as IPipelineContext, o as IPipeline } from "../index-BRkKPsOV.cjs";
3
- import { n as ISystemsRuntimeContext, o as ISystemsModuleBuilder, u as ISystemContext } from "../index-Df4VhCPr.cjs";
4
-
5
- //#region src/factories/context-factory.d.ts
6
- interface IContextFactory {
7
- /**
8
- * Creates a new system context for the given entity type.
9
- * @template TEntity - The entity type for which the system context is being created.
10
- * @returns A new context instance.
11
- */
12
- createSystemContext<TEntity extends IEntity>(): ISystemContext<TEntity>;
13
- }
14
- //#endregion
15
- //#region src/factories/pipeline-factory.d.ts
16
- /**
17
- * Category identifier for grouping performance metrics.
18
- * Typed as string to allow extension beyond the built-in {@link PipelineCategory} values.
19
- */
20
- type PipelineCategoryName = string;
21
- /**
22
- * Built-in metric categories for classifying pipeline and middleware performance entries.
23
- *
24
- * - `module` — System module pipelines (initialize, update, render, sync phases).
25
- * - `runtime` — Runtime orchestration pipeline and its middleware.
26
- * - `system` — Individual system middleware within a module pipeline.
27
- */
28
- declare enum PipelineCategory {
29
- module = "module",
30
- runtime = "runtime",
31
- system = "system"
32
- }
33
- /**
34
- * Options for identifying and categorizing performance metrics on pipelines.
35
- */
36
- type PipelineMetricOptions = {
37
- /** Display name for the pipeline in performance metrics. */pipelineName: string; /** Category assigned to pipeline-level metric entries. */
38
- pipelineCategory: PipelineCategoryName; /** Category assigned to per-middleware metric entries within this pipeline. */
39
- middlewareCategory: PipelineCategoryName;
40
- };
41
- /**
42
- * Creates pipeline instances for various contexts.
43
- * Abstracts pipeline creation to support different implementations.
44
- * Used by the system to instantiate pipelines without coupling to specific implementations.
45
- */
46
- interface IPipelineFactory {
47
- /**
48
- * Creates a new pipeline for the specified context type.
49
- * @template TContext - The context type for the pipeline. Must extend IPipelineContext.
50
- * @param options - Optional performance metric options (name, category) for the pipeline.
51
- * @returns A new pipeline instance ready for middleware registration.
52
- */
53
- createPipeline<TContext extends IPipelineContext>(options?: PipelineMetricOptions): IPipeline<TContext>;
54
- }
55
- //#endregion
56
- //#region src/factories/runtime-factory.d.ts
57
- /**
58
- * Creates runtime contexts and pipelines for system execution.
59
- * Provides factory methods for constructing runtime infrastructure.
60
- * Allows different runtime strategies through multiple implementations.
61
- */
62
- interface IRuntimeFactory {
63
- /**
64
- * Creates a new runtime context for system execution.
65
- * @template TEntity - The entity type for the runtime context.
66
- * @returns A new systems runtime context instance.
67
- */
68
- createRuntimeContext<TEntity extends IEntity>(): ISystemsRuntimeContext<TEntity>;
69
- /**
70
- * Creates a pipeline for systems runtime orchestration.
71
- * @template TEntity - The entity type for this runtime pipeline.
72
- * @param name - Optional name for debugging.
73
- * @returns A new runtime pipeline for system execution.
74
- */
75
- createRuntimePipeline<TEntity extends IEntity>(name?: string): IPipeline<ISystemsRuntimeContext<TEntity>>;
76
- }
77
- //#endregion
78
- //#region src/factories/systems-factory.d.ts
79
- /**
80
- * Creates systems module builders for constructing entity system pipelines.
81
- * Provides factory access to module builder instances.
82
- * Enables composition of systems for different entity types.
83
- */
84
- interface ISystemsFactory {
85
- /**
86
- * Creates a new builder for constructing a systems module.
87
- * @template TEntity - The entity type for which systems are being built.
88
- * @param name - The System Builder's name.
89
- * @returns A new systems module builder instance.
90
- */
91
- createSystemsModuleBuilder<TEntity extends IEntity>(name: string): ISystemsModuleBuilder<TEntity>;
92
- }
93
- //#endregion
94
- export { IContextFactory, IPipelineFactory, IRuntimeFactory, ISystemsFactory, PipelineCategory, PipelineCategoryName, PipelineMetricOptions };
95
- //# sourceMappingURL=index.d.cts.map
1
+ import { d as IPipelineFactory, f as PipelineCategory, h as IContextFactory, m as PipelineOptions, n as IRuntimeFactory, p as PipelineCategoryName, t as ISystemsFactory } from "../index-zohK7ftH.cjs";
2
+ export { IContextFactory, IPipelineFactory, IRuntimeFactory, ISystemsFactory, PipelineCategory, PipelineCategoryName, PipelineOptions };
@@ -1,95 +1,2 @@
1
- import { a as IEntity } from "../identity-component-B3VGtdQW.mjs";
2
- import { l as IPipelineContext, o as IPipeline } from "../index-C8yZ7-zP.mjs";
3
- import { n as ISystemsRuntimeContext, o as ISystemsModuleBuilder, u as ISystemContext } from "../index-BC8RgFVd.mjs";
4
-
5
- //#region src/factories/context-factory.d.ts
6
- interface IContextFactory {
7
- /**
8
- * Creates a new system context for the given entity type.
9
- * @template TEntity - The entity type for which the system context is being created.
10
- * @returns A new context instance.
11
- */
12
- createSystemContext<TEntity extends IEntity>(): ISystemContext<TEntity>;
13
- }
14
- //#endregion
15
- //#region src/factories/pipeline-factory.d.ts
16
- /**
17
- * Category identifier for grouping performance metrics.
18
- * Typed as string to allow extension beyond the built-in {@link PipelineCategory} values.
19
- */
20
- type PipelineCategoryName = string;
21
- /**
22
- * Built-in metric categories for classifying pipeline and middleware performance entries.
23
- *
24
- * - `module` — System module pipelines (initialize, update, render, sync phases).
25
- * - `runtime` — Runtime orchestration pipeline and its middleware.
26
- * - `system` — Individual system middleware within a module pipeline.
27
- */
28
- declare enum PipelineCategory {
29
- module = "module",
30
- runtime = "runtime",
31
- system = "system"
32
- }
33
- /**
34
- * Options for identifying and categorizing performance metrics on pipelines.
35
- */
36
- type PipelineMetricOptions = {
37
- /** Display name for the pipeline in performance metrics. */pipelineName: string; /** Category assigned to pipeline-level metric entries. */
38
- pipelineCategory: PipelineCategoryName; /** Category assigned to per-middleware metric entries within this pipeline. */
39
- middlewareCategory: PipelineCategoryName;
40
- };
41
- /**
42
- * Creates pipeline instances for various contexts.
43
- * Abstracts pipeline creation to support different implementations.
44
- * Used by the system to instantiate pipelines without coupling to specific implementations.
45
- */
46
- interface IPipelineFactory {
47
- /**
48
- * Creates a new pipeline for the specified context type.
49
- * @template TContext - The context type for the pipeline. Must extend IPipelineContext.
50
- * @param options - Optional performance metric options (name, category) for the pipeline.
51
- * @returns A new pipeline instance ready for middleware registration.
52
- */
53
- createPipeline<TContext extends IPipelineContext>(options?: PipelineMetricOptions): IPipeline<TContext>;
54
- }
55
- //#endregion
56
- //#region src/factories/runtime-factory.d.ts
57
- /**
58
- * Creates runtime contexts and pipelines for system execution.
59
- * Provides factory methods for constructing runtime infrastructure.
60
- * Allows different runtime strategies through multiple implementations.
61
- */
62
- interface IRuntimeFactory {
63
- /**
64
- * Creates a new runtime context for system execution.
65
- * @template TEntity - The entity type for the runtime context.
66
- * @returns A new systems runtime context instance.
67
- */
68
- createRuntimeContext<TEntity extends IEntity>(): ISystemsRuntimeContext<TEntity>;
69
- /**
70
- * Creates a pipeline for systems runtime orchestration.
71
- * @template TEntity - The entity type for this runtime pipeline.
72
- * @param name - Optional name for debugging.
73
- * @returns A new runtime pipeline for system execution.
74
- */
75
- createRuntimePipeline<TEntity extends IEntity>(name?: string): IPipeline<ISystemsRuntimeContext<TEntity>>;
76
- }
77
- //#endregion
78
- //#region src/factories/systems-factory.d.ts
79
- /**
80
- * Creates systems module builders for constructing entity system pipelines.
81
- * Provides factory access to module builder instances.
82
- * Enables composition of systems for different entity types.
83
- */
84
- interface ISystemsFactory {
85
- /**
86
- * Creates a new builder for constructing a systems module.
87
- * @template TEntity - The entity type for which systems are being built.
88
- * @param name - The System Builder's name.
89
- * @returns A new systems module builder instance.
90
- */
91
- createSystemsModuleBuilder<TEntity extends IEntity>(name: string): ISystemsModuleBuilder<TEntity>;
92
- }
93
- //#endregion
94
- export { IContextFactory, IPipelineFactory, IRuntimeFactory, ISystemsFactory, PipelineCategory, PipelineCategoryName, PipelineMetricOptions };
95
- //# sourceMappingURL=index.d.mts.map
1
+ import { d as IPipelineFactory, f as PipelineCategory, h as IContextFactory, m as PipelineOptions, n as IRuntimeFactory, p as PipelineCategoryName, t as ISystemsFactory } from "../index-DZlhICMZ.mjs";
2
+ export { IContextFactory, IPipelineFactory, IRuntimeFactory, ISystemsFactory, PipelineCategory, PipelineCategoryName, PipelineOptions };
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../src/factories/pipeline-factory.ts"],"sourcesContent":["import { IPipelineContext } from '../pipelines';\r\nimport { IPipeline } from '../pipelines/pipeline';\r\n\r\n/**\r\n * Category identifier for grouping performance metrics.\r\n * Typed as string to allow extension beyond the built-in {@link PipelineCategory} values.\r\n */\r\nexport type PipelineCategoryName = string;\r\n\r\n/**\r\n * Built-in metric categories for classifying pipeline and middleware performance entries.\r\n *\r\n * - `module` — System module pipelines (initialize, update, render, sync phases).\r\n * - `runtime` — Runtime orchestration pipeline and its middleware.\r\n * - `system` — Individual system middleware within a module pipeline.\r\n */\r\nexport enum PipelineCategory {\r\n module = 'module',\r\n runtime = 'runtime',\r\n system = 'system'\r\n}\r\n\r\n/**\r\n * Options for identifying and categorizing performance metrics on pipelines.\r\n */\r\nexport type PipelineMetricOptions = {\r\n /** Display name for the pipeline in performance metrics. */\r\n pipelineName: string;\r\n /** Category assigned to pipeline-level metric entries. */\r\n pipelineCategory: PipelineCategoryName;\r\n /** Category assigned to per-middleware metric entries within this pipeline. */\r\n middlewareCategory: PipelineCategoryName;\r\n};\r\n\r\n/**\r\n * Creates pipeline instances for various contexts.\r\n * Abstracts pipeline creation to support different implementations.\r\n * Used by the system to instantiate pipelines without coupling to specific implementations.\r\n */\r\nexport interface IPipelineFactory {\r\n /**\r\n * Creates a new pipeline for the specified context type.\r\n * @template TContext - The context type for the pipeline. Must extend IPipelineContext.\r\n * @param options - Optional performance metric options (name, category) for the pipeline.\r\n * @returns A new pipeline instance ready for middleware registration.\r\n */\r\n createPipeline<TContext extends IPipelineContext>(\r\n options?: PipelineMetricOptions\r\n ): IPipeline<TContext>;\r\n}\r\n"],"mappings":";;;;;;;;AAgBA,IAAY,mBAAL,yBAAA,kBAAA;AACL,kBAAA,YAAA;AACA,kBAAA,aAAA;AACA,kBAAA,YAAA;;KACD"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../src/factories/pipeline-factory.ts"],"sourcesContent":["import { IPipelineContext } from '../pipelines';\r\nimport { IPipeline } from '../pipelines/pipeline';\r\n\r\n/**\r\n * Category identifier for grouping performance metrics.\r\n * Typed as string to allow extension beyond the built-in {@link PipelineCategory} values.\r\n */\r\nexport type PipelineCategoryName = string;\r\n\r\n/**\r\n * Built-in metric categories for classifying pipeline and middleware performance entries.\r\n *\r\n * - `module` — System module pipelines (initialize, update, render, sync phases).\r\n * - `runtime` — Runtime orchestration pipeline and its middleware.\r\n * - `system` — Individual system middleware within a module pipeline.\r\n */\r\nexport enum PipelineCategory {\r\n module = 'module',\r\n runtime = 'runtime',\r\n system = 'system'\r\n}\r\n\r\n/**\r\n * Options for identifying and categorizing performance metrics on pipelines.\r\n */\r\nexport type PipelineOptions = {\r\n /** Display name for the pipeline in performance metrics. */\r\n pipelineName: string;\r\n /** Category assigned to pipeline-level metric entries. */\r\n pipelineCategory: PipelineCategoryName;\r\n /** Category assigned to per-middleware metric entries within this pipeline. */\r\n middlewareCategory: PipelineCategoryName;\r\n};\r\n\r\n/**\r\n * Creates pipeline instances for various contexts.\r\n * Abstracts pipeline creation to support different implementations.\r\n * Used by the system to instantiate pipelines without coupling to specific implementations.\r\n */\r\nexport interface IPipelineFactory {\r\n /**\r\n * Creates a new pipeline for the specified context type.\r\n * @template TContext - The context type for the pipeline. Must extend IPipelineContext.\r\n * @param options - Optional performance metric options (name, category) for the pipeline.\r\n * @returns A new pipeline instance ready for middleware registration.\r\n */\r\n createPipeline<TContext extends IPipelineContext>(options?: PipelineOptions): IPipeline<TContext>;\r\n}\r\n"],"mappings":";;;;;;;;AAgBA,IAAY,mBAAL,yBAAA,kBAAA;AACL,kBAAA,YAAA;AACA,kBAAA,aAAA;AACA,kBAAA,YAAA;;KACD"}
@@ -1,5 +1,3 @@
1
- import { n as Immutable } from "./types-aD9p7TDy.mjs";
2
-
3
1
  //#region src/components/component.d.ts
4
2
  type ComponentTypeUid = string | number;
5
3
  /**
@@ -169,8 +167,9 @@ type EntityUid = string | number;
169
167
  /**
170
168
  * Represents the core identification and initialization data for an entity.
171
169
  * @template TProxyTypes - A readonly array of entity type IDs that must be provided as proxies when creating an entity.
170
+ * When non-empty, the `proxies` property is required on the model.
172
171
  */
173
- interface IEntityModel<TProxyTypes extends readonly EntityTypeUid[] = undefined> {
172
+ type IEntityModel<TProxyTypes extends readonly EntityTypeUid[] = readonly []> = {
174
173
  /**
175
174
  * The unique identifier for this entity instance.
176
175
  */
@@ -181,12 +180,11 @@ interface IEntityModel<TProxyTypes extends readonly EntityTypeUid[] = undefined>
181
180
  * child entities inherit from their parent via addEntity().
182
181
  */
183
182
  readonly scopeId?: string;
184
- /**
185
- * Optional array of proxies (references) to other entities.
186
- * Used to establish relationships at entity creation time.
187
- */
183
+ } & (TProxyTypes extends readonly [] ? {
188
184
  readonly proxies?: RequiredProxies<TProxyTypes>;
189
- }
185
+ } : {
186
+ readonly proxies: RequiredProxies<TProxyTypes>;
187
+ });
190
188
  /**
191
189
  * The core entity interface representing a composition of components and relationships.
192
190
  * Entities are immutable containers that store data (components) and maintain relationships (proxies) to other entities.
@@ -212,6 +210,74 @@ interface IEntity {
212
210
  readonly myProxy: Readonly<EntityProxy<this>>;
213
211
  }
214
212
  //#endregion
213
+ //#region src/utils/types.d.ts
214
+ /**
215
+ * Maps all properties of a type to boolean flags.
216
+ * Useful for feature flags, capability indicators, or boolean option sets.
217
+ *
218
+ * @template T - The type whose properties are mapped to booleans.
219
+ * @example type Features = BooleanProps<{health: any; armor: any}>; // => {health: boolean, armor: boolean}
220
+ */
221
+ type BooleanProps<T> = { [Property in keyof T]: boolean };
222
+ /**
223
+ * Removes readonly modifiers from all properties, making them mutable.
224
+ * One level of immutability removal (see MutableDeep for recursive removal).
225
+ *
226
+ * @template T - The type to make mutable.
227
+ * @example type Mut = Mutable<{readonly x: number}>; // => {x: number}
228
+ */
229
+ type Mutable<T> = { -readonly [K in keyof T]: T[K] };
230
+ /**
231
+ * Recursively removes readonly modifiers from all properties at all nesting levels.
232
+ * Makes entire object graph mutable.
233
+ *
234
+ * @template T - The type to make mutable recursively.
235
+ */
236
+ type MutableDeep<T> = { -readonly [K in keyof T]: Mutable<T[K]> };
237
+ type ImmutablePrimitive = undefined | null | boolean | string | number | Function;
238
+ /**
239
+ * Makes a type fully immutable at the top level only.
240
+ * Primitives and functions remain unchanged.
241
+ * Collections (Array, Map, Set) become readonly.
242
+ * Objects have their properties made readonly.
243
+ *
244
+ * @template T - The type to make immutable.
245
+ * @example type Imm = Immutable<{x: number}>; // => {readonly x: number}
246
+ */
247
+ type Immutable<T> = T extends ImmutablePrimitive ? T : T extends Array<infer U> ? ImmutableArray<U> : T extends Map<infer K, infer V> ? ImmutableMap<K, V> : T extends Set<infer M> ? ImmutableSet<M> : ImmutableObject<T>;
248
+ /**
249
+ * Readonly array variant for use in Immutable type transformation.
250
+ *
251
+ * @template T - Element type of the array.
252
+ */
253
+ type ImmutableArray<T> = ReadonlyArray<Immutable<T>>;
254
+ /**
255
+ * Readonly map variant for use in Immutable type transformation.
256
+ *
257
+ * @template K - Key type of the map.
258
+ * @template V - Value type of the map.
259
+ */
260
+ type ImmutableMap<K, V> = ReadonlyMap<Immutable<K>, Immutable<V>>;
261
+ /**
262
+ * Readonly set variant for use in Immutable type transformation.
263
+ *
264
+ * @template T - Element type of the set.
265
+ */
266
+ type ImmutableSet<T> = ReadonlySet<Immutable<T>>;
267
+ /**
268
+ * Makes all object properties readonly (one level only).
269
+ *
270
+ * @template T - The type to make immutable.
271
+ */
272
+ type ImmutableObject<T> = { readonly [K in keyof T]: T[K] };
273
+ /**
274
+ * Recursively makes all properties readonly at all nesting levels.
275
+ * Provides complete immutability guarantee for the entire object graph.
276
+ *
277
+ * @template T - The type to make deeply immutable.
278
+ */
279
+ type ImmutableObjectDeep<T> = { readonly [K in keyof T]: Immutable<T[K]> };
280
+ //#endregion
215
281
  //#region src/components/identity-component.d.ts
216
282
  /**
217
283
  * The `BasicComponentType` enum defines the types of basic components available.
@@ -250,5 +316,5 @@ interface IdentityComponent<TModel extends IEntityModel> extends IComponent {
250
316
  readonly lastUpdated?: Date;
251
317
  }
252
318
  //#endregion
253
- export { IEntity as a, IEntityProxy as c, TypedEntityProxy as d, ComponentTypeUid as f, EntityUid as i, IEntityProxyRepository as l, IdentityComponent as n, IEntityModel as o, IComponent as p, EntityTypeUid as r, EntityProxy as s, BasicComponentType as t, RequiredProxies as u };
254
- //# sourceMappingURL=identity-component-B3VGtdQW.d.mts.map
319
+ export { IComponent as S, IEntityProxy as _, ImmutableArray as a, TypedEntityProxy as b, ImmutableObjectDeep as c, MutableDeep as d, EntityTypeUid as f, EntityProxy as g, IEntityModel as h, Immutable as i, ImmutableSet as l, IEntity as m, IdentityComponent as n, ImmutableMap as o, EntityUid as p, BooleanProps as r, ImmutableObject as s, BasicComponentType as t, Mutable as u, IEntityProxyRepository as v, ComponentTypeUid as x, RequiredProxies as y };
320
+ //# sourceMappingURL=identity-component-CuWHf7jX.d.mts.map
@@ -1,5 +1,3 @@
1
- import { n as Immutable } from "./types-DqWnkvhp.cjs";
2
-
3
1
  //#region src/components/component.d.ts
4
2
  type ComponentTypeUid = string | number;
5
3
  /**
@@ -169,8 +167,9 @@ type EntityUid = string | number;
169
167
  /**
170
168
  * Represents the core identification and initialization data for an entity.
171
169
  * @template TProxyTypes - A readonly array of entity type IDs that must be provided as proxies when creating an entity.
170
+ * When non-empty, the `proxies` property is required on the model.
172
171
  */
173
- interface IEntityModel<TProxyTypes extends readonly EntityTypeUid[] = undefined> {
172
+ type IEntityModel<TProxyTypes extends readonly EntityTypeUid[] = readonly []> = {
174
173
  /**
175
174
  * The unique identifier for this entity instance.
176
175
  */
@@ -181,12 +180,11 @@ interface IEntityModel<TProxyTypes extends readonly EntityTypeUid[] = undefined>
181
180
  * child entities inherit from their parent via addEntity().
182
181
  */
183
182
  readonly scopeId?: string;
184
- /**
185
- * Optional array of proxies (references) to other entities.
186
- * Used to establish relationships at entity creation time.
187
- */
183
+ } & (TProxyTypes extends readonly [] ? {
188
184
  readonly proxies?: RequiredProxies<TProxyTypes>;
189
- }
185
+ } : {
186
+ readonly proxies: RequiredProxies<TProxyTypes>;
187
+ });
190
188
  /**
191
189
  * The core entity interface representing a composition of components and relationships.
192
190
  * Entities are immutable containers that store data (components) and maintain relationships (proxies) to other entities.
@@ -212,6 +210,74 @@ interface IEntity {
212
210
  readonly myProxy: Readonly<EntityProxy<this>>;
213
211
  }
214
212
  //#endregion
213
+ //#region src/utils/types.d.ts
214
+ /**
215
+ * Maps all properties of a type to boolean flags.
216
+ * Useful for feature flags, capability indicators, or boolean option sets.
217
+ *
218
+ * @template T - The type whose properties are mapped to booleans.
219
+ * @example type Features = BooleanProps<{health: any; armor: any}>; // => {health: boolean, armor: boolean}
220
+ */
221
+ type BooleanProps<T> = { [Property in keyof T]: boolean };
222
+ /**
223
+ * Removes readonly modifiers from all properties, making them mutable.
224
+ * One level of immutability removal (see MutableDeep for recursive removal).
225
+ *
226
+ * @template T - The type to make mutable.
227
+ * @example type Mut = Mutable<{readonly x: number}>; // => {x: number}
228
+ */
229
+ type Mutable<T> = { -readonly [K in keyof T]: T[K] };
230
+ /**
231
+ * Recursively removes readonly modifiers from all properties at all nesting levels.
232
+ * Makes entire object graph mutable.
233
+ *
234
+ * @template T - The type to make mutable recursively.
235
+ */
236
+ type MutableDeep<T> = { -readonly [K in keyof T]: Mutable<T[K]> };
237
+ type ImmutablePrimitive = undefined | null | boolean | string | number | Function;
238
+ /**
239
+ * Makes a type fully immutable at the top level only.
240
+ * Primitives and functions remain unchanged.
241
+ * Collections (Array, Map, Set) become readonly.
242
+ * Objects have their properties made readonly.
243
+ *
244
+ * @template T - The type to make immutable.
245
+ * @example type Imm = Immutable<{x: number}>; // => {readonly x: number}
246
+ */
247
+ type Immutable<T> = T extends ImmutablePrimitive ? T : T extends Array<infer U> ? ImmutableArray<U> : T extends Map<infer K, infer V> ? ImmutableMap<K, V> : T extends Set<infer M> ? ImmutableSet<M> : ImmutableObject<T>;
248
+ /**
249
+ * Readonly array variant for use in Immutable type transformation.
250
+ *
251
+ * @template T - Element type of the array.
252
+ */
253
+ type ImmutableArray<T> = ReadonlyArray<Immutable<T>>;
254
+ /**
255
+ * Readonly map variant for use in Immutable type transformation.
256
+ *
257
+ * @template K - Key type of the map.
258
+ * @template V - Value type of the map.
259
+ */
260
+ type ImmutableMap<K, V> = ReadonlyMap<Immutable<K>, Immutable<V>>;
261
+ /**
262
+ * Readonly set variant for use in Immutable type transformation.
263
+ *
264
+ * @template T - Element type of the set.
265
+ */
266
+ type ImmutableSet<T> = ReadonlySet<Immutable<T>>;
267
+ /**
268
+ * Makes all object properties readonly (one level only).
269
+ *
270
+ * @template T - The type to make immutable.
271
+ */
272
+ type ImmutableObject<T> = { readonly [K in keyof T]: T[K] };
273
+ /**
274
+ * Recursively makes all properties readonly at all nesting levels.
275
+ * Provides complete immutability guarantee for the entire object graph.
276
+ *
277
+ * @template T - The type to make deeply immutable.
278
+ */
279
+ type ImmutableObjectDeep<T> = { readonly [K in keyof T]: Immutable<T[K]> };
280
+ //#endregion
215
281
  //#region src/components/identity-component.d.ts
216
282
  /**
217
283
  * The `BasicComponentType` enum defines the types of basic components available.
@@ -250,5 +316,5 @@ interface IdentityComponent<TModel extends IEntityModel> extends IComponent {
250
316
  readonly lastUpdated?: Date;
251
317
  }
252
318
  //#endregion
253
- export { IEntity as a, IEntityProxy as c, TypedEntityProxy as d, ComponentTypeUid as f, EntityUid as i, IEntityProxyRepository as l, IdentityComponent as n, IEntityModel as o, IComponent as p, EntityTypeUid as r, EntityProxy as s, BasicComponentType as t, RequiredProxies as u };
254
- //# sourceMappingURL=identity-component-CsU-wYTX.d.cts.map
319
+ export { IComponent as S, IEntityProxy as _, ImmutableArray as a, TypedEntityProxy as b, ImmutableObjectDeep as c, MutableDeep as d, EntityTypeUid as f, EntityProxy as g, IEntityModel as h, Immutable as i, ImmutableSet as l, IEntity as m, IdentityComponent as n, ImmutableMap as o, EntityUid as p, BooleanProps as r, ImmutableObject as s, BasicComponentType as t, Mutable as u, IEntityProxyRepository as v, ComponentTypeUid as x, RequiredProxies as y };
320
+ //# sourceMappingURL=identity-component-DLDaOTyK.d.cts.map