@awesome-ecs/abstract 0.25.0 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -4
- package/dist/entities/index.cjs +16 -0
- package/dist/entities/index.cjs.map +1 -1
- package/dist/entities/index.d.cts +2 -2
- package/dist/entities/index.d.mts +2 -2
- package/dist/entities/index.mjs +16 -1
- package/dist/entities/index.mjs.map +1 -1
- package/dist/factories/index.cjs.map +1 -1
- package/dist/factories/index.d.cts +2 -2
- package/dist/factories/index.d.mts +2 -2
- package/dist/factories/index.mjs.map +1 -1
- package/dist/{index-CR3yK5HE.d.cts → index-BPKNH5VY.d.cts} +18 -4
- package/dist/{index-cF9FviwN.d.cts → index-BQojRXVz.d.cts} +2 -2
- package/dist/{index-Iqc9jR5E.d.mts → index-Cs9Eerjt.d.cts} +16 -2
- package/dist/{index-CyoGuBNw.d.mts → index-DeYfvKO0.d.mts} +2 -2
- package/dist/{index-ei6_lV4I.d.mts → index-Iv388eRi.d.mts} +18 -4
- package/dist/{index-CmTRwW4W.d.cts → index-hHkhvmkO.d.mts} +16 -2
- package/dist/{index-CY3I0Xdn.d.cts → index-s3-CSfQd.d.cts} +66 -6
- package/dist/{index-CT8ci9Cn.d.mts → index-xgRroB4J.d.mts} +66 -6
- package/dist/pipelines/index.d.cts +1 -1
- package/dist/pipelines/index.d.mts +1 -1
- package/dist/systems/index.d.cts +1 -1
- package/dist/systems/index.d.mts +1 -1
- package/dist/utils/index.cjs +29 -0
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.cts +2 -2
- package/dist/utils/index.d.mts +2 -2
- package/dist/utils/index.mjs +29 -1
- package/dist/utils/index.mjs.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -71,8 +71,8 @@ Pipelines execute **middleware chains** with two phases:
|
|
|
71
71
|
```typescript
|
|
72
72
|
export interface IPipeline<TContext extends IPipelineContext> {
|
|
73
73
|
use(middleware: IMiddleware<TContext>): this;
|
|
74
|
-
dispatch(context: Partial<TContext>):
|
|
75
|
-
cleanup(context: Partial<TContext>):
|
|
74
|
+
dispatch(context: Partial<TContext>): void | Promise<void>;
|
|
75
|
+
cleanup(context: Partial<TContext>): void | Promise<void>;
|
|
76
76
|
}
|
|
77
77
|
```
|
|
78
78
|
|
|
@@ -82,7 +82,6 @@ export interface IPipeline<TContext extends IPipelineContext> {
|
|
|
82
82
|
- `middleware-runner.ts`: Middleware execution engine
|
|
83
83
|
- `pipeline-context.ts`: Context passed to middleware
|
|
84
84
|
- `pipeline-runner.ts`: Pipeline execution orchestration
|
|
85
|
-
- `pipeline-result.ts`: Result type for success/failure
|
|
86
85
|
|
|
87
86
|
### Systems (`src/systems/`)
|
|
88
87
|
|
|
@@ -94,7 +93,7 @@ Systems are **modular logic units** that operate on entities. They implement the
|
|
|
94
93
|
|
|
95
94
|
**Module-based organization:**
|
|
96
95
|
- `systems-module.ts`: `ISystemsModule<TEntity>` - groups related systems targeting an entity type
|
|
97
|
-
- `systems-module-
|
|
96
|
+
- `systems-module-builder.ts`: `ISystemsModuleBuilder<TEntity>` - fluent builder for pipeline registration
|
|
98
97
|
- `systems-module-repository.ts`: Module lifecycle and registration
|
|
99
98
|
|
|
100
99
|
**Runtime execution:**
|
package/dist/entities/index.cjs
CHANGED
|
@@ -16,6 +16,22 @@ let EntityUpdateType = /* @__PURE__ */ function(EntityUpdateType) {
|
|
|
16
16
|
return EntityUpdateType;
|
|
17
17
|
}({});
|
|
18
18
|
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/entities/entity-scheduler.ts
|
|
21
|
+
/**
|
|
22
|
+
* Controls which scheduling modes are paused.
|
|
23
|
+
*/
|
|
24
|
+
let SchedulerPauseType = /* @__PURE__ */ function(SchedulerPauseType) {
|
|
25
|
+
/** Pause both interval timers and frame subscriptions. */
|
|
26
|
+
SchedulerPauseType["full"] = "full";
|
|
27
|
+
/** Pause only frame subscriptions. Interval timers continue firing. */
|
|
28
|
+
SchedulerPauseType["perFrame"] = "perFrame";
|
|
29
|
+
/** Pause only interval timers. Frame subscriptions continue. */
|
|
30
|
+
SchedulerPauseType["intervals"] = "intervals";
|
|
31
|
+
return SchedulerPauseType;
|
|
32
|
+
}({});
|
|
33
|
+
|
|
19
34
|
//#endregion
|
|
20
35
|
exports.EntityUpdateType = EntityUpdateType;
|
|
36
|
+
exports.SchedulerPauseType = SchedulerPauseType;
|
|
21
37
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/entities/entity-queue.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"],"mappings":";;;;;;AAQA,IAAY,8DAAL;;;;AAIL;;;;AAIA"}
|
|
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
|
|
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, TypedEntityProxy };
|
|
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-s3-CSfQd.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,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
|
|
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, TypedEntityProxy };
|
|
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-xgRroB4J.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 };
|
package/dist/entities/index.mjs
CHANGED
|
@@ -16,5 +16,20 @@ let EntityUpdateType = /* @__PURE__ */ function(EntityUpdateType) {
|
|
|
16
16
|
}({});
|
|
17
17
|
|
|
18
18
|
//#endregion
|
|
19
|
-
|
|
19
|
+
//#region src/entities/entity-scheduler.ts
|
|
20
|
+
/**
|
|
21
|
+
* Controls which scheduling modes are paused.
|
|
22
|
+
*/
|
|
23
|
+
let SchedulerPauseType = /* @__PURE__ */ function(SchedulerPauseType) {
|
|
24
|
+
/** Pause both interval timers and frame subscriptions. */
|
|
25
|
+
SchedulerPauseType["full"] = "full";
|
|
26
|
+
/** Pause only frame subscriptions. Interval timers continue firing. */
|
|
27
|
+
SchedulerPauseType["perFrame"] = "perFrame";
|
|
28
|
+
/** Pause only interval timers. Frame subscriptions continue. */
|
|
29
|
+
SchedulerPauseType["intervals"] = "intervals";
|
|
30
|
+
return SchedulerPauseType;
|
|
31
|
+
}({});
|
|
32
|
+
|
|
33
|
+
//#endregion
|
|
34
|
+
export { EntityUpdateType, SchedulerPauseType };
|
|
20
35
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/entities/entity-queue.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"],"mappings":";;;;;AAQA,IAAY,8DAAL;;;;AAIL;;;;AAIA"}
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/factories/pipeline-factory.ts"],"sourcesContent":["import { IPipelineContext } from '../pipelines';\nimport { IPipeline } from '../pipelines/pipeline';\n\n/**\n * Category identifier for grouping performance metrics.\n * Typed as string to allow extension beyond the built-in {@link PipelineCategory} values.\n */\nexport type PipelineCategoryName = string;\n\n/**\n * Built-in metric categories for classifying pipeline and middleware performance entries.\n *\n * - `module` — System module pipelines (initialize, update, render, sync phases).\n * - `runtime` — Runtime orchestration pipeline and its middleware.\n * - `system` — Individual system middleware within a module pipeline.\n */\nexport enum PipelineCategory {\n module = 'module',\n runtime = 'runtime',\n system = 'system'\n}\n\n/**\n * Options for identifying and categorizing performance metrics on pipelines.\n */\nexport type PipelineMetricOptions = {\n /** Display name for the pipeline in performance metrics. */\n pipelineName: string;\n /** Category assigned to pipeline-level metric entries. */\n pipelineCategory: PipelineCategoryName;\n /** Category assigned to per-middleware metric entries within this pipeline. */\n middlewareCategory: PipelineCategoryName;\n};\n\n/**\n * Creates pipeline instances for various contexts.\n * Abstracts pipeline creation to support different implementations.\n * Used by the system to instantiate pipelines without coupling to specific implementations.\n */\nexport interface IPipelineFactory {\n /**\n * Creates a new pipeline for the specified context type.\n * @template TContext - The context type for the pipeline. Must extend IPipelineContext.\n * @param options - Optional performance metric options (name, category) for the pipeline.\n * @returns A new pipeline instance ready for middleware registration.\n */\n createPipeline<TContext extends IPipelineContext>(\n options?: PipelineMetricOptions\n ): IPipeline<TContext>;\n}\n"],"mappings":";;;;;;;;;AAgBA,IAAY,8DAAL;AACL;AACA;AACA"}
|
|
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,8DAAL;AACL;AACA;AACA"}
|
|
@@ -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-
|
|
3
|
-
import { n as ISystemsRuntimeContext, o as ISystemsModuleBuilder, u as ISystemContext } from "../index-
|
|
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-BPKNH5VY.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-
|
|
3
|
-
import { n as ISystemsRuntimeContext, o as ISystemsModuleBuilder, u as ISystemContext } from "../index-
|
|
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-Iv388eRi.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/factories/context-factory.d.ts
|
|
6
6
|
interface IContextFactory {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/factories/pipeline-factory.ts"],"sourcesContent":["import { IPipelineContext } from '../pipelines';\nimport { IPipeline } from '../pipelines/pipeline';\n\n/**\n * Category identifier for grouping performance metrics.\n * Typed as string to allow extension beyond the built-in {@link PipelineCategory} values.\n */\nexport type PipelineCategoryName = string;\n\n/**\n * Built-in metric categories for classifying pipeline and middleware performance entries.\n *\n * - `module` — System module pipelines (initialize, update, render, sync phases).\n * - `runtime` — Runtime orchestration pipeline and its middleware.\n * - `system` — Individual system middleware within a module pipeline.\n */\nexport enum PipelineCategory {\n module = 'module',\n runtime = 'runtime',\n system = 'system'\n}\n\n/**\n * Options for identifying and categorizing performance metrics on pipelines.\n */\nexport type PipelineMetricOptions = {\n /** Display name for the pipeline in performance metrics. */\n pipelineName: string;\n /** Category assigned to pipeline-level metric entries. */\n pipelineCategory: PipelineCategoryName;\n /** Category assigned to per-middleware metric entries within this pipeline. */\n middlewareCategory: PipelineCategoryName;\n};\n\n/**\n * Creates pipeline instances for various contexts.\n * Abstracts pipeline creation to support different implementations.\n * Used by the system to instantiate pipelines without coupling to specific implementations.\n */\nexport interface IPipelineFactory {\n /**\n * Creates a new pipeline for the specified context type.\n * @template TContext - The context type for the pipeline. Must extend IPipelineContext.\n * @param options - Optional performance metric options (name, category) for the pipeline.\n * @returns A new pipeline instance ready for middleware registration.\n */\n createPipeline<TContext extends IPipelineContext>(\n options?: PipelineMetricOptions\n ): IPipeline<TContext>;\n}\n"],"mappings":";;;;;;;;AAgBA,IAAY,8DAAL;AACL;AACA;AACA"}
|
|
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,8DAAL;AACL;AACA;AACA"}
|
|
@@ -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 {
|
|
4
|
-
import { a as ILogger, c as IJsonSerializer, r as PerformanceTimeEntry } from "./index-
|
|
5
|
-
import { c as IMiddleware, l as IPipelineContext, o as IPipeline } from "./index-
|
|
3
|
+
import { c as IEntitySnapshot, d as EntityEventSubscriptionOptions, f as EntityEventUid, g as IEventData, o as IEntityUpdate, p as IEntityEvent } from "./index-s3-CSfQd.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
|
/**
|
|
@@ -188,6 +188,12 @@ interface ISystemContextScheduler {
|
|
|
188
188
|
* @param target - Optional entity to unschedule. Defaults to current entity in context.
|
|
189
189
|
*/
|
|
190
190
|
removeSchedule(target?: IEntityProxy): void;
|
|
191
|
+
/**
|
|
192
|
+
* Checks whether an entity has a scheduled update.
|
|
193
|
+
* If no target is specified, checks the current entity.
|
|
194
|
+
* @param target - Optional entity to check. Defaults to current entity in context.
|
|
195
|
+
*/
|
|
196
|
+
hasSchedule(target?: IEntityProxy): boolean;
|
|
191
197
|
}
|
|
192
198
|
//#endregion
|
|
193
199
|
//#region src/systems/pipeline/system-context-snapshot.d.ts
|
|
@@ -365,6 +371,14 @@ interface ISystemsModuleBuilder<TEntity extends IEntity> {
|
|
|
365
371
|
* Accessible during and after construction.
|
|
366
372
|
*/
|
|
367
373
|
readonly pipelines: ReadonlyMap<SystemType, IPipeline<ISystemContext<TEntity>>>;
|
|
374
|
+
/**
|
|
375
|
+
* Whether this entity type is a scope root.
|
|
376
|
+
*/
|
|
377
|
+
readonly scopeRoot: boolean;
|
|
378
|
+
/**
|
|
379
|
+
* Whether this entity type is a scoped proxy.
|
|
380
|
+
*/
|
|
381
|
+
readonly scopedProxy: boolean;
|
|
368
382
|
/**
|
|
369
383
|
* Registers middleware systems for a specific pipeline stage.
|
|
370
384
|
* The middleware are added to the pipeline in the order provided.
|
|
@@ -516,4 +530,4 @@ interface ISystemsRuntimeContext<TEntity extends IEntity> extends IPipelineConte
|
|
|
516
530
|
type ISystemsRuntimeMiddleware<TEntity extends IEntity> = IMiddleware<ISystemsRuntimeContext<TEntity>>;
|
|
517
531
|
//#endregion
|
|
518
532
|
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-
|
|
533
|
+
//# sourceMappingURL=index-BPKNH5VY.d.cts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as Immutable } from "./types-DLOd2zXO.cjs";
|
|
2
|
-
import { r as PerformanceTimeEntry } from "./index-
|
|
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-
|
|
224
|
+
//# sourceMappingURL=index-BQojRXVz.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-
|
|
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,5 +1,5 @@
|
|
|
1
1
|
import { n as Immutable } from "./types-CnDtpKsY.mjs";
|
|
2
|
-
import { r as PerformanceTimeEntry } from "./index-
|
|
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-
|
|
224
|
+
//# sourceMappingURL=index-DeYfvKO0.d.mts.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 {
|
|
4
|
-
import { a as ILogger, c as IJsonSerializer, r as PerformanceTimeEntry } from "./index-
|
|
5
|
-
import { c as IMiddleware, l as IPipelineContext, o as IPipeline } from "./index-
|
|
3
|
+
import { c as IEntitySnapshot, d as EntityEventSubscriptionOptions, f as EntityEventUid, g as IEventData, o as IEntityUpdate, p as IEntityEvent } from "./index-xgRroB4J.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
|
/**
|
|
@@ -188,6 +188,12 @@ interface ISystemContextScheduler {
|
|
|
188
188
|
* @param target - Optional entity to unschedule. Defaults to current entity in context.
|
|
189
189
|
*/
|
|
190
190
|
removeSchedule(target?: IEntityProxy): void;
|
|
191
|
+
/**
|
|
192
|
+
* Checks whether an entity has a scheduled update.
|
|
193
|
+
* If no target is specified, checks the current entity.
|
|
194
|
+
* @param target - Optional entity to check. Defaults to current entity in context.
|
|
195
|
+
*/
|
|
196
|
+
hasSchedule(target?: IEntityProxy): boolean;
|
|
191
197
|
}
|
|
192
198
|
//#endregion
|
|
193
199
|
//#region src/systems/pipeline/system-context-snapshot.d.ts
|
|
@@ -365,6 +371,14 @@ interface ISystemsModuleBuilder<TEntity extends IEntity> {
|
|
|
365
371
|
* Accessible during and after construction.
|
|
366
372
|
*/
|
|
367
373
|
readonly pipelines: ReadonlyMap<SystemType, IPipeline<ISystemContext<TEntity>>>;
|
|
374
|
+
/**
|
|
375
|
+
* Whether this entity type is a scope root.
|
|
376
|
+
*/
|
|
377
|
+
readonly scopeRoot: boolean;
|
|
378
|
+
/**
|
|
379
|
+
* Whether this entity type is a scoped proxy.
|
|
380
|
+
*/
|
|
381
|
+
readonly scopedProxy: boolean;
|
|
368
382
|
/**
|
|
369
383
|
* Registers middleware systems for a specific pipeline stage.
|
|
370
384
|
* The middleware are added to the pipeline in the order provided.
|
|
@@ -516,4 +530,4 @@ interface ISystemsRuntimeContext<TEntity extends IEntity> extends IPipelineConte
|
|
|
516
530
|
type ISystemsRuntimeMiddleware<TEntity extends IEntity> = IMiddleware<ISystemsRuntimeContext<TEntity>>;
|
|
517
531
|
//#endregion
|
|
518
532
|
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-
|
|
533
|
+
//# sourceMappingURL=index-Iv388eRi.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-
|
|
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
|
|
@@ -306,24 +306,62 @@ type EntitySchedule = {
|
|
|
306
306
|
readonly proxy: IEntityProxy;
|
|
307
307
|
readonly intervalMs?: number;
|
|
308
308
|
};
|
|
309
|
+
/**
|
|
310
|
+
* Controls which scheduling modes are paused.
|
|
311
|
+
*/
|
|
312
|
+
declare enum SchedulerPauseType {
|
|
313
|
+
/** Pause both interval timers and frame subscriptions. */
|
|
314
|
+
full = "full",
|
|
315
|
+
/** Pause only frame subscriptions. Interval timers continue firing. */
|
|
316
|
+
perFrame = "perFrame",
|
|
317
|
+
/** Pause only interval timers. Frame subscriptions continue. */
|
|
318
|
+
intervals = "intervals"
|
|
319
|
+
}
|
|
309
320
|
/**
|
|
310
321
|
* Manages time-based scheduling of entity updates.
|
|
311
|
-
*
|
|
322
|
+
*
|
|
323
|
+
* Entities can be scheduled with an interval (timer-driven) or without one (per-frame).
|
|
324
|
+
* The runtime pulls pending entities each tick via the {@link pending} iterator,
|
|
325
|
+
* which yields both per-frame subscriptions and interval entities whose timer has fired.
|
|
312
326
|
*/
|
|
313
327
|
interface IEntityScheduler {
|
|
314
328
|
/**
|
|
315
329
|
* Returns all currently scheduled entities with their configuration.
|
|
330
|
+
* Useful for inspection and debugging.
|
|
316
331
|
*/
|
|
317
332
|
readonly schedules: ReadonlyArray<EntitySchedule>;
|
|
318
333
|
/**
|
|
319
|
-
*
|
|
334
|
+
* Yields entities pending processing this tick: per-frame subscriptions
|
|
335
|
+
* followed by interval entities whose timer has fired since the last drain.
|
|
336
|
+
* Iterating drains the due interval buckets; a second iteration without
|
|
337
|
+
* timer advancement yields only per-frame subscriptions.
|
|
338
|
+
*/
|
|
339
|
+
readonly pending: IterableIterator<IEntityProxy>;
|
|
340
|
+
/**
|
|
341
|
+
* The set of entities scheduled for per-frame updates (no interval).
|
|
342
|
+
*/
|
|
343
|
+
readonly frameSubscriptions: ReadonlySet<IEntityProxy>;
|
|
344
|
+
/**
|
|
345
|
+
* Entity types currently excluded from {@link pending} iteration.
|
|
346
|
+
*/
|
|
347
|
+
readonly skippedEntityTypes: ReadonlySet<EntityTypeUid>;
|
|
348
|
+
/**
|
|
349
|
+
* The number of entities currently awaiting processing:
|
|
350
|
+
* per-frame subscriptions (if not paused) plus interval entities whose timer has fired.
|
|
351
|
+
*/
|
|
352
|
+
readonly pendingCount: number;
|
|
353
|
+
/**
|
|
354
|
+
* Whether the scheduler is currently paused in any mode.
|
|
355
|
+
*/
|
|
356
|
+
readonly isPaused: boolean;
|
|
357
|
+
/**
|
|
358
|
+
* Registers an entity for updates.
|
|
320
359
|
* @param entityProxy - The entity to schedule.
|
|
321
|
-
* @param intervalMs - Update frequency in milliseconds. If omitted,
|
|
360
|
+
* @param intervalMs - Update frequency in milliseconds. If omitted, the entity is scheduled per-frame.
|
|
322
361
|
*/
|
|
323
362
|
schedule(entityProxy: IEntityProxy, intervalMs?: number): void;
|
|
324
363
|
/**
|
|
325
364
|
* Unregisters an entity from the scheduler.
|
|
326
|
-
* The entity will no longer receive periodic updates.
|
|
327
365
|
* @param entityProxy - The entity to unschedule.
|
|
328
366
|
*/
|
|
329
367
|
remove(entityProxy: IEntityProxy): void;
|
|
@@ -333,7 +371,29 @@ interface IEntityScheduler {
|
|
|
333
371
|
* @returns True if the entity is scheduled, false otherwise.
|
|
334
372
|
*/
|
|
335
373
|
has(entityProxy: IEntityProxy): boolean;
|
|
374
|
+
/**
|
|
375
|
+
* Removes all schedules and clears all timers.
|
|
376
|
+
*/
|
|
377
|
+
clear(): void;
|
|
378
|
+
/**
|
|
379
|
+
* Excludes an entity type from {@link pending} iteration.
|
|
380
|
+
* Entities remain registered; only yielding is suppressed.
|
|
381
|
+
*/
|
|
382
|
+
skipEntityType(entityType: EntityTypeUid): void;
|
|
383
|
+
/**
|
|
384
|
+
* Re-includes a previously skipped entity type in {@link pending} iteration.
|
|
385
|
+
*/
|
|
386
|
+
unskipEntityType(entityType: EntityTypeUid): void;
|
|
387
|
+
/**
|
|
388
|
+
* Pauses the scheduler.
|
|
389
|
+
* @param type - Which scheduling modes to pause. Defaults to {@link SchedulerPauseType.full}.
|
|
390
|
+
*/
|
|
391
|
+
pause(type?: SchedulerPauseType): void;
|
|
392
|
+
/**
|
|
393
|
+
* Resumes the scheduler from any paused state.
|
|
394
|
+
*/
|
|
395
|
+
resume(): void;
|
|
336
396
|
}
|
|
337
397
|
//#endregion
|
|
338
|
-
export {
|
|
339
|
-
//# sourceMappingURL=index-
|
|
398
|
+
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-s3-CSfQd.d.cts.map
|
|
@@ -306,24 +306,62 @@ type EntitySchedule = {
|
|
|
306
306
|
readonly proxy: IEntityProxy;
|
|
307
307
|
readonly intervalMs?: number;
|
|
308
308
|
};
|
|
309
|
+
/**
|
|
310
|
+
* Controls which scheduling modes are paused.
|
|
311
|
+
*/
|
|
312
|
+
declare enum SchedulerPauseType {
|
|
313
|
+
/** Pause both interval timers and frame subscriptions. */
|
|
314
|
+
full = "full",
|
|
315
|
+
/** Pause only frame subscriptions. Interval timers continue firing. */
|
|
316
|
+
perFrame = "perFrame",
|
|
317
|
+
/** Pause only interval timers. Frame subscriptions continue. */
|
|
318
|
+
intervals = "intervals"
|
|
319
|
+
}
|
|
309
320
|
/**
|
|
310
321
|
* Manages time-based scheduling of entity updates.
|
|
311
|
-
*
|
|
322
|
+
*
|
|
323
|
+
* Entities can be scheduled with an interval (timer-driven) or without one (per-frame).
|
|
324
|
+
* The runtime pulls pending entities each tick via the {@link pending} iterator,
|
|
325
|
+
* which yields both per-frame subscriptions and interval entities whose timer has fired.
|
|
312
326
|
*/
|
|
313
327
|
interface IEntityScheduler {
|
|
314
328
|
/**
|
|
315
329
|
* Returns all currently scheduled entities with their configuration.
|
|
330
|
+
* Useful for inspection and debugging.
|
|
316
331
|
*/
|
|
317
332
|
readonly schedules: ReadonlyArray<EntitySchedule>;
|
|
318
333
|
/**
|
|
319
|
-
*
|
|
334
|
+
* Yields entities pending processing this tick: per-frame subscriptions
|
|
335
|
+
* followed by interval entities whose timer has fired since the last drain.
|
|
336
|
+
* Iterating drains the due interval buckets; a second iteration without
|
|
337
|
+
* timer advancement yields only per-frame subscriptions.
|
|
338
|
+
*/
|
|
339
|
+
readonly pending: IterableIterator<IEntityProxy>;
|
|
340
|
+
/**
|
|
341
|
+
* The set of entities scheduled for per-frame updates (no interval).
|
|
342
|
+
*/
|
|
343
|
+
readonly frameSubscriptions: ReadonlySet<IEntityProxy>;
|
|
344
|
+
/**
|
|
345
|
+
* Entity types currently excluded from {@link pending} iteration.
|
|
346
|
+
*/
|
|
347
|
+
readonly skippedEntityTypes: ReadonlySet<EntityTypeUid>;
|
|
348
|
+
/**
|
|
349
|
+
* The number of entities currently awaiting processing:
|
|
350
|
+
* per-frame subscriptions (if not paused) plus interval entities whose timer has fired.
|
|
351
|
+
*/
|
|
352
|
+
readonly pendingCount: number;
|
|
353
|
+
/**
|
|
354
|
+
* Whether the scheduler is currently paused in any mode.
|
|
355
|
+
*/
|
|
356
|
+
readonly isPaused: boolean;
|
|
357
|
+
/**
|
|
358
|
+
* Registers an entity for updates.
|
|
320
359
|
* @param entityProxy - The entity to schedule.
|
|
321
|
-
* @param intervalMs - Update frequency in milliseconds. If omitted,
|
|
360
|
+
* @param intervalMs - Update frequency in milliseconds. If omitted, the entity is scheduled per-frame.
|
|
322
361
|
*/
|
|
323
362
|
schedule(entityProxy: IEntityProxy, intervalMs?: number): void;
|
|
324
363
|
/**
|
|
325
364
|
* Unregisters an entity from the scheduler.
|
|
326
|
-
* The entity will no longer receive periodic updates.
|
|
327
365
|
* @param entityProxy - The entity to unschedule.
|
|
328
366
|
*/
|
|
329
367
|
remove(entityProxy: IEntityProxy): void;
|
|
@@ -333,7 +371,29 @@ interface IEntityScheduler {
|
|
|
333
371
|
* @returns True if the entity is scheduled, false otherwise.
|
|
334
372
|
*/
|
|
335
373
|
has(entityProxy: IEntityProxy): boolean;
|
|
374
|
+
/**
|
|
375
|
+
* Removes all schedules and clears all timers.
|
|
376
|
+
*/
|
|
377
|
+
clear(): void;
|
|
378
|
+
/**
|
|
379
|
+
* Excludes an entity type from {@link pending} iteration.
|
|
380
|
+
* Entities remain registered; only yielding is suppressed.
|
|
381
|
+
*/
|
|
382
|
+
skipEntityType(entityType: EntityTypeUid): void;
|
|
383
|
+
/**
|
|
384
|
+
* Re-includes a previously skipped entity type in {@link pending} iteration.
|
|
385
|
+
*/
|
|
386
|
+
unskipEntityType(entityType: EntityTypeUid): void;
|
|
387
|
+
/**
|
|
388
|
+
* Pauses the scheduler.
|
|
389
|
+
* @param type - Which scheduling modes to pause. Defaults to {@link SchedulerPauseType.full}.
|
|
390
|
+
*/
|
|
391
|
+
pause(type?: SchedulerPauseType): void;
|
|
392
|
+
/**
|
|
393
|
+
* Resumes the scheduler from any paused state.
|
|
394
|
+
*/
|
|
395
|
+
resume(): void;
|
|
336
396
|
}
|
|
337
397
|
//#endregion
|
|
338
|
-
export {
|
|
339
|
-
//# sourceMappingURL=index-
|
|
398
|
+
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-xgRroB4J.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-
|
|
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-
|
|
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 };
|
package/dist/systems/index.d.cts
CHANGED
|
@@ -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-
|
|
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-BPKNH5VY.cjs";
|
|
2
2
|
export { ISystemContext, ISystemContextEntity, ISystemContextEvents, ISystemContextProxies, ISystemContextRepository, ISystemContextScheduler, ISystemContextSnapshot, ISystemMiddleware, ISystemsModule, ISystemsModuleBuilder, ISystemsModuleRepository, ISystemsRuntime, ISystemsRuntimeContext, ISystemsRuntimeMiddleware, SystemType };
|
package/dist/systems/index.d.mts
CHANGED
|
@@ -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-
|
|
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-Iv388eRi.mjs";
|
|
2
2
|
export { ISystemContext, ISystemContextEntity, ISystemContextEvents, ISystemContextProxies, ISystemContextRepository, ISystemContextScheduler, ISystemContextSnapshot, ISystemMiddleware, ISystemsModule, ISystemsModuleBuilder, ISystemsModuleRepository, ISystemsRuntime, ISystemsRuntimeContext, ISystemsRuntimeMiddleware, SystemType };
|
package/dist/utils/index.cjs
CHANGED
|
@@ -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
|
package/dist/utils/index.cjs.map
CHANGED
|
@@ -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":"
|
|
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"}
|
package/dist/utils/index.d.cts
CHANGED
|
@@ -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-
|
|
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 };
|
package/dist/utils/index.d.mts
CHANGED
|
@@ -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-
|
|
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 };
|
package/dist/utils/index.mjs
CHANGED
|
@@ -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
|
package/dist/utils/index.mjs.map
CHANGED
|
@@ -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":"
|
|
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.
|
|
3
|
+
"version": "0.27.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": "
|
|
100
|
+
"gitHead": "2497216453c86197b6a5e15e7a569b9ccf79a1f1"
|
|
101
101
|
}
|