@awesome-ecs/abstract 0.33.0 → 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.
- package/README.md +119 -124
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +2 -2
- package/dist/components/index.d.mts +2 -2
- package/dist/components/index.mjs.map +1 -1
- package/dist/entities/index.cjs +4 -0
- package/dist/entities/index.cjs.map +1 -1
- package/dist/entities/index.d.cts +3 -3
- package/dist/entities/index.d.mts +3 -3
- package/dist/entities/index.mjs +4 -1
- package/dist/entities/index.mjs.map +1 -1
- package/dist/factories/index.cjs.map +1 -1
- package/dist/factories/index.d.cts +1 -1
- package/dist/factories/index.d.mts +1 -1
- package/dist/factories/index.mjs.map +1 -1
- package/dist/{index-DXbpfhHa.d.mts → index-B3DqdxE6.d.mts} +2 -2
- package/dist/{index--9JJtMKF.d.mts → index-BanhgPCc.d.mts} +34 -22
- package/dist/{index-CPGVaS-_.d.cts → index-BivyWazf.d.cts} +183 -172
- package/dist/{index-0hg5PXZe.d.cts → index-CSaKdQe-.d.cts} +34 -22
- package/dist/{index-BOS-47DQ.d.mts → index-DGyDijY7.d.mts} +183 -172
- package/dist/{index-HeCQLTSE.d.cts → index-DMZSrHoB.d.cts} +134 -101
- package/dist/{index-Tznk33g6.d.mts → index-Dbwzlrgp.d.mts} +134 -101
- package/dist/{index-Bl7Cf9gi.d.cts → index-aVjnG975.d.cts} +2 -2
- package/dist/pipelines/index.d.cts +1 -1
- package/dist/pipelines/index.d.mts +1 -1
- package/dist/systems/index.cjs.map +1 -1
- package/dist/systems/index.d.cts +11 -5
- package/dist/systems/index.d.mts +11 -5
- package/dist/systems/index.mjs.map +1 -1
- package/dist/{types-COxeVghs.d.cts → types-BaCGIrym.d.cts} +1 -1
- package/dist/{types-UnqKSA14.d.mts → types-BaCGIrym.d.mts} +1 -1
- 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.map +1 -1
- package/package.json +2 -2
package/dist/systems/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as Immutable } from "../types-
|
|
3
|
-
import { a as IEntityDispatchGroup } from "../index-
|
|
4
|
-
import { c as IMiddleware, l as IPipelineContext, u as PipelineDispatch } from "../index-
|
|
5
|
-
import { A as
|
|
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
6
|
|
|
7
7
|
//#region src/systems/module/systems-module-repository.d.ts
|
|
8
8
|
/**
|
|
@@ -62,7 +62,13 @@ interface ISystemsRuntimeContext<TEntity extends IEntity> extends IRuntimeContex
|
|
|
62
62
|
* The systems module for the current entity type.
|
|
63
63
|
*/
|
|
64
64
|
readonly systemsModule: ISystemsModule<TEntity> | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* The mutable system context for the current entity being processed.
|
|
67
|
+
*/
|
|
65
68
|
readonly systemContext: IMutableSystemContext<TEntity> | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* Bitmask representing which pipeline stages are enabled for the current entity.
|
|
71
|
+
*/
|
|
66
72
|
readonly pipelineMask: number;
|
|
67
73
|
/**
|
|
68
74
|
* The proxy repository for managing entity proxy relationships and scopes.
|
package/dist/systems/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as Immutable } from "../types-
|
|
3
|
-
import { a as IEntityDispatchGroup } from "../index
|
|
4
|
-
import { c as IMiddleware, l as IPipelineContext, u as PipelineDispatch } from "../index-
|
|
5
|
-
import { A as
|
|
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
6
|
|
|
7
7
|
//#region src/systems/module/systems-module-repository.d.ts
|
|
8
8
|
/**
|
|
@@ -62,7 +62,13 @@ interface ISystemsRuntimeContext<TEntity extends IEntity> extends IRuntimeContex
|
|
|
62
62
|
* The systems module for the current entity type.
|
|
63
63
|
*/
|
|
64
64
|
readonly systemsModule: ISystemsModule<TEntity> | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* The mutable system context for the current entity being processed.
|
|
67
|
+
*/
|
|
65
68
|
readonly systemContext: IMutableSystemContext<TEntity> | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* Bitmask representing which pipeline stages are enabled for the current entity.
|
|
71
|
+
*/
|
|
66
72
|
readonly pipelineMask: number;
|
|
67
73
|
/**
|
|
68
74
|
* The proxy repository for managing entity proxy relationships and scopes.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/systems/pipeline/system-context-control.ts","../../src/systems/system-type.ts"],"sourcesContent":["import type {\n EntityEventSubscriptionOptions,\n EntityEventUid\n} from '../../entities/entity-events';\nimport type { SystemModuleName } from './system-middleware';\n\nexport interface SystemContextControlTarget {\n readonly name?: string;\n}\n\nexport enum SystemContextControlState {\n none = 'none',\n enableCurrentSystem = 'enableCurrentSystem',\n disableCurrentSystem = 'disableCurrentSystem'\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 a module for the current entity.\n */\n disableModule(name: SystemModuleName): void;\n\n /**\n * Re-enables a module for the current entity.\n */\n enableModule(name: SystemModuleName): 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: SystemContextControlTarget): boolean;\n\n /**\n * Disables a specific middleware in the context.\n * @param middleware - The middleware to disable.\n */\n disableMiddleware(middleware: SystemContextControlTarget): void;\n\n /**\n * Enables a specific middleware in the context.\n * @param middleware - The middleware to enable.\n */\n enableMiddleware(middleware: SystemContextControlTarget): void;\n\n /**\n * Registers an event subscription owned by a module. This is runtime-only state:\n * disabling the module should also detach its event subscriptions.\n */\n registerModuleEvent(\n moduleName: SystemModuleName,\n eventUid: EntityEventUid,\n options?: EntityEventSubscriptionOptions\n ): void;\n\n /**\n * Clears all runtime-owned module event subscriptions for the current entity.\n */\n clearModuleEvents(): 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 * 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
|
+
{"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"}
|
|
@@ -86,4 +86,4 @@ type ImmutableObjectDeep<T> = { readonly [K in keyof T]: Immutable<T[K]> };
|
|
|
86
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;
|
|
87
87
|
//#endregion
|
|
88
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 };
|
|
89
|
-
//# sourceMappingURL=types-
|
|
89
|
+
//# sourceMappingURL=types-BaCGIrym.d.cts.map
|
|
@@ -86,4 +86,4 @@ type ImmutableObjectDeep<T> = { readonly [K in keyof T]: Immutable<T[K]> };
|
|
|
86
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;
|
|
87
87
|
//#endregion
|
|
88
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 };
|
|
89
|
-
//# sourceMappingURL=types-
|
|
89
|
+
//# sourceMappingURL=types-BaCGIrym.d.mts.map
|
package/dist/utils/index.cjs.map
CHANGED
|
@@ -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"}
|
package/dist/utils/index.d.cts
CHANGED
|
@@ -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-
|
|
2
|
-
import {
|
|
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 };
|
package/dist/utils/index.d.mts
CHANGED
|
@@ -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-
|
|
2
|
-
import {
|
|
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 };
|
package/dist/utils/index.mjs.map
CHANGED
|
@@ -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.
|
|
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": "
|
|
100
|
+
"gitHead": "f6ed2b79fbbb1d33296fd34d2b165fa81111c174"
|
|
101
101
|
}
|