@awesome-ecs/abstract 0.28.0 → 0.30.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/dist/components/index.cjs +2 -2
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +1 -1
- package/dist/components/index.d.mts +1 -1
- package/dist/components/index.mjs +1 -1
- package/dist/components/index.mjs.map +1 -1
- package/dist/entities/index.cjs +2 -3
- 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 +1 -2
- package/dist/entities/index.mjs.map +1 -1
- package/dist/factories/index.cjs +2 -2
- package/dist/factories/index.cjs.map +1 -1
- package/dist/factories/index.d.cts +2 -95
- package/dist/factories/index.d.mts +2 -95
- package/dist/factories/index.mjs +1 -1
- package/dist/factories/index.mjs.map +1 -1
- package/dist/{identity-component-CgzvgBVh.d.mts → identity-component-CuWHf7jX.d.mts} +76 -10
- package/dist/{identity-component-uU0yDR-y.d.cts → identity-component-DLDaOTyK.d.cts} +76 -10
- package/dist/index-8XDo0pla.d.mts +1065 -0
- package/dist/index-BVkmidEx.d.cts +1065 -0
- package/dist/{index-C1Ojam4M.d.cts → index-BguFn1Xj.d.cts} +62 -3
- package/dist/{index-C0v9GTM7.d.mts → index-kNcUiDBd.d.mts} +62 -3
- package/dist/pipelines/index.d.cts +1 -1
- package/dist/pipelines/index.d.mts +1 -1
- package/dist/pipelines/index.mjs +1 -1
- package/dist/systems/index.cjs +2 -2
- package/dist/systems/index.cjs.map +1 -1
- package/dist/systems/index.d.cts +2 -2
- package/dist/systems/index.d.mts +2 -2
- package/dist/systems/index.mjs +1 -1
- package/dist/systems/index.mjs.map +1 -1
- package/dist/utils/index.cjs +2 -3
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.cts +3 -3
- package/dist/utils/index.d.mts +3 -3
- package/dist/utils/index.mjs +1 -2
- package/dist/utils/index.mjs.map +1 -1
- package/package.json +2 -2
- package/dist/index-BQojRXVz.d.cts +0 -224
- package/dist/index-CrMUhuEK.d.cts +0 -544
- package/dist/index-Cs9Eerjt.d.cts +0 -175
- package/dist/index-DQYLun1o.d.mts +0 -544
- package/dist/index-DeYfvKO0.d.mts +0 -224
- package/dist/index-hHkhvmkO.d.mts +0 -175
- package/dist/types-CnDtpKsY.d.mts +0 -70
- package/dist/types-DLOd2zXO.d.cts +0 -70
|
@@ -1,5 +1,58 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { S as IComponent, _ as IEntityProxy, f as EntityTypeUid, h as IEntityModel, m as IEntity, n as IdentityComponent, p as EntityUid } from "./identity-component-DLDaOTyK.cjs";
|
|
2
2
|
|
|
3
|
+
//#region src/entities/entity-context-cache.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* A generic per-entity key-value store for runtime contexts.
|
|
6
|
+
*
|
|
7
|
+
* Each package registers its own per-entity data using its own key constants.
|
|
8
|
+
* Disposal removes all entries for an entity in a single call, covering all packages.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* // Core stores SystemContext:
|
|
12
|
+
* cache.set(entityUid, SYSTEM_KEY, systemContext);
|
|
13
|
+
*
|
|
14
|
+
* // AI stores per-module StateContexts:
|
|
15
|
+
* cache.set(entityUid, `state:${moduleName}`, stateContext);
|
|
16
|
+
*
|
|
17
|
+
* // On removal, one call cleans up everything:
|
|
18
|
+
* cache.disposeEntity(entityUid);
|
|
19
|
+
*/
|
|
20
|
+
interface IEntityContextCache {
|
|
21
|
+
/**
|
|
22
|
+
* Retrieves a cached value by entity UID and key.
|
|
23
|
+
* @template T - The expected value type.
|
|
24
|
+
* @param entityUid - The entity's unique identifier.
|
|
25
|
+
* @param key - The key to look up.
|
|
26
|
+
* @returns The cached value, or undefined if not found.
|
|
27
|
+
*/
|
|
28
|
+
get<T>(entityUid: EntityUid, key: string | symbol): T | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Stores a value for an entity under the given key.
|
|
31
|
+
* @param entityUid - The entity's unique identifier.
|
|
32
|
+
* @param key - The key to store under.
|
|
33
|
+
* @param value - The value to cache.
|
|
34
|
+
*/
|
|
35
|
+
set(entityUid: EntityUid, key: string | symbol, value: unknown): void;
|
|
36
|
+
/**
|
|
37
|
+
* Checks whether a cached entry exists.
|
|
38
|
+
* @param entityUid - The entity's unique identifier.
|
|
39
|
+
* @param key - Optional key to check. If omitted, checks if any entry exists for the entity.
|
|
40
|
+
*/
|
|
41
|
+
has(entityUid: EntityUid, key?: string | symbol): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Returns an iterator over all key-value pairs cached for the given entity.
|
|
44
|
+
* @param entityUid - The entity's unique identifier.
|
|
45
|
+
* @returns An iterable iterator of [key, value] pairs, or undefined if the entity has no entries.
|
|
46
|
+
*/
|
|
47
|
+
getEntries(entityUid: EntityUid): IterableIterator<[string | symbol, unknown]> | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Removes all cached entries for the given entity.
|
|
50
|
+
* Should be called when an entity is removed from the system.
|
|
51
|
+
* @param entityUid - The entity's unique identifier.
|
|
52
|
+
*/
|
|
53
|
+
disposeEntity(entityUid: EntityUid): void;
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
3
56
|
//#region src/entities/entity-events.d.ts
|
|
4
57
|
/**
|
|
5
58
|
* Represents a unique identifier for an entity event.
|
|
@@ -255,6 +308,12 @@ interface IEntityUpdateQueue {
|
|
|
255
308
|
* @returns The next update in the queue.
|
|
256
309
|
*/
|
|
257
310
|
peek(): IEntityUpdate;
|
|
311
|
+
/**
|
|
312
|
+
* Returns a read-only snapshot of all queued updates without removing them.
|
|
313
|
+
* Useful for inspection/debugging UIs.
|
|
314
|
+
* @returns An array of all currently queued updates.
|
|
315
|
+
*/
|
|
316
|
+
items(): ReadonlyArray<IEntityUpdate>;
|
|
258
317
|
/**
|
|
259
318
|
* Removes all updates from the queue.
|
|
260
319
|
*/
|
|
@@ -411,5 +470,5 @@ interface IEntityScheduler {
|
|
|
411
470
|
resume(): void;
|
|
412
471
|
}
|
|
413
472
|
//#endregion
|
|
414
|
-
export { EntityUpdateType as a, IEntitySnapshot as c, EntityEventSubscriptionOptions as d, EntityEventUid as f, IEventData as g, IEntityEventsManager as h, IEntityRepository as i, IEntitySnapshotProvider as l, IEntityEventsDispatcher as m, IEntityScheduler as n, IEntityUpdate as o, IEntityEvent as p, SchedulerPauseType as r, IEntityUpdateQueue as s, EntitySchedule as t, EntityEventSubscriptionFilter as u };
|
|
415
|
-
//# sourceMappingURL=index-
|
|
473
|
+
export { IEntityContextCache as _, EntityUpdateType as a, IEntitySnapshot as c, EntityEventSubscriptionOptions as d, EntityEventUid as f, IEventData as g, IEntityEventsManager as h, IEntityRepository as i, IEntitySnapshotProvider as l, IEntityEventsDispatcher as m, IEntityScheduler as n, IEntityUpdate as o, IEntityEvent as p, SchedulerPauseType as r, IEntityUpdateQueue as s, EntitySchedule as t, EntityEventSubscriptionFilter as u };
|
|
474
|
+
//# sourceMappingURL=index-BguFn1Xj.d.cts.map
|
|
@@ -1,5 +1,58 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { S as IComponent, _ as IEntityProxy, f as EntityTypeUid, h as IEntityModel, m as IEntity, n as IdentityComponent, p as EntityUid } from "./identity-component-CuWHf7jX.mjs";
|
|
2
2
|
|
|
3
|
+
//#region src/entities/entity-context-cache.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* A generic per-entity key-value store for runtime contexts.
|
|
6
|
+
*
|
|
7
|
+
* Each package registers its own per-entity data using its own key constants.
|
|
8
|
+
* Disposal removes all entries for an entity in a single call, covering all packages.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* // Core stores SystemContext:
|
|
12
|
+
* cache.set(entityUid, SYSTEM_KEY, systemContext);
|
|
13
|
+
*
|
|
14
|
+
* // AI stores per-module StateContexts:
|
|
15
|
+
* cache.set(entityUid, `state:${moduleName}`, stateContext);
|
|
16
|
+
*
|
|
17
|
+
* // On removal, one call cleans up everything:
|
|
18
|
+
* cache.disposeEntity(entityUid);
|
|
19
|
+
*/
|
|
20
|
+
interface IEntityContextCache {
|
|
21
|
+
/**
|
|
22
|
+
* Retrieves a cached value by entity UID and key.
|
|
23
|
+
* @template T - The expected value type.
|
|
24
|
+
* @param entityUid - The entity's unique identifier.
|
|
25
|
+
* @param key - The key to look up.
|
|
26
|
+
* @returns The cached value, or undefined if not found.
|
|
27
|
+
*/
|
|
28
|
+
get<T>(entityUid: EntityUid, key: string | symbol): T | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Stores a value for an entity under the given key.
|
|
31
|
+
* @param entityUid - The entity's unique identifier.
|
|
32
|
+
* @param key - The key to store under.
|
|
33
|
+
* @param value - The value to cache.
|
|
34
|
+
*/
|
|
35
|
+
set(entityUid: EntityUid, key: string | symbol, value: unknown): void;
|
|
36
|
+
/**
|
|
37
|
+
* Checks whether a cached entry exists.
|
|
38
|
+
* @param entityUid - The entity's unique identifier.
|
|
39
|
+
* @param key - Optional key to check. If omitted, checks if any entry exists for the entity.
|
|
40
|
+
*/
|
|
41
|
+
has(entityUid: EntityUid, key?: string | symbol): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Returns an iterator over all key-value pairs cached for the given entity.
|
|
44
|
+
* @param entityUid - The entity's unique identifier.
|
|
45
|
+
* @returns An iterable iterator of [key, value] pairs, or undefined if the entity has no entries.
|
|
46
|
+
*/
|
|
47
|
+
getEntries(entityUid: EntityUid): IterableIterator<[string | symbol, unknown]> | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Removes all cached entries for the given entity.
|
|
50
|
+
* Should be called when an entity is removed from the system.
|
|
51
|
+
* @param entityUid - The entity's unique identifier.
|
|
52
|
+
*/
|
|
53
|
+
disposeEntity(entityUid: EntityUid): void;
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
3
56
|
//#region src/entities/entity-events.d.ts
|
|
4
57
|
/**
|
|
5
58
|
* Represents a unique identifier for an entity event.
|
|
@@ -255,6 +308,12 @@ interface IEntityUpdateQueue {
|
|
|
255
308
|
* @returns The next update in the queue.
|
|
256
309
|
*/
|
|
257
310
|
peek(): IEntityUpdate;
|
|
311
|
+
/**
|
|
312
|
+
* Returns a read-only snapshot of all queued updates without removing them.
|
|
313
|
+
* Useful for inspection/debugging UIs.
|
|
314
|
+
* @returns An array of all currently queued updates.
|
|
315
|
+
*/
|
|
316
|
+
items(): ReadonlyArray<IEntityUpdate>;
|
|
258
317
|
/**
|
|
259
318
|
* Removes all updates from the queue.
|
|
260
319
|
*/
|
|
@@ -411,5 +470,5 @@ interface IEntityScheduler {
|
|
|
411
470
|
resume(): void;
|
|
412
471
|
}
|
|
413
472
|
//#endregion
|
|
414
|
-
export { EntityUpdateType as a, IEntitySnapshot as c, EntityEventSubscriptionOptions as d, EntityEventUid as f, IEventData as g, IEntityEventsManager as h, IEntityRepository as i, IEntitySnapshotProvider as l, IEntityEventsDispatcher as m, IEntityScheduler as n, IEntityUpdate as o, IEntityEvent as p, SchedulerPauseType as r, IEntityUpdateQueue as s, EntitySchedule as t, EntityEventSubscriptionFilter as u };
|
|
415
|
-
//# sourceMappingURL=index-
|
|
473
|
+
export { IEntityContextCache as _, EntityUpdateType as a, IEntitySnapshot as c, EntityEventSubscriptionOptions as d, EntityEventUid as f, IEventData as g, IEntityEventsManager as h, IEntityRepository as i, IEntitySnapshotProvider as l, IEntityEventsDispatcher as m, IEntityScheduler as n, IEntityUpdate as o, IEntityEvent as p, SchedulerPauseType as r, IEntityUpdateQueue as s, EntitySchedule as t, EntityEventSubscriptionFilter as u };
|
|
474
|
+
//# sourceMappingURL=index-kNcUiDBd.d.mts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as IMiddleware, C as IPipelineRunner, D as IParentMiddleware, E as IParentContext, M as PipelineRuntime, O as IPipeline, T as INestedMiddleware, j as IPipelineContext, k as IMiddlewareRunner, w as INestedContext } from "../index-BVkmidEx.cjs";
|
|
2
2
|
export { IMiddleware, IMiddlewareRunner, INestedContext, INestedMiddleware, IParentContext, IParentMiddleware, IPipeline, IPipelineContext, IPipelineRunner, PipelineRuntime };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as IMiddleware, C as IPipelineRunner, D as IParentMiddleware, E as IParentContext, M as PipelineRuntime, O as IPipeline, T as INestedMiddleware, j as IPipelineContext, k as IMiddlewareRunner, w as INestedContext } from "../index-8XDo0pla.mjs";
|
|
2
2
|
export { IMiddleware, IMiddlewareRunner, INestedContext, INestedMiddleware, IParentContext, IParentMiddleware, IPipeline, IPipelineContext, IPipelineRunner, PipelineRuntime };
|
package/dist/pipelines/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {};
|
package/dist/systems/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
//#region src/systems/system-type.ts
|
|
3
3
|
/**
|
|
4
4
|
* The four phases of entity system execution in each frame.
|
|
@@ -28,7 +28,7 @@ let SystemType = /* @__PURE__ */ function(SystemType) {
|
|
|
28
28
|
SystemType[SystemType["sync"] = 3] = "sync";
|
|
29
29
|
return SystemType;
|
|
30
30
|
}({});
|
|
31
|
-
|
|
32
31
|
//#endregion
|
|
33
32
|
exports.SystemType = SystemType;
|
|
33
|
+
|
|
34
34
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/systems/system-type.ts"],"sourcesContent":["/**\r\n * The four phases of entity system execution in each frame.\r\n * Each phase serves a specific purpose in the entity lifecycle and can be extended by custom system types.\r\n * The runtime handles each phase in order, allowing systems to perform stage-specific operations.\r\n */\r\nexport enum SystemType {\r\n /**\r\n * Initial setup and resource allocation for the entity.\r\n * Runs once when the entity is first created or initialized.\r\n */\r\n initialize = 0,\r\n\r\n /**\r\n * Main logic and state updates for the entity.\r\n * Runs on every update to change entity behavior and properties.\r\n */\r\n update = 1,\r\n\r\n /**\r\n * Output and visualization operations.\r\n * Runs after updates to render or display the entity state.\r\n */\r\n render = 2,\r\n\r\n /**\r\n * Synchronization and persistence.\r\n * Runs last to synchronize state with external systems or storage.\r\n */\r\n sync = 3\r\n}\r\n"],"mappings":";;;;;;;AAKA,IAAY,
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/systems/system-type.ts"],"sourcesContent":["/**\r\n * The four phases of entity system execution in each frame.\r\n * Each phase serves a specific purpose in the entity lifecycle and can be extended by custom system types.\r\n * The runtime handles each phase in order, allowing systems to perform stage-specific operations.\r\n */\r\nexport enum SystemType {\r\n /**\r\n * Initial setup and resource allocation for the entity.\r\n * Runs once when the entity is first created or initialized.\r\n */\r\n initialize = 0,\r\n\r\n /**\r\n * Main logic and state updates for the entity.\r\n * Runs on every update to change entity behavior and properties.\r\n */\r\n update = 1,\r\n\r\n /**\r\n * Output and visualization operations.\r\n * Runs after updates to render or display the entity state.\r\n */\r\n render = 2,\r\n\r\n /**\r\n * Synchronization and persistence.\r\n * Runs last to synchronize state with external systems or storage.\r\n */\r\n sync = 3\r\n}\r\n"],"mappings":";;;;;;;AAKA,IAAY,aAAL,yBAAA,YAAA;;;;;AAKL,YAAA,WAAA,gBAAA,KAAA;;;;;AAMA,YAAA,WAAA,YAAA,KAAA;;;;;AAMA,YAAA,WAAA,YAAA,KAAA;;;;;AAMA,YAAA,WAAA,UAAA,KAAA;;KACD"}
|
package/dist/systems/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { S as ISystemContextEvents, _ as ISystemContext, a as ISystemsRuntime, b as ISystemContextRepository, c as ISystemMiddleware, g as IMutableSystemContext, i as ISystemsRuntimeContext, l as ISystemsModule, o as ISystemsModuleRepository, r as ISystemsRuntimeMiddleware, s as ISystemsModuleBuilder, u as SystemType, v as ISystemContextSnapshot, x as ISystemContextProxies, y as ISystemContextScheduler } from "../index-BVkmidEx.cjs";
|
|
2
|
+
export { IMutableSystemContext, ISystemContext, ISystemContextEvents, ISystemContextProxies, ISystemContextRepository, ISystemContextScheduler, ISystemContextSnapshot, ISystemMiddleware, ISystemsModule, ISystemsModuleBuilder, ISystemsModuleRepository, ISystemsRuntime, ISystemsRuntimeContext, ISystemsRuntimeMiddleware, SystemType };
|
package/dist/systems/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { S as ISystemContextEvents, _ as ISystemContext, a as ISystemsRuntime, b as ISystemContextRepository, c as ISystemMiddleware, g as IMutableSystemContext, i as ISystemsRuntimeContext, l as ISystemsModule, o as ISystemsModuleRepository, r as ISystemsRuntimeMiddleware, s as ISystemsModuleBuilder, u as SystemType, v as ISystemContextSnapshot, x as ISystemContextProxies, y as ISystemContextScheduler } from "../index-8XDo0pla.mjs";
|
|
2
|
+
export { IMutableSystemContext, ISystemContext, ISystemContextEvents, ISystemContextProxies, ISystemContextRepository, ISystemContextScheduler, ISystemContextSnapshot, ISystemMiddleware, ISystemsModule, ISystemsModuleBuilder, ISystemsModuleRepository, ISystemsRuntime, ISystemsRuntimeContext, ISystemsRuntimeMiddleware, SystemType };
|
package/dist/systems/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/systems/system-type.ts"],"sourcesContent":["/**\r\n * The four phases of entity system execution in each frame.\r\n * Each phase serves a specific purpose in the entity lifecycle and can be extended by custom system types.\r\n * The runtime handles each phase in order, allowing systems to perform stage-specific operations.\r\n */\r\nexport enum SystemType {\r\n /**\r\n * Initial setup and resource allocation for the entity.\r\n * Runs once when the entity is first created or initialized.\r\n */\r\n initialize = 0,\r\n\r\n /**\r\n * Main logic and state updates for the entity.\r\n * Runs on every update to change entity behavior and properties.\r\n */\r\n update = 1,\r\n\r\n /**\r\n * Output and visualization operations.\r\n * Runs after updates to render or display the entity state.\r\n */\r\n render = 2,\r\n\r\n /**\r\n * Synchronization and persistence.\r\n * Runs last to synchronize state with external systems or storage.\r\n */\r\n sync = 3\r\n}\r\n"],"mappings":";;;;;;AAKA,IAAY,
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/systems/system-type.ts"],"sourcesContent":["/**\r\n * The four phases of entity system execution in each frame.\r\n * Each phase serves a specific purpose in the entity lifecycle and can be extended by custom system types.\r\n * The runtime handles each phase in order, allowing systems to perform stage-specific operations.\r\n */\r\nexport enum SystemType {\r\n /**\r\n * Initial setup and resource allocation for the entity.\r\n * Runs once when the entity is first created or initialized.\r\n */\r\n initialize = 0,\r\n\r\n /**\r\n * Main logic and state updates for the entity.\r\n * Runs on every update to change entity behavior and properties.\r\n */\r\n update = 1,\r\n\r\n /**\r\n * Output and visualization operations.\r\n * Runs after updates to render or display the entity state.\r\n */\r\n render = 2,\r\n\r\n /**\r\n * Synchronization and persistence.\r\n * Runs last to synchronize state with external systems or storage.\r\n */\r\n sync = 3\r\n}\r\n"],"mappings":";;;;;;AAKA,IAAY,aAAL,yBAAA,YAAA;;;;;AAKL,YAAA,WAAA,gBAAA,KAAA;;;;;AAMA,YAAA,WAAA,YAAA,KAAA;;;;;AAMA,YAAA,WAAA,YAAA,KAAA;;;;;AAMA,YAAA,WAAA,UAAA,KAAA;;KACD"}
|
package/dist/utils/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
//#region src/utils/dispatch-sequential.ts
|
|
3
3
|
/**
|
|
4
4
|
* Executes a function for each item in an iterable, sequentially.
|
|
@@ -25,7 +25,6 @@ async function continueAsync(iterator, fn, pending) {
|
|
|
25
25
|
if (result instanceof Promise) await result;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
|
|
29
28
|
//#endregion
|
|
30
29
|
//#region src/utils/logger.ts
|
|
31
30
|
/**
|
|
@@ -50,8 +49,8 @@ let LogLevel = /* @__PURE__ */ function(LogLevel) {
|
|
|
50
49
|
LogLevel[LogLevel["error"] = 3] = "error";
|
|
51
50
|
return LogLevel;
|
|
52
51
|
}({});
|
|
53
|
-
|
|
54
52
|
//#endregion
|
|
55
53
|
exports.LogLevel = LogLevel;
|
|
56
54
|
exports.dispatchSequential = dispatchSequential;
|
|
55
|
+
|
|
57
56
|
//# sourceMappingURL=index.cjs.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":["/**\r\n * Executes a function for each item in an iterable, sequentially.\r\n *\r\n * Uses a sync fast-path: iterates synchronously until the first Promise is\r\n * encountered, then switches to async for the remainder. If no item produces\r\n * a Promise, the entire call stays synchronous with zero async overhead.\r\n *\r\n * @param items - The iterable to iterate over.\r\n * @param fn - The function to call for each item. May return void or a Promise.\r\n * @returns void if all calls were synchronous, or a Promise if any were async.\r\n */\r\nexport function dispatchSequential<T>(\r\n items: Iterable<T>,\r\n fn: (item: T) => void | Promise<void>\r\n): void | Promise<void> {\r\n const iterator = items[Symbol.iterator]();\r\n\r\n for (let next = iterator.next(); !next.done; next = iterator.next()) {\r\n const result = fn(next.value);\r\n\r\n if (result instanceof Promise) {\r\n return continueAsync(iterator, fn, result);\r\n }\r\n }\r\n}\r\n\r\nasync function continueAsync<T>(\r\n iterator: Iterator<T>,\r\n fn: (item: T) => void | Promise<void>,\r\n pending: Promise<void>\r\n): Promise<void> {\r\n await pending;\r\n\r\n for (let next = iterator.next(); !next.done; next = iterator.next()) {\r\n const result = fn(next.value);\r\n\r\n if (result instanceof Promise) {\r\n await result;\r\n }\r\n }\r\n}\r\n","/**\r\n * Logger interface for debug and diagnostic output.\r\n * Supports multiple log levels for controlling verbosity.\r\n * Implementations can target different outputs (console, file, remote, etc.).\r\n */\r\nexport interface ILogger {\r\n /**\r\n * Logs a message with a specified severity level.\r\n * @param level - The severity level of the message.\r\n * @param message - The primary message content.\r\n * @param args - Additional arguments to include in the log output.\r\n */\r\n log(level: LogLevel, message: any, ...args: any[]): void;\r\n\r\n /**\r\n * Logs detailed diagnostic information.\r\n * Typically the lowest level, most verbose output.\r\n * @param message - The message to log.\r\n * @param args - Additional data.\r\n */\r\n trace(message: any, ...args: any[]): void;\r\n\r\n /**\r\n * Logs debug-level information.\r\n * Useful during development and troubleshooting.\r\n * @param message - The message to log.\r\n * @param args - Additional data.\r\n */\r\n debug(message: any, ...args: any[]): void;\r\n\r\n /**\r\n * Logs warning-level messages.\r\n * Indicates potentially problematic conditions.\r\n * @param message - The message to log.\r\n * @param args - Additional data.\r\n */\r\n warn(message: any, ...args: any[]): void;\r\n\r\n /**\r\n * Logs error-level messages.\r\n * Indicates error conditions that may require attention.\r\n * @param message - The message to log.\r\n * @param args - Additional data.\r\n */\r\n error(message: any, ...args: any[]): void;\r\n}\r\n\r\n/**\r\n * Logging severity levels in increasing order.\r\n */\r\nexport enum LogLevel {\r\n /**\r\n * Most detailed, diagnostic-level logging.\r\n */\r\n trace,\r\n\r\n /**\r\n * Development and debugging information.\r\n */\r\n debug,\r\n\r\n /**\r\n * Warning-level conditions.\r\n */\r\n warn,\r\n\r\n /**\r\n * Error-level conditions.\r\n */\r\n error\r\n}\r\n\r\n/**\r\n * Configuration options for logger instances.\r\n */\r\nexport interface ILoggerOptions {\r\n /**\r\n * Enables/disables each log level.\r\n * If a level is disabled, log calls at that level are ignored.\r\n */\r\n enabled: Map<LogLevel, boolean>;\r\n}\r\n"],"mappings":";;;;;;;;;;;;;AAWA,SAAgB,mBACd,OACA,IACsB;CACtB,MAAM,WAAW,MAAM,OAAO,WAAW;AAEzC,MAAK,IAAI,OAAO,SAAS,MAAM,EAAE,CAAC,KAAK,MAAM,OAAO,SAAS,MAAM,EAAE;EACnE,MAAM,SAAS,GAAG,KAAK,MAAM;AAE7B,MAAI,kBAAkB,QACpB,QAAO,cAAc,UAAU,IAAI,OAAO;;;AAKhD,eAAe,cACb,UACA,IACA,SACe;AACf,OAAM;AAEN,MAAK,IAAI,OAAO,SAAS,MAAM,EAAE,CAAC,KAAK,MAAM,OAAO,SAAS,MAAM,EAAE;EACnE,MAAM,SAAS,GAAG,KAAK,MAAM;AAE7B,MAAI,kBAAkB,QACpB,OAAM
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/utils/dispatch-sequential.ts","../../src/utils/logger.ts"],"sourcesContent":["/**\r\n * Executes a function for each item in an iterable, sequentially.\r\n *\r\n * Uses a sync fast-path: iterates synchronously until the first Promise is\r\n * encountered, then switches to async for the remainder. If no item produces\r\n * a Promise, the entire call stays synchronous with zero async overhead.\r\n *\r\n * @param items - The iterable to iterate over.\r\n * @param fn - The function to call for each item. May return void or a Promise.\r\n * @returns void if all calls were synchronous, or a Promise if any were async.\r\n */\r\nexport function dispatchSequential<T>(\r\n items: Iterable<T>,\r\n fn: (item: T) => void | Promise<void>\r\n): void | Promise<void> {\r\n const iterator = items[Symbol.iterator]();\r\n\r\n for (let next = iterator.next(); !next.done; next = iterator.next()) {\r\n const result = fn(next.value);\r\n\r\n if (result instanceof Promise) {\r\n return continueAsync(iterator, fn, result);\r\n }\r\n }\r\n}\r\n\r\nasync function continueAsync<T>(\r\n iterator: Iterator<T>,\r\n fn: (item: T) => void | Promise<void>,\r\n pending: Promise<void>\r\n): Promise<void> {\r\n await pending;\r\n\r\n for (let next = iterator.next(); !next.done; next = iterator.next()) {\r\n const result = fn(next.value);\r\n\r\n if (result instanceof Promise) {\r\n await result;\r\n }\r\n }\r\n}\r\n","/**\r\n * Logger interface for debug and diagnostic output.\r\n * Supports multiple log levels for controlling verbosity.\r\n * Implementations can target different outputs (console, file, remote, etc.).\r\n */\r\nexport interface ILogger {\r\n /**\r\n * Logs a message with a specified severity level.\r\n * @param level - The severity level of the message.\r\n * @param message - The primary message content.\r\n * @param args - Additional arguments to include in the log output.\r\n */\r\n log(level: LogLevel, message: any, ...args: any[]): void;\r\n\r\n /**\r\n * Logs detailed diagnostic information.\r\n * Typically the lowest level, most verbose output.\r\n * @param message - The message to log.\r\n * @param args - Additional data.\r\n */\r\n trace(message: any, ...args: any[]): void;\r\n\r\n /**\r\n * Logs debug-level information.\r\n * Useful during development and troubleshooting.\r\n * @param message - The message to log.\r\n * @param args - Additional data.\r\n */\r\n debug(message: any, ...args: any[]): void;\r\n\r\n /**\r\n * Logs warning-level messages.\r\n * Indicates potentially problematic conditions.\r\n * @param message - The message to log.\r\n * @param args - Additional data.\r\n */\r\n warn(message: any, ...args: any[]): void;\r\n\r\n /**\r\n * Logs error-level messages.\r\n * Indicates error conditions that may require attention.\r\n * @param message - The message to log.\r\n * @param args - Additional data.\r\n */\r\n error(message: any, ...args: any[]): void;\r\n}\r\n\r\n/**\r\n * Logging severity levels in increasing order.\r\n */\r\nexport enum LogLevel {\r\n /**\r\n * Most detailed, diagnostic-level logging.\r\n */\r\n trace,\r\n\r\n /**\r\n * Development and debugging information.\r\n */\r\n debug,\r\n\r\n /**\r\n * Warning-level conditions.\r\n */\r\n warn,\r\n\r\n /**\r\n * Error-level conditions.\r\n */\r\n error\r\n}\r\n\r\n/**\r\n * Configuration options for logger instances.\r\n */\r\nexport interface ILoggerOptions {\r\n /**\r\n * Enables/disables each log level.\r\n * If a level is disabled, log calls at that level are ignored.\r\n */\r\n enabled: Map<LogLevel, boolean>;\r\n}\r\n"],"mappings":";;;;;;;;;;;;;AAWA,SAAgB,mBACd,OACA,IACsB;CACtB,MAAM,WAAW,MAAM,OAAO,WAAW;AAEzC,MAAK,IAAI,OAAO,SAAS,MAAM,EAAE,CAAC,KAAK,MAAM,OAAO,SAAS,MAAM,EAAE;EACnE,MAAM,SAAS,GAAG,KAAK,MAAM;AAE7B,MAAI,kBAAkB,QACpB,QAAO,cAAc,UAAU,IAAI,OAAO;;;AAKhD,eAAe,cACb,UACA,IACA,SACe;AACf,OAAM;AAEN,MAAK,IAAI,OAAO,SAAS,MAAM,EAAE,CAAC,KAAK,MAAM,OAAO,SAAS,MAAM,EAAE;EACnE,MAAM,SAAS,GAAG,KAAK,MAAM;AAE7B,MAAI,kBAAkB,QACpB,OAAM;;;;;;;;ACaZ,IAAY,WAAL,yBAAA,UAAA;;;;AAIL,UAAA,SAAA,WAAA,KAAA;;;;AAKA,UAAA,SAAA,WAAA,KAAA;;;;AAKA,UAAA,SAAA,UAAA,KAAA;;;;AAKA,UAAA,SAAA,WAAA,KAAA;;KACD"}
|
package/dist/utils/index.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import {
|
|
3
|
-
export { BooleanProps, IJsonSerializer, ILogger, ILoggerOptions, IPerformanceTimer, Immutable, ImmutableArray, ImmutableMap, ImmutableObject, ImmutableObjectDeep, ImmutableSet, LogLevel, Mutable, MutableDeep, PerformanceMetricOptions, PerformanceTimeEntry, PerformanceTimerUid, dispatchSequential };
|
|
1
|
+
import { a as ImmutableArray, c as ImmutableObjectDeep, d as MutableDeep, i as Immutable, l as ImmutableSet, o as ImmutableMap, r as BooleanProps, s as ImmutableObject, u as Mutable } from "../identity-component-DLDaOTyK.cjs";
|
|
2
|
+
import { B as TickSnapshot, F as PerformanceTimeEntry, G as dispatchSequential, H as ILoggerOptions, I as PerformanceTimerUid, L as MiddlewareMetricsSummary, N as IPerformanceTimer, P as PerformanceMetricOptions, R as RenderSnapshot, U as LogLevel, V as ILogger, W as IJsonSerializer, z as TickMetricEntry } from "../index-BVkmidEx.cjs";
|
|
3
|
+
export { BooleanProps, 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
|
|
2
|
-
import {
|
|
3
|
-
export { BooleanProps, IJsonSerializer, ILogger, ILoggerOptions, IPerformanceTimer, Immutable, ImmutableArray, ImmutableMap, ImmutableObject, ImmutableObjectDeep, ImmutableSet, LogLevel, Mutable, MutableDeep, PerformanceMetricOptions, PerformanceTimeEntry, PerformanceTimerUid, dispatchSequential };
|
|
1
|
+
import { a as ImmutableArray, c as ImmutableObjectDeep, d as MutableDeep, i as Immutable, l as ImmutableSet, o as ImmutableMap, r as BooleanProps, s as ImmutableObject, u as Mutable } from "../identity-component-CuWHf7jX.mjs";
|
|
2
|
+
import { B as TickSnapshot, F as PerformanceTimeEntry, G as dispatchSequential, H as ILoggerOptions, I as PerformanceTimerUid, L as MiddlewareMetricsSummary, N as IPerformanceTimer, P as PerformanceMetricOptions, R as RenderSnapshot, U as LogLevel, V as ILogger, W as IJsonSerializer, z as TickMetricEntry } from "../index-8XDo0pla.mjs";
|
|
3
|
+
export { BooleanProps, 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
CHANGED
|
@@ -24,7 +24,6 @@ async function continueAsync(iterator, fn, pending) {
|
|
|
24
24
|
if (result instanceof Promise) await result;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
|
|
28
27
|
//#endregion
|
|
29
28
|
//#region src/utils/logger.ts
|
|
30
29
|
/**
|
|
@@ -49,7 +48,7 @@ let LogLevel = /* @__PURE__ */ function(LogLevel) {
|
|
|
49
48
|
LogLevel[LogLevel["error"] = 3] = "error";
|
|
50
49
|
return LogLevel;
|
|
51
50
|
}({});
|
|
52
|
-
|
|
53
51
|
//#endregion
|
|
54
52
|
export { LogLevel, dispatchSequential };
|
|
53
|
+
|
|
55
54
|
//# sourceMappingURL=index.mjs.map
|
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":["/**\r\n * Executes a function for each item in an iterable, sequentially.\r\n *\r\n * Uses a sync fast-path: iterates synchronously until the first Promise is\r\n * encountered, then switches to async for the remainder. If no item produces\r\n * a Promise, the entire call stays synchronous with zero async overhead.\r\n *\r\n * @param items - The iterable to iterate over.\r\n * @param fn - The function to call for each item. May return void or a Promise.\r\n * @returns void if all calls were synchronous, or a Promise if any were async.\r\n */\r\nexport function dispatchSequential<T>(\r\n items: Iterable<T>,\r\n fn: (item: T) => void | Promise<void>\r\n): void | Promise<void> {\r\n const iterator = items[Symbol.iterator]();\r\n\r\n for (let next = iterator.next(); !next.done; next = iterator.next()) {\r\n const result = fn(next.value);\r\n\r\n if (result instanceof Promise) {\r\n return continueAsync(iterator, fn, result);\r\n }\r\n }\r\n}\r\n\r\nasync function continueAsync<T>(\r\n iterator: Iterator<T>,\r\n fn: (item: T) => void | Promise<void>,\r\n pending: Promise<void>\r\n): Promise<void> {\r\n await pending;\r\n\r\n for (let next = iterator.next(); !next.done; next = iterator.next()) {\r\n const result = fn(next.value);\r\n\r\n if (result instanceof Promise) {\r\n await result;\r\n }\r\n }\r\n}\r\n","/**\r\n * Logger interface for debug and diagnostic output.\r\n * Supports multiple log levels for controlling verbosity.\r\n * Implementations can target different outputs (console, file, remote, etc.).\r\n */\r\nexport interface ILogger {\r\n /**\r\n * Logs a message with a specified severity level.\r\n * @param level - The severity level of the message.\r\n * @param message - The primary message content.\r\n * @param args - Additional arguments to include in the log output.\r\n */\r\n log(level: LogLevel, message: any, ...args: any[]): void;\r\n\r\n /**\r\n * Logs detailed diagnostic information.\r\n * Typically the lowest level, most verbose output.\r\n * @param message - The message to log.\r\n * @param args - Additional data.\r\n */\r\n trace(message: any, ...args: any[]): void;\r\n\r\n /**\r\n * Logs debug-level information.\r\n * Useful during development and troubleshooting.\r\n * @param message - The message to log.\r\n * @param args - Additional data.\r\n */\r\n debug(message: any, ...args: any[]): void;\r\n\r\n /**\r\n * Logs warning-level messages.\r\n * Indicates potentially problematic conditions.\r\n * @param message - The message to log.\r\n * @param args - Additional data.\r\n */\r\n warn(message: any, ...args: any[]): void;\r\n\r\n /**\r\n * Logs error-level messages.\r\n * Indicates error conditions that may require attention.\r\n * @param message - The message to log.\r\n * @param args - Additional data.\r\n */\r\n error(message: any, ...args: any[]): void;\r\n}\r\n\r\n/**\r\n * Logging severity levels in increasing order.\r\n */\r\nexport enum LogLevel {\r\n /**\r\n * Most detailed, diagnostic-level logging.\r\n */\r\n trace,\r\n\r\n /**\r\n * Development and debugging information.\r\n */\r\n debug,\r\n\r\n /**\r\n * Warning-level conditions.\r\n */\r\n warn,\r\n\r\n /**\r\n * Error-level conditions.\r\n */\r\n error\r\n}\r\n\r\n/**\r\n * Configuration options for logger instances.\r\n */\r\nexport interface ILoggerOptions {\r\n /**\r\n * Enables/disables each log level.\r\n * If a level is disabled, log calls at that level are ignored.\r\n */\r\n enabled: Map<LogLevel, boolean>;\r\n}\r\n"],"mappings":";;;;;;;;;;;;AAWA,SAAgB,mBACd,OACA,IACsB;CACtB,MAAM,WAAW,MAAM,OAAO,WAAW;AAEzC,MAAK,IAAI,OAAO,SAAS,MAAM,EAAE,CAAC,KAAK,MAAM,OAAO,SAAS,MAAM,EAAE;EACnE,MAAM,SAAS,GAAG,KAAK,MAAM;AAE7B,MAAI,kBAAkB,QACpB,QAAO,cAAc,UAAU,IAAI,OAAO;;;AAKhD,eAAe,cACb,UACA,IACA,SACe;AACf,OAAM;AAEN,MAAK,IAAI,OAAO,SAAS,MAAM,EAAE,CAAC,KAAK,MAAM,OAAO,SAAS,MAAM,EAAE;EACnE,MAAM,SAAS,GAAG,KAAK,MAAM;AAE7B,MAAI,kBAAkB,QACpB,OAAM
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/utils/dispatch-sequential.ts","../../src/utils/logger.ts"],"sourcesContent":["/**\r\n * Executes a function for each item in an iterable, sequentially.\r\n *\r\n * Uses a sync fast-path: iterates synchronously until the first Promise is\r\n * encountered, then switches to async for the remainder. If no item produces\r\n * a Promise, the entire call stays synchronous with zero async overhead.\r\n *\r\n * @param items - The iterable to iterate over.\r\n * @param fn - The function to call for each item. May return void or a Promise.\r\n * @returns void if all calls were synchronous, or a Promise if any were async.\r\n */\r\nexport function dispatchSequential<T>(\r\n items: Iterable<T>,\r\n fn: (item: T) => void | Promise<void>\r\n): void | Promise<void> {\r\n const iterator = items[Symbol.iterator]();\r\n\r\n for (let next = iterator.next(); !next.done; next = iterator.next()) {\r\n const result = fn(next.value);\r\n\r\n if (result instanceof Promise) {\r\n return continueAsync(iterator, fn, result);\r\n }\r\n }\r\n}\r\n\r\nasync function continueAsync<T>(\r\n iterator: Iterator<T>,\r\n fn: (item: T) => void | Promise<void>,\r\n pending: Promise<void>\r\n): Promise<void> {\r\n await pending;\r\n\r\n for (let next = iterator.next(); !next.done; next = iterator.next()) {\r\n const result = fn(next.value);\r\n\r\n if (result instanceof Promise) {\r\n await result;\r\n }\r\n }\r\n}\r\n","/**\r\n * Logger interface for debug and diagnostic output.\r\n * Supports multiple log levels for controlling verbosity.\r\n * Implementations can target different outputs (console, file, remote, etc.).\r\n */\r\nexport interface ILogger {\r\n /**\r\n * Logs a message with a specified severity level.\r\n * @param level - The severity level of the message.\r\n * @param message - The primary message content.\r\n * @param args - Additional arguments to include in the log output.\r\n */\r\n log(level: LogLevel, message: any, ...args: any[]): void;\r\n\r\n /**\r\n * Logs detailed diagnostic information.\r\n * Typically the lowest level, most verbose output.\r\n * @param message - The message to log.\r\n * @param args - Additional data.\r\n */\r\n trace(message: any, ...args: any[]): void;\r\n\r\n /**\r\n * Logs debug-level information.\r\n * Useful during development and troubleshooting.\r\n * @param message - The message to log.\r\n * @param args - Additional data.\r\n */\r\n debug(message: any, ...args: any[]): void;\r\n\r\n /**\r\n * Logs warning-level messages.\r\n * Indicates potentially problematic conditions.\r\n * @param message - The message to log.\r\n * @param args - Additional data.\r\n */\r\n warn(message: any, ...args: any[]): void;\r\n\r\n /**\r\n * Logs error-level messages.\r\n * Indicates error conditions that may require attention.\r\n * @param message - The message to log.\r\n * @param args - Additional data.\r\n */\r\n error(message: any, ...args: any[]): void;\r\n}\r\n\r\n/**\r\n * Logging severity levels in increasing order.\r\n */\r\nexport enum LogLevel {\r\n /**\r\n * Most detailed, diagnostic-level logging.\r\n */\r\n trace,\r\n\r\n /**\r\n * Development and debugging information.\r\n */\r\n debug,\r\n\r\n /**\r\n * Warning-level conditions.\r\n */\r\n warn,\r\n\r\n /**\r\n * Error-level conditions.\r\n */\r\n error\r\n}\r\n\r\n/**\r\n * Configuration options for logger instances.\r\n */\r\nexport interface ILoggerOptions {\r\n /**\r\n * Enables/disables each log level.\r\n * If a level is disabled, log calls at that level are ignored.\r\n */\r\n enabled: Map<LogLevel, boolean>;\r\n}\r\n"],"mappings":";;;;;;;;;;;;AAWA,SAAgB,mBACd,OACA,IACsB;CACtB,MAAM,WAAW,MAAM,OAAO,WAAW;AAEzC,MAAK,IAAI,OAAO,SAAS,MAAM,EAAE,CAAC,KAAK,MAAM,OAAO,SAAS,MAAM,EAAE;EACnE,MAAM,SAAS,GAAG,KAAK,MAAM;AAE7B,MAAI,kBAAkB,QACpB,QAAO,cAAc,UAAU,IAAI,OAAO;;;AAKhD,eAAe,cACb,UACA,IACA,SACe;AACf,OAAM;AAEN,MAAK,IAAI,OAAO,SAAS,MAAM,EAAE,CAAC,KAAK,MAAM,OAAO,SAAS,MAAM,EAAE;EACnE,MAAM,SAAS,GAAG,KAAK,MAAM;AAE7B,MAAI,kBAAkB,QACpB,OAAM;;;;;;;;ACaZ,IAAY,WAAL,yBAAA,UAAA;;;;AAIL,UAAA,SAAA,WAAA,KAAA;;;;AAKA,UAAA,SAAA,WAAA,KAAA;;;;AAKA,UAAA,SAAA,UAAA,KAAA;;;;AAKA,UAAA,SAAA,WAAA,KAAA;;KACD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awesome-ecs/abstract",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.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": "e4f5e0176478cb0e32364b0df375c537acbdcb66"
|
|
101
101
|
}
|
|
@@ -1,224 +0,0 @@
|
|
|
1
|
-
import { n as Immutable } from "./types-DLOd2zXO.cjs";
|
|
2
|
-
import { r as PerformanceTimeEntry } from "./index-Cs9Eerjt.cjs";
|
|
3
|
-
|
|
4
|
-
//#region src/pipelines/pipeline-context.d.ts
|
|
5
|
-
/**
|
|
6
|
-
* Base interface for all pipeline context objects.
|
|
7
|
-
* Provides hooks for runtime state and control flow during pipeline execution.
|
|
8
|
-
*/
|
|
9
|
-
interface IPipelineContext {
|
|
10
|
-
/**
|
|
11
|
-
* The runtime state and control interface for the pipeline.
|
|
12
|
-
* Allows middleware to query and influence pipeline behavior.
|
|
13
|
-
*/
|
|
14
|
-
readonly runtime?: PipelineRuntime;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Runtime state and control interface for pipeline execution.
|
|
18
|
-
* Allows middleware to query status and influence pipeline flow.
|
|
19
|
-
*/
|
|
20
|
-
type PipelineRuntime = {
|
|
21
|
-
/**
|
|
22
|
-
* Flag to request pipeline halt.
|
|
23
|
-
* Set to true to stop executing remaining middleware (cleanup still runs).
|
|
24
|
-
*/
|
|
25
|
-
shouldStop?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Optional error state if an exception occurred during execution.
|
|
28
|
-
*/
|
|
29
|
-
error?: any;
|
|
30
|
-
/**
|
|
31
|
-
* Results collected from middleware execution.
|
|
32
|
-
* Typically includes performance metrics and operational results.
|
|
33
|
-
*/
|
|
34
|
-
readonly metrics?: PerformanceTimeEntry[];
|
|
35
|
-
};
|
|
36
|
-
//#endregion
|
|
37
|
-
//#region src/pipelines/middleware.d.ts
|
|
38
|
-
/**
|
|
39
|
-
* The basic unit of work in a pipeline.
|
|
40
|
-
* Middleware are chained together to form processing pipelines.
|
|
41
|
-
* Each middleware can inspect/modify context during dispatch and perform cleanup on their changes.
|
|
42
|
-
*
|
|
43
|
-
* @template TContext The context type passed through the middleware chain.
|
|
44
|
-
*/
|
|
45
|
-
interface IMiddleware<TContext extends IPipelineContext> {
|
|
46
|
-
/**
|
|
47
|
-
* Optional name for debugging and logging purposes.
|
|
48
|
-
*/
|
|
49
|
-
readonly name?: string;
|
|
50
|
-
/**
|
|
51
|
-
* Optional guard condition before running the action.
|
|
52
|
-
* Allows middleware to skip execution based on context state.
|
|
53
|
-
* @param context The current pipeline context.
|
|
54
|
-
* @returns True to execute action, false to skip.
|
|
55
|
-
*/
|
|
56
|
-
shouldRun?(context: TContext): boolean;
|
|
57
|
-
/**
|
|
58
|
-
* The main unit of work executed as part of the pipeline.
|
|
59
|
-
* Middlewares execute in registration order during dispatch phase.
|
|
60
|
-
* Can read and modify the context to influence downstream middleware and results.
|
|
61
|
-
* @param context The pipeline context containing all relevant state.
|
|
62
|
-
*/
|
|
63
|
-
action(context: TContext): void | Promise<void>;
|
|
64
|
-
/**
|
|
65
|
-
* Optional cleanup function executed during pipeline teardown.
|
|
66
|
-
* Middlewares execute in reverse registration order during cleanup phase.
|
|
67
|
-
* Used to release resources, clear temporary state, and perform final operations.
|
|
68
|
-
* @param context The pipeline context (may be in modified state from action phases).
|
|
69
|
-
*/
|
|
70
|
-
cleanup?(context: TContext): void | Promise<void>;
|
|
71
|
-
}
|
|
72
|
-
//#endregion
|
|
73
|
-
//#region src/pipelines/middleware-runner.d.ts
|
|
74
|
-
/**
|
|
75
|
-
* Customizes how middleware is executed within a pipeline.
|
|
76
|
-
* Allows decorators to wrap, intercept, or modify middleware execution behavior.
|
|
77
|
-
* Useful for implementing middleware decorators (logging, timing, error handling, etc.).
|
|
78
|
-
*
|
|
79
|
-
* @template TContext The type of context passed to middleware.
|
|
80
|
-
*/
|
|
81
|
-
interface IMiddlewareRunner<TContext extends IPipelineContext> {
|
|
82
|
-
/**
|
|
83
|
-
* Decides how to execute a middleware's action.
|
|
84
|
-
* Can add pre/post processing, error handling, or performance tracking around the middleware.
|
|
85
|
-
* @param context The current pipeline context.
|
|
86
|
-
* @param middleware The middleware whose action should be executed.
|
|
87
|
-
*/
|
|
88
|
-
dispatch(context: TContext, middleware: IMiddleware<TContext>): void | Promise<void>;
|
|
89
|
-
/**
|
|
90
|
-
* Decides how to execute a middleware's cleanup.
|
|
91
|
-
* Can add pre/post processing or error handling around cleanup operations.
|
|
92
|
-
* @param context The current pipeline context.
|
|
93
|
-
* @param middleware The middleware whose cleanup should be executed.
|
|
94
|
-
*/
|
|
95
|
-
cleanup(context: TContext, middleware: IMiddleware<TContext>): void | Promise<void>;
|
|
96
|
-
}
|
|
97
|
-
//#endregion
|
|
98
|
-
//#region src/pipelines/pipeline.d.ts
|
|
99
|
-
/**
|
|
100
|
-
* A composable middleware chain for ordered execution of operations.
|
|
101
|
-
* Pipelines provide a framework for registering and executing middleware with dispatch and cleanup phases.
|
|
102
|
-
* Used throughout the ECS system for entity initialization, updates, rendering, and synchronization.
|
|
103
|
-
*
|
|
104
|
-
* @template TContext - The context type passed to all registered middleware.
|
|
105
|
-
*/
|
|
106
|
-
interface IPipeline<TContext extends IPipelineContext> {
|
|
107
|
-
/**
|
|
108
|
-
* The pipeline's name, useful for debugging and logging.
|
|
109
|
-
*/
|
|
110
|
-
readonly name?: string;
|
|
111
|
-
/**
|
|
112
|
-
* The number of middleware currently registered in this pipeline.
|
|
113
|
-
*/
|
|
114
|
-
readonly length?: number;
|
|
115
|
-
/**
|
|
116
|
-
* Direct access to the ordered list of registered middleware.
|
|
117
|
-
* Allows inspection of the execution chain.
|
|
118
|
-
*/
|
|
119
|
-
readonly middleware?: Immutable<IMiddleware<TContext>[]>;
|
|
120
|
-
/**
|
|
121
|
-
* Registers middleware to be executed as part of this pipeline.
|
|
122
|
-
* Middleware is added to the end of the chain and executed in registration order during dispatch.
|
|
123
|
-
* @param middleware - The middleware to register.
|
|
124
|
-
* @returns This instance for method chaining.
|
|
125
|
-
*/
|
|
126
|
-
use(middleware: Immutable<IMiddleware<TContext>>): this;
|
|
127
|
-
/**
|
|
128
|
-
* Executes the dispatch phase with all registered middleware in order.
|
|
129
|
-
* Each middleware's action is called, allowing modifications to context state.
|
|
130
|
-
* Execution continues until all middleware complete or a middleware requests early termination.
|
|
131
|
-
* @param context - The context object passed to all middleware.
|
|
132
|
-
*/
|
|
133
|
-
dispatch(context: Partial<TContext>): void | Promise<void>;
|
|
134
|
-
/**
|
|
135
|
-
* Executes the cleanup phase with all registered middleware in reverse order.
|
|
136
|
-
* Allows middleware to perform resource cleanup and final operations.
|
|
137
|
-
* Typically called after dispatch to ensure proper teardown.
|
|
138
|
-
*
|
|
139
|
-
* @param context - The context object that will be passed to each middleware function.
|
|
140
|
-
*/
|
|
141
|
-
cleanup(context: Partial<TContext>): void | Promise<void>;
|
|
142
|
-
}
|
|
143
|
-
//#endregion
|
|
144
|
-
//#region src/pipelines/pipeline-nested.d.ts
|
|
145
|
-
/**
|
|
146
|
-
* Context for a parent pipeline containing nested pipelines.
|
|
147
|
-
* Allows coordination between outer and inner pipeline execution.
|
|
148
|
-
*
|
|
149
|
-
* @template N - The context type for the nested pipelines.
|
|
150
|
-
*/
|
|
151
|
-
interface IParentContext<N extends IPipelineContext> extends IPipelineContext {
|
|
152
|
-
/**
|
|
153
|
-
* The nested pipeline to execute for each context in nestedContexts.
|
|
154
|
-
*/
|
|
155
|
-
readonly nestedPipeline: IPipeline<INestedContext<this>>;
|
|
156
|
-
/**
|
|
157
|
-
* Contexts to pass to the nested pipeline.
|
|
158
|
-
* The parent pipeline iterates these and executes the nested pipeline for each.
|
|
159
|
-
*/
|
|
160
|
-
readonly nestedContexts: Partial<N>[];
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Context for a nested pipeline.
|
|
164
|
-
* Provides access to both current and previous nested context data plus the parent context.
|
|
165
|
-
*
|
|
166
|
-
* @template P - The context type of the parent pipeline.
|
|
167
|
-
*/
|
|
168
|
-
interface INestedContext<P extends IParentContext<any>> extends IPipelineContext {
|
|
169
|
-
/**
|
|
170
|
-
* The current context item being processed in the nested pipeline.
|
|
171
|
-
*/
|
|
172
|
-
readonly current: P extends IParentContext<infer N> ? N : never;
|
|
173
|
-
/**
|
|
174
|
-
* The previous context item (if this is not the first iteration).
|
|
175
|
-
*/
|
|
176
|
-
readonly previous?: P extends IParentContext<infer N> ? N : never;
|
|
177
|
-
/**
|
|
178
|
-
* Reference back to the parent pipeline context.
|
|
179
|
-
*/
|
|
180
|
-
readonly parent: P;
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* Middleware executing within a nested pipeline.
|
|
184
|
-
*
|
|
185
|
-
* @template P - The context type of the parent pipeline.
|
|
186
|
-
*/
|
|
187
|
-
type INestedMiddleware<P extends IParentContext<any>> = IMiddleware<INestedContext<P>>;
|
|
188
|
-
/**
|
|
189
|
-
* Middleware executing within a parent pipeline (containing nested pipelines).
|
|
190
|
-
*
|
|
191
|
-
* @template P - The context type of the parent pipeline.
|
|
192
|
-
*/
|
|
193
|
-
type IParentMiddleware<P extends IParentContext<any>> = IMiddleware<P>;
|
|
194
|
-
//#endregion
|
|
195
|
-
//#region src/pipelines/pipeline-runner.d.ts
|
|
196
|
-
/**
|
|
197
|
-
* Executes an array of middleware in a controlled sequence.
|
|
198
|
-
* Supports custom execution strategies through implementation flexibility.
|
|
199
|
-
* Used by pipelines to manage complex middleware chains with features like early termination and nested pipelines.
|
|
200
|
-
*
|
|
201
|
-
* @template TContext - The context type passed to all middleware.
|
|
202
|
-
*/
|
|
203
|
-
interface IPipelineRunner<TContext extends IPipelineContext> {
|
|
204
|
-
/**
|
|
205
|
-
* Executes the action phase of all middleware in sequence.
|
|
206
|
-
* Middleware at startIndex and onward are executed in order.
|
|
207
|
-
* Execution may terminate early if middleware requests it via context.runtime.shouldStop.
|
|
208
|
-
* @param context - The context passed to each middleware action.
|
|
209
|
-
* @param middleware - The ordered middleware array to execute.
|
|
210
|
-
* @param startIndex - Optional starting position in the middleware array (default: 0).
|
|
211
|
-
*/
|
|
212
|
-
dispatch(context: Partial<TContext>, middleware: IMiddleware<TContext>[], startIndex?: number): void | Promise<void>;
|
|
213
|
-
/**
|
|
214
|
-
* Executes the cleanup phase of all middleware in reverse order.
|
|
215
|
-
* All middleware cleanup functions are called (if defined), regardless of errors.
|
|
216
|
-
* Allows proper resource release and final state management.
|
|
217
|
-
* @param context - The context passed to each middleware cleanup.
|
|
218
|
-
* @param middleware - The ordered middleware array for cleanup (reversed during execution).
|
|
219
|
-
*/
|
|
220
|
-
cleanup(context: Partial<TContext>, middleware: IMiddleware<TContext>[]): void | Promise<void>;
|
|
221
|
-
}
|
|
222
|
-
//#endregion
|
|
223
|
-
export { IParentMiddleware as a, IMiddleware as c, IParentContext as i, IPipelineContext as l, INestedContext as n, IPipeline as o, INestedMiddleware as r, IMiddlewareRunner as s, IPipelineRunner as t, PipelineRuntime as u };
|
|
224
|
-
//# sourceMappingURL=index-BQojRXVz.d.cts.map
|