@awesome-ecs/abstract 0.29.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.
@@ -1,5 +1,58 @@
1
- import { a as IEntity, c as IEntityProxy, n as IdentityComponent, o as IEntityModel, p as IComponent, r as EntityTypeUid } from "./identity-component-CsU-wYTX.cjs";
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-DTHsTJ1j.d.cts.map
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 { a as IEntity, c as IEntityProxy, n as IdentityComponent, o as IEntityModel, p as IComponent, r as EntityTypeUid } from "./identity-component-B3VGtdQW.mjs";
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-CBxqWVDf.d.mts.map
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 { 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-BRkKPsOV.cjs";
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 { 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-C8yZ7-zP.mjs";
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 };
@@ -1,2 +1,2 @@
1
- import { a as ISystemsModuleRepository, c as ISystemsModule, d as ISystemContextSnapshot, f as ISystemContextScheduler, h as ISystemContextEvents, i as ISystemContextEntity, l as SystemType, m as ISystemContextProxies, n as ISystemsRuntimeContext, o as ISystemsModuleBuilder, p as ISystemContextRepository, r as ISystemsRuntime, s as ISystemMiddleware, t as ISystemsRuntimeMiddleware, u as ISystemContext } from "../index-Df4VhCPr.cjs";
2
- export { ISystemContext, ISystemContextEntity, ISystemContextEvents, ISystemContextProxies, ISystemContextRepository, ISystemContextScheduler, ISystemContextSnapshot, ISystemMiddleware, ISystemsModule, ISystemsModuleBuilder, ISystemsModuleRepository, ISystemsRuntime, ISystemsRuntimeContext, ISystemsRuntimeMiddleware, SystemType };
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 };
@@ -1,2 +1,2 @@
1
- import { a as ISystemsModuleRepository, c as ISystemsModule, d as ISystemContextSnapshot, f as ISystemContextScheduler, h as ISystemContextEvents, i as ISystemContextEntity, l as SystemType, m as ISystemContextProxies, n as ISystemsRuntimeContext, o as ISystemsModuleBuilder, p as ISystemContextRepository, r as ISystemsRuntime, s as ISystemMiddleware, t as ISystemsRuntimeMiddleware, u as ISystemContext } from "../index-BC8RgFVd.mjs";
2
- export { ISystemContext, ISystemContextEntity, ISystemContextEvents, ISystemContextProxies, ISystemContextRepository, ISystemContextScheduler, ISystemContextSnapshot, ISystemMiddleware, ISystemsModule, ISystemsModuleBuilder, ISystemsModuleRepository, ISystemsRuntime, ISystemsRuntimeContext, ISystemsRuntimeMiddleware, SystemType };
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 };
@@ -1,3 +1,3 @@
1
- import { a as ImmutableObject, c as Mutable, i as ImmutableMap, l as MutableDeep, n as Immutable, o as ImmutableObjectDeep, r as ImmutableArray, s as ImmutableSet, t as BooleanProps } from "../types-DqWnkvhp.cjs";
2
- import { a as ILogger, c as IJsonSerializer, i as PerformanceTimerUid, l as dispatchSequential, n as PerformanceMetricOptions, o as ILoggerOptions, r as PerformanceTimeEntry, s as LogLevel, t as IPerformanceTimer } from "../index-DCx0PjvH.cjs";
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 };
@@ -1,3 +1,3 @@
1
- import { a as ImmutableObject, c as Mutable, i as ImmutableMap, l as MutableDeep, n as Immutable, o as ImmutableObjectDeep, r as ImmutableArray, s as ImmutableSet, t as BooleanProps } from "../types-aD9p7TDy.mjs";
2
- import { a as ILogger, c as IJsonSerializer, i as PerformanceTimerUid, l as dispatchSequential, n as PerformanceMetricOptions, o as ILoggerOptions, r as PerformanceTimeEntry, s as LogLevel, t as IPerformanceTimer } from "../index-EpAQRAeF.mjs";
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awesome-ecs/abstract",
3
- "version": "0.29.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": "37f8cf92c99229fac359cc6513e8a0abf002308b"
100
+ "gitHead": "e4f5e0176478cb0e32364b0df375c537acbdcb66"
101
101
  }