@awesome-ecs/abstract 0.32.1 → 0.34.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 (38) hide show
  1. package/README.md +119 -125
  2. package/dist/components/index.cjs.map +1 -1
  3. package/dist/components/index.d.cts +2 -2
  4. package/dist/components/index.d.mts +2 -2
  5. package/dist/components/index.mjs.map +1 -1
  6. package/dist/entities/index.cjs +5 -19
  7. package/dist/entities/index.cjs.map +1 -1
  8. package/dist/entities/index.d.cts +3 -3
  9. package/dist/entities/index.d.mts +3 -3
  10. package/dist/entities/index.mjs +5 -20
  11. package/dist/entities/index.mjs.map +1 -1
  12. package/dist/factories/index.cjs.map +1 -1
  13. package/dist/factories/index.d.cts +2 -2
  14. package/dist/factories/index.d.mts +2 -2
  15. package/dist/factories/index.mjs.map +1 -1
  16. package/dist/{index-CeqaKmWR.d.mts → index-B3DqdxE6.d.mts} +11 -11
  17. package/dist/{index-vpjRaGIC.d.mts → index-BanhgPCc.d.mts} +103 -262
  18. package/dist/{index-BD7sDB60.d.mts → index-BivyWazf.d.cts} +257 -407
  19. package/dist/{index-BOsrKTWm.d.cts → index-CSaKdQe-.d.cts} +103 -262
  20. package/dist/{index-BJFNTFDd.d.cts → index-DGyDijY7.d.mts} +257 -407
  21. package/dist/{index-C5nragoq.d.cts → index-DMZSrHoB.d.cts} +141 -100
  22. package/dist/{index-BlP67nCr.d.mts → index-Dbwzlrgp.d.mts} +141 -100
  23. package/dist/{index-DMTkNY1e.d.cts → index-aVjnG975.d.cts} +11 -11
  24. package/dist/pipelines/index.d.cts +2 -2
  25. package/dist/pipelines/index.d.mts +2 -2
  26. package/dist/systems/index.cjs +8 -5
  27. package/dist/systems/index.cjs.map +1 -1
  28. package/dist/systems/index.d.cts +90 -2
  29. package/dist/systems/index.d.mts +90 -2
  30. package/dist/systems/index.mjs +8 -5
  31. package/dist/systems/index.mjs.map +1 -1
  32. package/dist/{types-Bbmnq4ni.d.cts → types-BaCGIrym.d.cts} +19 -4
  33. package/dist/{types-C1ojaDL4.d.mts → types-BaCGIrym.d.mts} +19 -4
  34. package/dist/utils/index.cjs.map +1 -1
  35. package/dist/utils/index.d.cts +2 -2
  36. package/dist/utils/index.d.mts +2 -2
  37. package/dist/utils/index.mjs.map +1 -1
  38. package/package.json +2 -2
@@ -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-DMTkNY1e.cjs";
2
- export { IMiddleware, IMiddlewareRunner, INestedContext, INestedMiddleware, IParentContext, IParentMiddleware, IPipeline, IPipelineContext, IPipelineRunner, PipelineRuntime };
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 PipelineDispatch } from "../index-aVjnG975.cjs";
2
+ export { IMiddleware, IMiddlewareRunner, INestedContext, INestedMiddleware, IParentContext, IParentMiddleware, IPipeline, IPipelineContext, IPipelineRunner, PipelineDispatch };
@@ -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-CeqaKmWR.mjs";
2
- export { IMiddleware, IMiddlewareRunner, INestedContext, INestedMiddleware, IParentContext, IParentMiddleware, IPipeline, IPipelineContext, IPipelineRunner, PipelineRuntime };
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 PipelineDispatch } from "../index-B3DqdxE6.mjs";
2
+ export { IMiddleware, IMiddlewareRunner, INestedContext, INestedMiddleware, IParentContext, IParentMiddleware, IPipeline, IPipelineContext, IPipelineRunner, PipelineDispatch };
@@ -4,8 +4,6 @@ let SystemContextControlState = /* @__PURE__ */ function(SystemContextControlSta
4
4
  SystemContextControlState["none"] = "none";
5
5
  SystemContextControlState["enableCurrentSystem"] = "enableCurrentSystem";
6
6
  SystemContextControlState["disableCurrentSystem"] = "disableCurrentSystem";
7
- SystemContextControlState["enableCurrentModule"] = "enableCurrentModule";
8
- SystemContextControlState["disableCurrentModule"] = "disableCurrentModule";
9
7
  return SystemContextControlState;
10
8
  }({});
11
9
  //#endregion
@@ -27,20 +25,25 @@ let SystemType = /* @__PURE__ */ function(SystemType) {
27
25
  */
28
26
  SystemType[SystemType["config"] = 1] = "config";
29
27
  /**
28
+ * Event reactions routed by event uid.
29
+ * Runs after config and before update for updates carrying events.
30
+ */
31
+ SystemType[SystemType["event"] = 2] = "event";
32
+ /**
30
33
  * Main logic and state updates for the entity.
31
34
  * Runs on every update to change entity behavior and properties.
32
35
  */
33
- SystemType[SystemType["update"] = 2] = "update";
36
+ SystemType[SystemType["update"] = 3] = "update";
34
37
  /**
35
38
  * Output and visualization operations.
36
39
  * Runs after updates to render or display the entity state.
37
40
  */
38
- SystemType[SystemType["render"] = 3] = "render";
41
+ SystemType[SystemType["render"] = 4] = "render";
39
42
  /**
40
43
  * Synchronization and persistence.
41
44
  * Runs last to synchronize state with external systems or storage.
42
45
  */
43
- SystemType[SystemType["sync"] = 4] = "sync";
46
+ SystemType[SystemType["sync"] = 5] = "sync";
44
47
  return SystemType;
45
48
  }({});
46
49
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../src/systems/pipeline/system-context-control.ts","../../src/systems/system-type.ts"],"sourcesContent":["import { IEntity } from '@awesome-ecs/abstract/entities';\nimport { ISystemMiddleware } from './system-middleware';\n\nexport enum SystemContextControlState {\n none = 'none',\n enableCurrentSystem = 'enableCurrentSystem',\n disableCurrentSystem = 'disableCurrentSystem',\n enableCurrentModule = 'enableCurrentModule',\n disableCurrentModule = 'disableCurrentModule'\n}\n\n/**\n * Interface for controlling the execution of systems and modules within a system context.\n * This allows middleware to enable or disable specific systems or entire modules for the current entity.\n */\nexport interface ISystemContextControl {\n /**\n * Disables the current system for the current entity.\n */\n disableCurrentSystem(): void;\n\n /**\n * Re-enables the current system for the current entity.\n */\n enableCurrentSystem(): void;\n\n /**\n * Disables the current module for the current entity.\n */\n disableCurrentModule(): void;\n\n /**\n * Re-enables the current module for the current entity.\n */\n enableCurrentModule(): void;\n}\n\n/**\n * Extended system context interface that includes control state for middleware to manage system and module execution.\n * This allows middleware to query and modify the execution state of systems and modules during pipeline processing.\n */\nexport interface ISystemContextControlState extends ISystemContextControl {\n /**\n * Current state of system/module execution control, indicating whether the current system or module is enabled or disabled.\n */\n readonly state: SystemContextControlState;\n\n /**\n * Checks if a specific middleware is currently disabled in the context, allowing middleware to conditionally execute logic based on the enabled/disabled state of other middleware.\n * @param middleware - The middleware to check for disabled state.\n * @returns True if the specified middleware is currently disabled, false otherwise.\n */\n isMiddlewareDisabled(middleware: ISystemMiddleware<IEntity>): boolean;\n\n /**\n * Disables a specific middleware in the context.\n * @param middleware - The middleware to disable.\n */\n disableMiddleware(middleware: ISystemMiddleware<IEntity>): void;\n\n /**\n * Enables a specific middleware in the context.\n * @param middleware - The middleware to enable.\n */\n enableMiddleware(middleware: ISystemMiddleware<IEntity>): void;\n\n /**\n * Disables an entire module of middleware in the context.\n * @param middleware - A middleware from the module to disable.\n */\n disableModule(middleware: ISystemMiddleware<IEntity>): void;\n\n /**\n * Enables an entire module of middleware in the context.\n * @param middleware - A middleware from the module to enable.\n */\n enableModule(middleware: ISystemMiddleware<IEntity>): void;\n}\n","/**\n * The five phases of entity system execution in each frame.\n * Each phase serves a specific purpose in the entity lifecycle and can be extended by custom system types.\n * The runtime handles each phase in order, allowing systems to perform stage-specific operations.\n */\nexport enum SystemType {\n /**\n * Initial setup and resource allocation for the entity.\n * Runs once when the entity is first created or initialized.\n */\n initialize = 0,\n\n /**\n * Config application and config-dependent resource reconciliation.\n * Runs on entity creation and on updates that carry a config payload.\n */\n config = 1,\n\n /**\n * Main logic and state updates for the entity.\n * Runs on every update to change entity behavior and properties.\n */\n update = 2,\n\n /**\n * Output and visualization operations.\n * Runs after updates to render or display the entity state.\n */\n render = 3,\n\n /**\n * Synchronization and persistence.\n * Runs last to synchronize state with external systems or storage.\n */\n sync = 4\n}\n"],"mappings":";;AAGA,IAAY,4BAAL,yBAAA,2BAAA;CACL,0BAAA,UAAA;CACA,0BAAA,yBAAA;CACA,0BAAA,0BAAA;CACA,0BAAA,yBAAA;CACA,0BAAA,0BAAA;;AACF,EAAA,CAAA,CAAA;;;;;;;;ACJA,IAAY,aAAL,yBAAA,YAAA;;;;;CAKL,WAAA,WAAA,gBAAA,KAAA;;;;;CAMA,WAAA,WAAA,YAAA,KAAA;;;;;CAMA,WAAA,WAAA,YAAA,KAAA;;;;;CAMA,WAAA,WAAA,YAAA,KAAA;;;;;CAMA,WAAA,WAAA,UAAA,KAAA;;AACF,EAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../src/systems/pipeline/system-context-control.ts","../../src/systems/system-type.ts"],"sourcesContent":["import type {\r\n EntityEventSubscriptionOptions,\r\n EntityEventUid\r\n} from '../../entities/entity-events';\r\nimport type { SystemModuleName } from './system-middleware';\r\n\r\nexport interface SystemContextControlTarget {\r\n readonly name?: string;\r\n}\r\n\r\nexport enum SystemContextControlState {\r\n none = 'none',\r\n enableCurrentSystem = 'enableCurrentSystem',\r\n disableCurrentSystem = 'disableCurrentSystem'\r\n}\r\n\r\n/**\r\n * Interface for controlling the execution of systems and modules within a system context.\r\n * This allows middleware to enable or disable specific systems or entire modules for the current entity.\r\n */\r\nexport interface ISystemContextControl {\r\n /**\r\n * Disables the current system for the current entity.\r\n */\r\n disableCurrentSystem(): void;\r\n\r\n /**\r\n * Re-enables the current system for the current entity.\r\n */\r\n enableCurrentSystem(): void;\r\n\r\n /**\r\n * Disables a module for the current entity.\r\n */\r\n disableModule(name: SystemModuleName): void;\r\n\r\n /**\r\n * Re-enables a module for the current entity.\r\n */\r\n enableModule(name: SystemModuleName): void;\r\n}\r\n\r\n/**\r\n * Extended system context interface that includes control state for middleware to manage system and module execution.\r\n * This allows middleware to query and modify the execution state of systems and modules during pipeline processing.\r\n */\r\nexport interface ISystemContextControlState extends ISystemContextControl {\r\n /**\r\n * Current state of system/module execution control, indicating whether the current system or module is enabled or disabled.\r\n */\r\n readonly state: SystemContextControlState;\r\n\r\n /**\r\n * Checks if a specific middleware is currently disabled in the context, allowing middleware to conditionally execute logic based on the enabled/disabled state of other middleware.\r\n * @param middleware - The middleware to check for disabled state.\r\n * @returns True if the specified middleware is currently disabled, false otherwise.\r\n */\r\n isMiddlewareDisabled(middleware: SystemContextControlTarget): boolean;\r\n\r\n /**\r\n * Disables a specific middleware in the context.\r\n * @param middleware - The middleware to disable.\r\n */\r\n disableMiddleware(middleware: SystemContextControlTarget): void;\r\n\r\n /**\r\n * Enables a specific middleware in the context.\r\n * @param middleware - The middleware to enable.\r\n */\r\n enableMiddleware(middleware: SystemContextControlTarget): void;\r\n\r\n /**\r\n * Registers an event subscription owned by a module. This is runtime-only state:\r\n * disabling the module should also detach its event subscriptions.\r\n */\r\n registerModuleEvent(\r\n moduleName: SystemModuleName,\r\n eventUid: EntityEventUid,\r\n options?: EntityEventSubscriptionOptions\r\n ): void;\r\n\r\n /**\r\n * Clears all runtime-owned module event subscriptions for the current entity.\r\n */\r\n clearModuleEvents(): void;\r\n}\r\n","/**\n * The five phases of entity system execution in each frame.\n * Each phase serves a specific purpose in the entity lifecycle and can be extended by custom system types.\n * The runtime handles each phase in order, allowing systems to perform stage-specific operations.\n */\nexport enum SystemType {\n /**\n * Initial setup and resource allocation for the entity.\n * Runs once when the entity is first created or initialized.\n */\n initialize = 0,\n\n /**\n * Config application and config-dependent resource reconciliation.\n * Runs on entity creation and on updates that carry a config payload.\n */\n config = 1,\n\n /**\n * Event reactions routed by event uid.\n * Runs after config and before update for updates carrying events.\n */\n event = 2,\n\n /**\n * Main logic and state updates for the entity.\n * Runs on every update to change entity behavior and properties.\n */\n update = 3,\n\n /**\n * Output and visualization operations.\n * Runs after updates to render or display the entity state.\n */\n render = 4,\n\n /**\n * Synchronization and persistence.\n * Runs last to synchronize state with external systems or storage.\n */\n sync = 5\n}\n"],"mappings":";;AAUA,IAAY,4BAAL,yBAAA,2BAAA;CACL,0BAAA,UAAA;CACA,0BAAA,yBAAA;CACA,0BAAA,0BAAA;;AACF,EAAA,CAAA,CAAA;;;;;;;;ACTA,IAAY,aAAL,yBAAA,YAAA;;;;;CAKL,WAAA,WAAA,gBAAA,KAAA;;;;;CAMA,WAAA,WAAA,YAAA,KAAA;;;;;CAMA,WAAA,WAAA,WAAA,KAAA;;;;;CAMA,WAAA,WAAA,YAAA,KAAA;;;;;CAMA,WAAA,WAAA,YAAA,KAAA;;;;;CAMA,WAAA,WAAA,UAAA,KAAA;;AACF,EAAA,CAAA,CAAA"}
@@ -1,2 +1,90 @@
1
- import { A as ISystemContextRepository, B as SystemModuleName, D as ISystemContextSnapshot, E as ISystemContext, F as SystemContextControlState, H as ISystemContextConfigReadonly, I as ISystemMiddleware, L as MiddlewareRegistry, M as ISystemContextEvents, N as ISystemContextControl, P as ISystemContextControlState, R as MiddlewareRegistryReadonly, T as IMutableSystemContext, V as ISystemContextConfig, a as ISystemsRuntime, c as ISystemsModuleBuilder, i as ISystemsRuntimeContext, j as ISystemContextProxies, k as ISystemContextScheduler, l as ISystemsModuleBuilderReadonly, o as ISystemsModuleRepository, r as ISystemsRuntimeMiddleware, s as ISystemsModule, u as SystemType, z as SystemMiddlewareName } from "../index-BJFNTFDd.cjs";
2
- export { IMutableSystemContext, ISystemContext, ISystemContextConfig, ISystemContextConfigReadonly, ISystemContextControl, ISystemContextControlState, ISystemContextEvents, ISystemContextProxies, ISystemContextRepository, ISystemContextScheduler, ISystemContextSnapshot, ISystemMiddleware, ISystemsModule, ISystemsModuleBuilder, ISystemsModuleBuilderReadonly, ISystemsModuleRepository, ISystemsRuntime, ISystemsRuntimeContext, ISystemsRuntimeMiddleware, MiddlewareRegistry, MiddlewareRegistryReadonly, SystemContextControlState, SystemMiddlewareName, SystemModuleName, SystemType };
1
+ import { f as IEntity, o as IEntityProxyRepository, u as EntityTypeUid } from "../index-DMZSrHoB.cjs";
2
+ import { r as Immutable } from "../types-BaCGIrym.cjs";
3
+ import { a as IEntityDispatchGroup } from "../index-CSaKdQe-.cjs";
4
+ import { c as IMiddleware, l as IPipelineContext, u as PipelineDispatch } from "../index-aVjnG975.cjs";
5
+ import { A as ISystemContextConfigReadonly, C as ISystemEventMiddleware, D as SystemMiddlewareName, E as MiddlewareRegistryReadonly, O as SystemModuleName, S as SystemContextControlTarget, T as MiddlewareRegistry, _ as IMutableSystemContextEvents, a as SystemType, b as ISystemContextControlState, d as IMutableSystemContext, f as ISystemContext, g as ISystemContextProxies, h as ISystemContextRepository, i as ISystemsModule, k as ISystemContextConfig, m as ISystemContextScheduler, n as ISystemsModuleBuilder, p as ISystemContextSnapshot, r as ISystemsModuleBuilderReadonly, v as ISystemContextEvents, w as ISystemMiddleware, x as SystemContextControlState, y as ISystemContextControl } from "../index-BivyWazf.cjs";
6
+
7
+ //#region src/systems/module/systems-module-repository.d.ts
8
+ /**
9
+ * Central registry for all systems modules in the ECS.
10
+ * Maintains a module for each entity type, providing access to all system pipelines.
11
+ * This is the authoritative source for system module data.
12
+ *
13
+ * @template TEntity - The entity types managed by modules in this repository.
14
+ */
15
+ interface ISystemsModuleRepository {
16
+ /**
17
+ * The total number of modules in the repository.
18
+ */
19
+ readonly size: number;
20
+ /**
21
+ * Retrieves the module for a specific entity type.
22
+ * @template TEntity - The entity type to retrieve module for.
23
+ * @param type - The entity type identifier.
24
+ * @returns The systems module for that entity type.
25
+ */
26
+ get<TEntity extends IEntity>(type: EntityTypeUid): ISystemsModule<TEntity>;
27
+ /**
28
+ * Registers or updates a module for an entity type.
29
+ * @param type - The entity type identifier.
30
+ * @param module - The systems module to register.
31
+ */
32
+ set(type: EntityTypeUid, module: ISystemsModule<IEntity>): void;
33
+ /**
34
+ * Retrieves all registered modules.
35
+ * @returns A read-only map of entity type to module.
36
+ */
37
+ list(): ReadonlyMap<EntityTypeUid, Immutable<ISystemsModule<IEntity>>>;
38
+ }
39
+ //#endregion
40
+ //#region src/systems/runtime/systems-runtime.d.ts
41
+ /**
42
+ * Executes system middleware for a scheduler-produced dispatch group.
43
+ */
44
+ interface ISystemsRuntime {
45
+ /**
46
+ * Runs the system runtime for one entity-type dispatch group.
47
+ */
48
+ runTick(group: IEntityDispatchGroup): PipelineDispatch | Promise<PipelineDispatch> | void;
49
+ }
50
+ //#endregion
51
+ //#region src/systems/runtime/systems-runtime-context.d.ts
52
+ interface IRuntimeContext extends IPipelineContext {}
53
+ /**
54
+ * Runtime context for system pipeline execution.
55
+ * Coordinates the execution of system pipelines across all entities.
56
+ * Maintains state about the current entity being processed and enabled pipeline stages.
57
+ *
58
+ * @template TEntity - The entity type being processed.
59
+ */
60
+ interface ISystemsRuntimeContext<TEntity extends IEntity> extends IRuntimeContext {
61
+ /**
62
+ * The systems module for the current entity type.
63
+ */
64
+ readonly systemsModule: ISystemsModule<TEntity> | undefined;
65
+ /**
66
+ * The mutable system context for the current entity being processed.
67
+ */
68
+ readonly systemContext: IMutableSystemContext<TEntity> | undefined;
69
+ /**
70
+ * Bitmask representing which pipeline stages are enabled for the current entity.
71
+ */
72
+ readonly pipelineMask: number;
73
+ /**
74
+ * The proxy repository for managing entity proxy relationships and scopes.
75
+ */
76
+ readonly proxyRepository: IEntityProxyRepository;
77
+ }
78
+ //#endregion
79
+ //#region src/systems/runtime/systems-runtime-middleware.d.ts
80
+ /**
81
+ * Middleware for orchestrating system execution across entities.
82
+ * Operates at the runtime level to coordinate system module pipelines.
83
+ * Can influence which pipelines execute and in what order.
84
+ *
85
+ * @template TEntity - The entity type being processed.
86
+ */
87
+ type ISystemsRuntimeMiddleware<TEntity extends IEntity> = IMiddleware<ISystemsRuntimeContext<TEntity>>;
88
+ //#endregion
89
+ export { IMutableSystemContext, IMutableSystemContextEvents, IRuntimeContext, ISystemContext, ISystemContextConfig, ISystemContextConfigReadonly, ISystemContextControl, ISystemContextControlState, ISystemContextEvents, ISystemContextProxies, ISystemContextRepository, ISystemContextScheduler, ISystemContextSnapshot, ISystemEventMiddleware, ISystemMiddleware, ISystemsModule, ISystemsModuleBuilder, ISystemsModuleBuilderReadonly, ISystemsModuleRepository, ISystemsRuntime, ISystemsRuntimeContext, ISystemsRuntimeMiddleware, MiddlewareRegistry, MiddlewareRegistryReadonly, SystemContextControlState, SystemContextControlTarget, SystemMiddlewareName, SystemModuleName, SystemType };
90
+ //# sourceMappingURL=index.d.cts.map
@@ -1,2 +1,90 @@
1
- import { A as ISystemContextRepository, B as SystemModuleName, D as ISystemContextSnapshot, E as ISystemContext, F as SystemContextControlState, H as ISystemContextConfigReadonly, I as ISystemMiddleware, L as MiddlewareRegistry, M as ISystemContextEvents, N as ISystemContextControl, P as ISystemContextControlState, R as MiddlewareRegistryReadonly, T as IMutableSystemContext, V as ISystemContextConfig, a as ISystemsRuntime, c as ISystemsModuleBuilder, i as ISystemsRuntimeContext, j as ISystemContextProxies, k as ISystemContextScheduler, l as ISystemsModuleBuilderReadonly, o as ISystemsModuleRepository, r as ISystemsRuntimeMiddleware, s as ISystemsModule, u as SystemType, z as SystemMiddlewareName } from "../index-BD7sDB60.mjs";
2
- export { IMutableSystemContext, ISystemContext, ISystemContextConfig, ISystemContextConfigReadonly, ISystemContextControl, ISystemContextControlState, ISystemContextEvents, ISystemContextProxies, ISystemContextRepository, ISystemContextScheduler, ISystemContextSnapshot, ISystemMiddleware, ISystemsModule, ISystemsModuleBuilder, ISystemsModuleBuilderReadonly, ISystemsModuleRepository, ISystemsRuntime, ISystemsRuntimeContext, ISystemsRuntimeMiddleware, MiddlewareRegistry, MiddlewareRegistryReadonly, SystemContextControlState, SystemMiddlewareName, SystemModuleName, SystemType };
1
+ import { f as IEntity, o as IEntityProxyRepository, u as EntityTypeUid } from "../index-Dbwzlrgp.mjs";
2
+ import { r as Immutable } from "../types-BaCGIrym.mjs";
3
+ import { a as IEntityDispatchGroup } from "../index-BanhgPCc.mjs";
4
+ import { c as IMiddleware, l as IPipelineContext, u as PipelineDispatch } from "../index-B3DqdxE6.mjs";
5
+ import { A as ISystemContextConfigReadonly, C as ISystemEventMiddleware, D as SystemMiddlewareName, E as MiddlewareRegistryReadonly, O as SystemModuleName, S as SystemContextControlTarget, T as MiddlewareRegistry, _ as IMutableSystemContextEvents, a as SystemType, b as ISystemContextControlState, d as IMutableSystemContext, f as ISystemContext, g as ISystemContextProxies, h as ISystemContextRepository, i as ISystemsModule, k as ISystemContextConfig, m as ISystemContextScheduler, n as ISystemsModuleBuilder, p as ISystemContextSnapshot, r as ISystemsModuleBuilderReadonly, v as ISystemContextEvents, w as ISystemMiddleware, x as SystemContextControlState, y as ISystemContextControl } from "../index-DGyDijY7.mjs";
6
+
7
+ //#region src/systems/module/systems-module-repository.d.ts
8
+ /**
9
+ * Central registry for all systems modules in the ECS.
10
+ * Maintains a module for each entity type, providing access to all system pipelines.
11
+ * This is the authoritative source for system module data.
12
+ *
13
+ * @template TEntity - The entity types managed by modules in this repository.
14
+ */
15
+ interface ISystemsModuleRepository {
16
+ /**
17
+ * The total number of modules in the repository.
18
+ */
19
+ readonly size: number;
20
+ /**
21
+ * Retrieves the module for a specific entity type.
22
+ * @template TEntity - The entity type to retrieve module for.
23
+ * @param type - The entity type identifier.
24
+ * @returns The systems module for that entity type.
25
+ */
26
+ get<TEntity extends IEntity>(type: EntityTypeUid): ISystemsModule<TEntity>;
27
+ /**
28
+ * Registers or updates a module for an entity type.
29
+ * @param type - The entity type identifier.
30
+ * @param module - The systems module to register.
31
+ */
32
+ set(type: EntityTypeUid, module: ISystemsModule<IEntity>): void;
33
+ /**
34
+ * Retrieves all registered modules.
35
+ * @returns A read-only map of entity type to module.
36
+ */
37
+ list(): ReadonlyMap<EntityTypeUid, Immutable<ISystemsModule<IEntity>>>;
38
+ }
39
+ //#endregion
40
+ //#region src/systems/runtime/systems-runtime.d.ts
41
+ /**
42
+ * Executes system middleware for a scheduler-produced dispatch group.
43
+ */
44
+ interface ISystemsRuntime {
45
+ /**
46
+ * Runs the system runtime for one entity-type dispatch group.
47
+ */
48
+ runTick(group: IEntityDispatchGroup): PipelineDispatch | Promise<PipelineDispatch> | void;
49
+ }
50
+ //#endregion
51
+ //#region src/systems/runtime/systems-runtime-context.d.ts
52
+ interface IRuntimeContext extends IPipelineContext {}
53
+ /**
54
+ * Runtime context for system pipeline execution.
55
+ * Coordinates the execution of system pipelines across all entities.
56
+ * Maintains state about the current entity being processed and enabled pipeline stages.
57
+ *
58
+ * @template TEntity - The entity type being processed.
59
+ */
60
+ interface ISystemsRuntimeContext<TEntity extends IEntity> extends IRuntimeContext {
61
+ /**
62
+ * The systems module for the current entity type.
63
+ */
64
+ readonly systemsModule: ISystemsModule<TEntity> | undefined;
65
+ /**
66
+ * The mutable system context for the current entity being processed.
67
+ */
68
+ readonly systemContext: IMutableSystemContext<TEntity> | undefined;
69
+ /**
70
+ * Bitmask representing which pipeline stages are enabled for the current entity.
71
+ */
72
+ readonly pipelineMask: number;
73
+ /**
74
+ * The proxy repository for managing entity proxy relationships and scopes.
75
+ */
76
+ readonly proxyRepository: IEntityProxyRepository;
77
+ }
78
+ //#endregion
79
+ //#region src/systems/runtime/systems-runtime-middleware.d.ts
80
+ /**
81
+ * Middleware for orchestrating system execution across entities.
82
+ * Operates at the runtime level to coordinate system module pipelines.
83
+ * Can influence which pipelines execute and in what order.
84
+ *
85
+ * @template TEntity - The entity type being processed.
86
+ */
87
+ type ISystemsRuntimeMiddleware<TEntity extends IEntity> = IMiddleware<ISystemsRuntimeContext<TEntity>>;
88
+ //#endregion
89
+ export { IMutableSystemContext, IMutableSystemContextEvents, IRuntimeContext, ISystemContext, ISystemContextConfig, ISystemContextConfigReadonly, ISystemContextControl, ISystemContextControlState, ISystemContextEvents, ISystemContextProxies, ISystemContextRepository, ISystemContextScheduler, ISystemContextSnapshot, ISystemEventMiddleware, ISystemMiddleware, ISystemsModule, ISystemsModuleBuilder, ISystemsModuleBuilderReadonly, ISystemsModuleRepository, ISystemsRuntime, ISystemsRuntimeContext, ISystemsRuntimeMiddleware, MiddlewareRegistry, MiddlewareRegistryReadonly, SystemContextControlState, SystemContextControlTarget, SystemMiddlewareName, SystemModuleName, SystemType };
90
+ //# sourceMappingURL=index.d.mts.map
@@ -3,8 +3,6 @@ let SystemContextControlState = /* @__PURE__ */ function(SystemContextControlSta
3
3
  SystemContextControlState["none"] = "none";
4
4
  SystemContextControlState["enableCurrentSystem"] = "enableCurrentSystem";
5
5
  SystemContextControlState["disableCurrentSystem"] = "disableCurrentSystem";
6
- SystemContextControlState["enableCurrentModule"] = "enableCurrentModule";
7
- SystemContextControlState["disableCurrentModule"] = "disableCurrentModule";
8
6
  return SystemContextControlState;
9
7
  }({});
10
8
  //#endregion
@@ -26,20 +24,25 @@ let SystemType = /* @__PURE__ */ function(SystemType) {
26
24
  */
27
25
  SystemType[SystemType["config"] = 1] = "config";
28
26
  /**
27
+ * Event reactions routed by event uid.
28
+ * Runs after config and before update for updates carrying events.
29
+ */
30
+ SystemType[SystemType["event"] = 2] = "event";
31
+ /**
29
32
  * Main logic and state updates for the entity.
30
33
  * Runs on every update to change entity behavior and properties.
31
34
  */
32
- SystemType[SystemType["update"] = 2] = "update";
35
+ SystemType[SystemType["update"] = 3] = "update";
33
36
  /**
34
37
  * Output and visualization operations.
35
38
  * Runs after updates to render or display the entity state.
36
39
  */
37
- SystemType[SystemType["render"] = 3] = "render";
40
+ SystemType[SystemType["render"] = 4] = "render";
38
41
  /**
39
42
  * Synchronization and persistence.
40
43
  * Runs last to synchronize state with external systems or storage.
41
44
  */
42
- SystemType[SystemType["sync"] = 4] = "sync";
45
+ SystemType[SystemType["sync"] = 5] = "sync";
43
46
  return SystemType;
44
47
  }({});
45
48
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../src/systems/pipeline/system-context-control.ts","../../src/systems/system-type.ts"],"sourcesContent":["import { IEntity } from '@awesome-ecs/abstract/entities';\nimport { ISystemMiddleware } from './system-middleware';\n\nexport enum SystemContextControlState {\n none = 'none',\n enableCurrentSystem = 'enableCurrentSystem',\n disableCurrentSystem = 'disableCurrentSystem',\n enableCurrentModule = 'enableCurrentModule',\n disableCurrentModule = 'disableCurrentModule'\n}\n\n/**\n * Interface for controlling the execution of systems and modules within a system context.\n * This allows middleware to enable or disable specific systems or entire modules for the current entity.\n */\nexport interface ISystemContextControl {\n /**\n * Disables the current system for the current entity.\n */\n disableCurrentSystem(): void;\n\n /**\n * Re-enables the current system for the current entity.\n */\n enableCurrentSystem(): void;\n\n /**\n * Disables the current module for the current entity.\n */\n disableCurrentModule(): void;\n\n /**\n * Re-enables the current module for the current entity.\n */\n enableCurrentModule(): void;\n}\n\n/**\n * Extended system context interface that includes control state for middleware to manage system and module execution.\n * This allows middleware to query and modify the execution state of systems and modules during pipeline processing.\n */\nexport interface ISystemContextControlState extends ISystemContextControl {\n /**\n * Current state of system/module execution control, indicating whether the current system or module is enabled or disabled.\n */\n readonly state: SystemContextControlState;\n\n /**\n * Checks if a specific middleware is currently disabled in the context, allowing middleware to conditionally execute logic based on the enabled/disabled state of other middleware.\n * @param middleware - The middleware to check for disabled state.\n * @returns True if the specified middleware is currently disabled, false otherwise.\n */\n isMiddlewareDisabled(middleware: ISystemMiddleware<IEntity>): boolean;\n\n /**\n * Disables a specific middleware in the context.\n * @param middleware - The middleware to disable.\n */\n disableMiddleware(middleware: ISystemMiddleware<IEntity>): void;\n\n /**\n * Enables a specific middleware in the context.\n * @param middleware - The middleware to enable.\n */\n enableMiddleware(middleware: ISystemMiddleware<IEntity>): void;\n\n /**\n * Disables an entire module of middleware in the context.\n * @param middleware - A middleware from the module to disable.\n */\n disableModule(middleware: ISystemMiddleware<IEntity>): void;\n\n /**\n * Enables an entire module of middleware in the context.\n * @param middleware - A middleware from the module to enable.\n */\n enableModule(middleware: ISystemMiddleware<IEntity>): void;\n}\n","/**\n * The five phases of entity system execution in each frame.\n * Each phase serves a specific purpose in the entity lifecycle and can be extended by custom system types.\n * The runtime handles each phase in order, allowing systems to perform stage-specific operations.\n */\nexport enum SystemType {\n /**\n * Initial setup and resource allocation for the entity.\n * Runs once when the entity is first created or initialized.\n */\n initialize = 0,\n\n /**\n * Config application and config-dependent resource reconciliation.\n * Runs on entity creation and on updates that carry a config payload.\n */\n config = 1,\n\n /**\n * Main logic and state updates for the entity.\n * Runs on every update to change entity behavior and properties.\n */\n update = 2,\n\n /**\n * Output and visualization operations.\n * Runs after updates to render or display the entity state.\n */\n render = 3,\n\n /**\n * Synchronization and persistence.\n * Runs last to synchronize state with external systems or storage.\n */\n sync = 4\n}\n"],"mappings":";AAGA,IAAY,4BAAL,yBAAA,2BAAA;CACL,0BAAA,UAAA;CACA,0BAAA,yBAAA;CACA,0BAAA,0BAAA;CACA,0BAAA,yBAAA;CACA,0BAAA,0BAAA;;AACF,EAAA,CAAA,CAAA;;;;;;;;ACJA,IAAY,aAAL,yBAAA,YAAA;;;;;CAKL,WAAA,WAAA,gBAAA,KAAA;;;;;CAMA,WAAA,WAAA,YAAA,KAAA;;;;;CAMA,WAAA,WAAA,YAAA,KAAA;;;;;CAMA,WAAA,WAAA,YAAA,KAAA;;;;;CAMA,WAAA,WAAA,UAAA,KAAA;;AACF,EAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../src/systems/pipeline/system-context-control.ts","../../src/systems/system-type.ts"],"sourcesContent":["import type {\r\n EntityEventSubscriptionOptions,\r\n EntityEventUid\r\n} from '../../entities/entity-events';\r\nimport type { SystemModuleName } from './system-middleware';\r\n\r\nexport interface SystemContextControlTarget {\r\n readonly name?: string;\r\n}\r\n\r\nexport enum SystemContextControlState {\r\n none = 'none',\r\n enableCurrentSystem = 'enableCurrentSystem',\r\n disableCurrentSystem = 'disableCurrentSystem'\r\n}\r\n\r\n/**\r\n * Interface for controlling the execution of systems and modules within a system context.\r\n * This allows middleware to enable or disable specific systems or entire modules for the current entity.\r\n */\r\nexport interface ISystemContextControl {\r\n /**\r\n * Disables the current system for the current entity.\r\n */\r\n disableCurrentSystem(): void;\r\n\r\n /**\r\n * Re-enables the current system for the current entity.\r\n */\r\n enableCurrentSystem(): void;\r\n\r\n /**\r\n * Disables a module for the current entity.\r\n */\r\n disableModule(name: SystemModuleName): void;\r\n\r\n /**\r\n * Re-enables a module for the current entity.\r\n */\r\n enableModule(name: SystemModuleName): void;\r\n}\r\n\r\n/**\r\n * Extended system context interface that includes control state for middleware to manage system and module execution.\r\n * This allows middleware to query and modify the execution state of systems and modules during pipeline processing.\r\n */\r\nexport interface ISystemContextControlState extends ISystemContextControl {\r\n /**\r\n * Current state of system/module execution control, indicating whether the current system or module is enabled or disabled.\r\n */\r\n readonly state: SystemContextControlState;\r\n\r\n /**\r\n * Checks if a specific middleware is currently disabled in the context, allowing middleware to conditionally execute logic based on the enabled/disabled state of other middleware.\r\n * @param middleware - The middleware to check for disabled state.\r\n * @returns True if the specified middleware is currently disabled, false otherwise.\r\n */\r\n isMiddlewareDisabled(middleware: SystemContextControlTarget): boolean;\r\n\r\n /**\r\n * Disables a specific middleware in the context.\r\n * @param middleware - The middleware to disable.\r\n */\r\n disableMiddleware(middleware: SystemContextControlTarget): void;\r\n\r\n /**\r\n * Enables a specific middleware in the context.\r\n * @param middleware - The middleware to enable.\r\n */\r\n enableMiddleware(middleware: SystemContextControlTarget): void;\r\n\r\n /**\r\n * Registers an event subscription owned by a module. This is runtime-only state:\r\n * disabling the module should also detach its event subscriptions.\r\n */\r\n registerModuleEvent(\r\n moduleName: SystemModuleName,\r\n eventUid: EntityEventUid,\r\n options?: EntityEventSubscriptionOptions\r\n ): void;\r\n\r\n /**\r\n * Clears all runtime-owned module event subscriptions for the current entity.\r\n */\r\n clearModuleEvents(): void;\r\n}\r\n","/**\n * The five phases of entity system execution in each frame.\n * Each phase serves a specific purpose in the entity lifecycle and can be extended by custom system types.\n * The runtime handles each phase in order, allowing systems to perform stage-specific operations.\n */\nexport enum SystemType {\n /**\n * Initial setup and resource allocation for the entity.\n * Runs once when the entity is first created or initialized.\n */\n initialize = 0,\n\n /**\n * Config application and config-dependent resource reconciliation.\n * Runs on entity creation and on updates that carry a config payload.\n */\n config = 1,\n\n /**\n * Event reactions routed by event uid.\n * Runs after config and before update for updates carrying events.\n */\n event = 2,\n\n /**\n * Main logic and state updates for the entity.\n * Runs on every update to change entity behavior and properties.\n */\n update = 3,\n\n /**\n * Output and visualization operations.\n * Runs after updates to render or display the entity state.\n */\n render = 4,\n\n /**\n * Synchronization and persistence.\n * Runs last to synchronize state with external systems or storage.\n */\n sync = 5\n}\n"],"mappings":";AAUA,IAAY,4BAAL,yBAAA,2BAAA;CACL,0BAAA,UAAA;CACA,0BAAA,yBAAA;CACA,0BAAA,0BAAA;;AACF,EAAA,CAAA,CAAA;;;;;;;;ACTA,IAAY,aAAL,yBAAA,YAAA;;;;;CAKL,WAAA,WAAA,gBAAA,KAAA;;;;;CAMA,WAAA,WAAA,YAAA,KAAA;;;;;CAMA,WAAA,WAAA,WAAA,KAAA;;;;;CAMA,WAAA,WAAA,YAAA,KAAA;;;;;CAMA,WAAA,WAAA,YAAA,KAAA;;;;;CAMA,WAAA,WAAA,UAAA,KAAA;;AACF,EAAA,CAAA,CAAA"}
@@ -52,12 +52,27 @@ type ImmutableMap<K, V> = ReadonlyMap<Immutable<K>, Immutable<V>>;
52
52
  * @template T - Element type of the set.
53
53
  */
54
54
  type ImmutableSet<T> = ReadonlySet<Immutable<T>>;
55
+ declare const __immutableBrand: unique symbol;
55
56
  /**
56
- * Makes all object properties readonly (one level only).
57
+ * Marks an object as immutable while preserving the original type T.
57
58
  *
58
- * @template T - The type to make immutable.
59
+ * Implemented as an intersection (T & brand) rather than a mapped type
60
+ * (`{ readonly [K in keyof T]: T[K] }`) on purpose: a mapped type strips
61
+ * away nominal information from class types, so any `protected`/`private`
62
+ * members on the source class become structurally invisible. That makes
63
+ * `ImmutableObject<MyEntity>` no longer assignable to `MyEntity`, which
64
+ * breaks ergonomic patterns like passing `context.entity` to a helper
65
+ * method typed as `(entity: MyEntity) => ...`.
66
+ *
67
+ * By intersecting with T directly, the original class identity is kept
68
+ * (including protected members), and immutability is enforced at the
69
+ * source declaration via `readonly` fields rather than via the wrapper.
70
+ *
71
+ * @template T - The type to mark immutable.
59
72
  */
60
- type ImmutableObject<T> = { readonly [K in keyof T]: T[K] };
73
+ type ImmutableObject<T> = T & {
74
+ readonly [__immutableBrand]?: never;
75
+ };
61
76
  /**
62
77
  * Recursively makes all properties readonly at all nesting levels.
63
78
  * Provides complete immutability guarantee for the entire object graph.
@@ -71,4 +86,4 @@ type ImmutableObjectDeep<T> = { readonly [K in keyof T]: Immutable<T[K]> };
71
86
  type DeepPartial<T> = T extends ((...args: unknown[]) => unknown) ? T : T extends readonly unknown[] ? T : T extends object ? { [K in keyof T]?: DeepPartial<T[K]> } : T;
72
87
  //#endregion
73
88
  export { ImmutableMap as a, ImmutableSet as c, ImmutableArray as i, Mutable as l, DeepPartial as n, ImmutableObject as o, Immutable as r, ImmutableObjectDeep as s, BooleanProps as t, MutableDeep as u };
74
- //# sourceMappingURL=types-Bbmnq4ni.d.cts.map
89
+ //# sourceMappingURL=types-BaCGIrym.d.cts.map
@@ -52,12 +52,27 @@ type ImmutableMap<K, V> = ReadonlyMap<Immutable<K>, Immutable<V>>;
52
52
  * @template T - Element type of the set.
53
53
  */
54
54
  type ImmutableSet<T> = ReadonlySet<Immutable<T>>;
55
+ declare const __immutableBrand: unique symbol;
55
56
  /**
56
- * Makes all object properties readonly (one level only).
57
+ * Marks an object as immutable while preserving the original type T.
57
58
  *
58
- * @template T - The type to make immutable.
59
+ * Implemented as an intersection (T & brand) rather than a mapped type
60
+ * (`{ readonly [K in keyof T]: T[K] }`) on purpose: a mapped type strips
61
+ * away nominal information from class types, so any `protected`/`private`
62
+ * members on the source class become structurally invisible. That makes
63
+ * `ImmutableObject<MyEntity>` no longer assignable to `MyEntity`, which
64
+ * breaks ergonomic patterns like passing `context.entity` to a helper
65
+ * method typed as `(entity: MyEntity) => ...`.
66
+ *
67
+ * By intersecting with T directly, the original class identity is kept
68
+ * (including protected members), and immutability is enforced at the
69
+ * source declaration via `readonly` fields rather than via the wrapper.
70
+ *
71
+ * @template T - The type to mark immutable.
59
72
  */
60
- type ImmutableObject<T> = { readonly [K in keyof T]: T[K] };
73
+ type ImmutableObject<T> = T & {
74
+ readonly [__immutableBrand]?: never;
75
+ };
61
76
  /**
62
77
  * Recursively makes all properties readonly at all nesting levels.
63
78
  * Provides complete immutability guarantee for the entire object graph.
@@ -71,4 +86,4 @@ type ImmutableObjectDeep<T> = { readonly [K in keyof T]: Immutable<T[K]> };
71
86
  type DeepPartial<T> = T extends ((...args: unknown[]) => unknown) ? T : T extends readonly unknown[] ? T : T extends object ? { [K in keyof T]?: DeepPartial<T[K]> } : T;
72
87
  //#endregion
73
88
  export { ImmutableMap as a, ImmutableSet as c, ImmutableArray as i, Mutable as l, DeepPartial as n, ImmutableObject as o, Immutable as r, ImmutableObjectDeep as s, BooleanProps as t, MutableDeep as u };
74
- //# sourceMappingURL=types-C1ojaDL4.d.mts.map
89
+ //# sourceMappingURL=types-BaCGIrym.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../src/utils/dispatch-sequential.ts","../../src/utils/logger.ts"],"sourcesContent":["/**\n * Executes a function for each item in an iterable, sequentially.\n *\n * Uses a sync fast-path: iterates synchronously until the first Promise is\n * encountered, then switches to async for the remainder. If no item produces\n * a Promise, the entire call stays synchronous with zero async overhead.\n *\n * @param items - The iterable to iterate over.\n * @param fn - The function to call for each item. May return void or a Promise.\n * @returns void if all calls were synchronous, or a Promise if any were async.\n */\nexport function dispatchSequential<T>(\n items: Iterable<T>,\n fn: (item: T) => void | Promise<void>\n): void | Promise<void> {\n const iterator = items[Symbol.iterator]();\n\n for (let next = iterator.next(); !next.done; next = iterator.next()) {\n const result = fn(next.value);\n\n if (result instanceof Promise) {\n return continueAsync(iterator, fn, result);\n }\n }\n}\n\nasync function continueAsync<T>(\n iterator: Iterator<T>,\n fn: (item: T) => void | Promise<void>,\n pending: Promise<void>\n): Promise<void> {\n await pending;\n\n for (let next = iterator.next(); !next.done; next = iterator.next()) {\n const result = fn(next.value);\n\n if (result instanceof Promise) {\n await result;\n }\n }\n}\n","/**\n * Logger interface for debug and diagnostic output.\n * Supports multiple log levels for controlling verbosity.\n * Implementations can target different outputs (console, file, remote, etc.).\n */\nexport interface ILogger {\n /**\n * Logs a message with a specified severity level.\n * @param level - The severity level of the message.\n * @param message - The primary message content.\n * @param args - Additional arguments to include in the log output.\n */\n log(level: LogLevel, message: any, ...args: any[]): void;\n\n /**\n * Logs detailed diagnostic information.\n * Typically the lowest level, most verbose output.\n * @param message - The message to log.\n * @param args - Additional data.\n */\n trace(message: any, ...args: any[]): void;\n\n /**\n * Logs debug-level information.\n * Useful during development and troubleshooting.\n * @param message - The message to log.\n * @param args - Additional data.\n */\n debug(message: any, ...args: any[]): void;\n\n /**\n * Logs warning-level messages.\n * Indicates potentially problematic conditions.\n * @param message - The message to log.\n * @param args - Additional data.\n */\n warn(message: any, ...args: any[]): void;\n\n /**\n * Logs error-level messages.\n * Indicates error conditions that may require attention.\n * @param message - The message to log.\n * @param args - Additional data.\n */\n error(message: any, ...args: any[]): void;\n}\n\n/**\n * Logging severity levels in increasing order.\n */\nexport enum LogLevel {\n /**\n * Most detailed, diagnostic-level logging.\n */\n trace,\n\n /**\n * Development and debugging information.\n */\n debug,\n\n /**\n * Warning-level conditions.\n */\n warn,\n\n /**\n * Error-level conditions.\n */\n error\n}\n\n/**\n * Configuration options for logger instances.\n */\nexport interface ILoggerOptions {\n /**\n * Enables/disables each log level.\n * If a level is disabled, log calls at that level are ignored.\n */\n enabled: Map<LogLevel, boolean>;\n}\n"],"mappings":";;;;;;;;;;;;;AAWA,SAAgB,mBACd,OACA,IACsB;CACtB,MAAM,WAAW,MAAM,OAAO,UAAU;CAExC,KAAK,IAAI,OAAO,SAAS,KAAK,GAAG,CAAC,KAAK,MAAM,OAAO,SAAS,KAAK,GAAG;EACnE,MAAM,SAAS,GAAG,KAAK,KAAK;EAE5B,IAAI,kBAAkB,SACpB,OAAO,cAAc,UAAU,IAAI,MAAM;CAE7C;AACF;AAEA,eAAe,cACb,UACA,IACA,SACe;CACf,MAAM;CAEN,KAAK,IAAI,OAAO,SAAS,KAAK,GAAG,CAAC,KAAK,MAAM,OAAO,SAAS,KAAK,GAAG;EACnE,MAAM,SAAS,GAAG,KAAK,KAAK;EAE5B,IAAI,kBAAkB,SACpB,MAAM;CAEV;AACF;;;;;;ACUA,IAAY,WAAL,yBAAA,UAAA;;;;CAIL,SAAA,SAAA,WAAA,KAAA;;;;CAKA,SAAA,SAAA,WAAA,KAAA;;;;CAKA,SAAA,SAAA,UAAA,KAAA;;;;CAKA,SAAA,SAAA,WAAA,KAAA;;AACF,EAAA,CAAA,CAAA"}
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,UAAU;CAExC,KAAK,IAAI,OAAO,SAAS,KAAK,GAAG,CAAC,KAAK,MAAM,OAAO,SAAS,KAAK,GAAG;EACnE,MAAM,SAAS,GAAG,KAAK,KAAK;EAE5B,IAAI,kBAAkB,SACpB,OAAO,cAAc,UAAU,IAAI,MAAM;CAE7C;AACF;AAEA,eAAe,cACb,UACA,IACA,SACe;CACf,MAAM;CAEN,KAAK,IAAI,OAAO,SAAS,KAAK,GAAG,CAAC,KAAK,MAAM,OAAO,SAAS,KAAK,GAAG;EACnE,MAAM,SAAS,GAAG,KAAK,KAAK;EAE5B,IAAI,kBAAkB,SACpB,MAAM;CAEV;AACF;;;;;;ACUA,IAAY,WAAL,yBAAA,UAAA;;;;CAIL,SAAA,SAAA,WAAA,KAAA;;;;CAKA,SAAA,SAAA,WAAA,KAAA;;;;CAKA,SAAA,SAAA,UAAA,KAAA;;;;CAKA,SAAA,SAAA,WAAA,KAAA;;AACF,EAAA,CAAA,CAAA"}
@@ -1,3 +1,3 @@
1
- import { a as ImmutableMap, c as ImmutableSet, i as ImmutableArray, l as Mutable, n as DeepPartial, o as ImmutableObject, r as Immutable, s as ImmutableObjectDeep, t as BooleanProps, u as MutableDeep } from "../types-Bbmnq4ni.cjs";
2
- import { C as TickSnapshot, G as LogLevel, O as IJsonSerializer, S as TickMetricEntry, U as ILogger, W as ILoggerOptions, _ as PerformanceMetricOptions, b as MiddlewareMetricsSummary, g as IPerformanceTimer, v as PerformanceTimeEntry, w as dispatchSequential, x as RenderSnapshot, y as PerformanceTimerUid } from "../index-BJFNTFDd.cjs";
1
+ import { a as ImmutableMap, c as ImmutableSet, i as ImmutableArray, l as Mutable, n as DeepPartial, o as ImmutableObject, r as Immutable, s as ImmutableObjectDeep, t as BooleanProps, u as MutableDeep } from "../types-BaCGIrym.cjs";
2
+ import { B as ILoggerOptions, F as MiddlewareMetricsSummary, H as IJsonSerializer, I as RenderSnapshot, L as TickMetricEntry, M as PerformanceMetricOptions, N as PerformanceTimeEntry, P as PerformanceTimerUid, R as TickSnapshot, U as dispatchSequential, V as LogLevel, j as IPerformanceTimer, z as ILogger } from "../index-BivyWazf.cjs";
3
3
  export { BooleanProps, DeepPartial, IJsonSerializer, ILogger, ILoggerOptions, IPerformanceTimer, Immutable, ImmutableArray, ImmutableMap, ImmutableObject, ImmutableObjectDeep, ImmutableSet, LogLevel, MiddlewareMetricsSummary, Mutable, MutableDeep, PerformanceMetricOptions, PerformanceTimeEntry, PerformanceTimerUid, RenderSnapshot, TickMetricEntry, TickSnapshot, dispatchSequential };
@@ -1,3 +1,3 @@
1
- import { a as ImmutableMap, c as ImmutableSet, i as ImmutableArray, l as Mutable, n as DeepPartial, o as ImmutableObject, r as Immutable, s as ImmutableObjectDeep, t as BooleanProps, u as MutableDeep } from "../types-C1ojaDL4.mjs";
2
- import { C as TickSnapshot, G as LogLevel, O as IJsonSerializer, S as TickMetricEntry, U as ILogger, W as ILoggerOptions, _ as PerformanceMetricOptions, b as MiddlewareMetricsSummary, g as IPerformanceTimer, v as PerformanceTimeEntry, w as dispatchSequential, x as RenderSnapshot, y as PerformanceTimerUid } from "../index-BD7sDB60.mjs";
1
+ import { a as ImmutableMap, c as ImmutableSet, i as ImmutableArray, l as Mutable, n as DeepPartial, o as ImmutableObject, r as Immutable, s as ImmutableObjectDeep, t as BooleanProps, u as MutableDeep } from "../types-BaCGIrym.mjs";
2
+ import { B as ILoggerOptions, F as MiddlewareMetricsSummary, H as IJsonSerializer, I as RenderSnapshot, L as TickMetricEntry, M as PerformanceMetricOptions, N as PerformanceTimeEntry, P as PerformanceTimerUid, R as TickSnapshot, U as dispatchSequential, V as LogLevel, j as IPerformanceTimer, z as ILogger } from "../index-DGyDijY7.mjs";
3
3
  export { BooleanProps, DeepPartial, IJsonSerializer, ILogger, ILoggerOptions, IPerformanceTimer, Immutable, ImmutableArray, ImmutableMap, ImmutableObject, ImmutableObjectDeep, ImmutableSet, LogLevel, MiddlewareMetricsSummary, Mutable, MutableDeep, PerformanceMetricOptions, PerformanceTimeEntry, PerformanceTimerUid, RenderSnapshot, TickMetricEntry, TickSnapshot, dispatchSequential };
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../src/utils/dispatch-sequential.ts","../../src/utils/logger.ts"],"sourcesContent":["/**\n * Executes a function for each item in an iterable, sequentially.\n *\n * Uses a sync fast-path: iterates synchronously until the first Promise is\n * encountered, then switches to async for the remainder. If no item produces\n * a Promise, the entire call stays synchronous with zero async overhead.\n *\n * @param items - The iterable to iterate over.\n * @param fn - The function to call for each item. May return void or a Promise.\n * @returns void if all calls were synchronous, or a Promise if any were async.\n */\nexport function dispatchSequential<T>(\n items: Iterable<T>,\n fn: (item: T) => void | Promise<void>\n): void | Promise<void> {\n const iterator = items[Symbol.iterator]();\n\n for (let next = iterator.next(); !next.done; next = iterator.next()) {\n const result = fn(next.value);\n\n if (result instanceof Promise) {\n return continueAsync(iterator, fn, result);\n }\n }\n}\n\nasync function continueAsync<T>(\n iterator: Iterator<T>,\n fn: (item: T) => void | Promise<void>,\n pending: Promise<void>\n): Promise<void> {\n await pending;\n\n for (let next = iterator.next(); !next.done; next = iterator.next()) {\n const result = fn(next.value);\n\n if (result instanceof Promise) {\n await result;\n }\n }\n}\n","/**\n * Logger interface for debug and diagnostic output.\n * Supports multiple log levels for controlling verbosity.\n * Implementations can target different outputs (console, file, remote, etc.).\n */\nexport interface ILogger {\n /**\n * Logs a message with a specified severity level.\n * @param level - The severity level of the message.\n * @param message - The primary message content.\n * @param args - Additional arguments to include in the log output.\n */\n log(level: LogLevel, message: any, ...args: any[]): void;\n\n /**\n * Logs detailed diagnostic information.\n * Typically the lowest level, most verbose output.\n * @param message - The message to log.\n * @param args - Additional data.\n */\n trace(message: any, ...args: any[]): void;\n\n /**\n * Logs debug-level information.\n * Useful during development and troubleshooting.\n * @param message - The message to log.\n * @param args - Additional data.\n */\n debug(message: any, ...args: any[]): void;\n\n /**\n * Logs warning-level messages.\n * Indicates potentially problematic conditions.\n * @param message - The message to log.\n * @param args - Additional data.\n */\n warn(message: any, ...args: any[]): void;\n\n /**\n * Logs error-level messages.\n * Indicates error conditions that may require attention.\n * @param message - The message to log.\n * @param args - Additional data.\n */\n error(message: any, ...args: any[]): void;\n}\n\n/**\n * Logging severity levels in increasing order.\n */\nexport enum LogLevel {\n /**\n * Most detailed, diagnostic-level logging.\n */\n trace,\n\n /**\n * Development and debugging information.\n */\n debug,\n\n /**\n * Warning-level conditions.\n */\n warn,\n\n /**\n * Error-level conditions.\n */\n error\n}\n\n/**\n * Configuration options for logger instances.\n */\nexport interface ILoggerOptions {\n /**\n * Enables/disables each log level.\n * If a level is disabled, log calls at that level are ignored.\n */\n enabled: Map<LogLevel, boolean>;\n}\n"],"mappings":";;;;;;;;;;;;AAWA,SAAgB,mBACd,OACA,IACsB;CACtB,MAAM,WAAW,MAAM,OAAO,UAAU;CAExC,KAAK,IAAI,OAAO,SAAS,KAAK,GAAG,CAAC,KAAK,MAAM,OAAO,SAAS,KAAK,GAAG;EACnE,MAAM,SAAS,GAAG,KAAK,KAAK;EAE5B,IAAI,kBAAkB,SACpB,OAAO,cAAc,UAAU,IAAI,MAAM;CAE7C;AACF;AAEA,eAAe,cACb,UACA,IACA,SACe;CACf,MAAM;CAEN,KAAK,IAAI,OAAO,SAAS,KAAK,GAAG,CAAC,KAAK,MAAM,OAAO,SAAS,KAAK,GAAG;EACnE,MAAM,SAAS,GAAG,KAAK,KAAK;EAE5B,IAAI,kBAAkB,SACpB,MAAM;CAEV;AACF;;;;;;ACUA,IAAY,WAAL,yBAAA,UAAA;;;;CAIL,SAAA,SAAA,WAAA,KAAA;;;;CAKA,SAAA,SAAA,WAAA,KAAA;;;;CAKA,SAAA,SAAA,UAAA,KAAA;;;;CAKA,SAAA,SAAA,WAAA,KAAA;;AACF,EAAA,CAAA,CAAA"}
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,UAAU;CAExC,KAAK,IAAI,OAAO,SAAS,KAAK,GAAG,CAAC,KAAK,MAAM,OAAO,SAAS,KAAK,GAAG;EACnE,MAAM,SAAS,GAAG,KAAK,KAAK;EAE5B,IAAI,kBAAkB,SACpB,OAAO,cAAc,UAAU,IAAI,MAAM;CAE7C;AACF;AAEA,eAAe,cACb,UACA,IACA,SACe;CACf,MAAM;CAEN,KAAK,IAAI,OAAO,SAAS,KAAK,GAAG,CAAC,KAAK,MAAM,OAAO,SAAS,KAAK,GAAG;EACnE,MAAM,SAAS,GAAG,KAAK,KAAK;EAE5B,IAAI,kBAAkB,SACpB,MAAM;CAEV;AACF;;;;;;ACUA,IAAY,WAAL,yBAAA,UAAA;;;;CAIL,SAAA,SAAA,WAAA,KAAA;;;;CAKA,SAAA,SAAA,WAAA,KAAA;;;;CAKA,SAAA,SAAA,UAAA,KAAA;;;;CAKA,SAAA,SAAA,WAAA,KAAA;;AACF,EAAA,CAAA,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awesome-ecs/abstract",
3
- "version": "0.32.1",
3
+ "version": "0.34.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": "79f0b8fa9500ab4ed4deaecb2d35b8a74f8ff4f7"
100
+ "gitHead": "f6ed2b79fbbb1d33296fd34d2b165fa81111c174"
101
101
  }