@awesome-ecs/abstract 0.27.0 → 0.28.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,3 +1,3 @@
1
1
  import { a as IEntity, c as IEntityProxy, d as TypedEntityProxy, i as EntityUid, l as IEntityProxyRepository, o as IEntityModel, r as EntityTypeUid, s as EntityProxy, u as RequiredProxies } from "../identity-component-uU0yDR-y.cjs";
2
- import { a as EntityUpdateType, c as IEntitySnapshot, d as EntityEventSubscriptionOptions, f as EntityEventUid, g as IEventData, h as IEntityEventsManager, i as IEntityRepository, l as IEntitySnapshotProvider, m as IEntityEventsDispatcher, n as IEntityScheduler, o as IEntityUpdate, p as IEntityEvent, r as SchedulerPauseType, s as IEntityUpdateQueue, t as EntitySchedule, u as EntityEventSubscriptionFilter } from "../index-s3-CSfQd.cjs";
2
+ import { a as EntityUpdateType, c as IEntitySnapshot, d as EntityEventSubscriptionOptions, f as EntityEventUid, g as IEventData, h as IEntityEventsManager, i as IEntityRepository, l as IEntitySnapshotProvider, m as IEntityEventsDispatcher, n as IEntityScheduler, o as IEntityUpdate, p as IEntityEvent, r as SchedulerPauseType, s as IEntityUpdateQueue, t as EntitySchedule, u as EntityEventSubscriptionFilter } from "../index-C1Ojam4M.cjs";
3
3
  export { EntityEventSubscriptionFilter, EntityEventSubscriptionOptions, EntityEventUid, EntityProxy, EntitySchedule, EntityTypeUid, EntityUid, EntityUpdateType, IEntity, IEntityEvent, IEntityEventsDispatcher, IEntityEventsManager, IEntityModel, IEntityProxy, IEntityProxyRepository, IEntityRepository, IEntityScheduler, IEntitySnapshot, IEntitySnapshotProvider, IEntityUpdate, IEntityUpdateQueue, IEventData, RequiredProxies, SchedulerPauseType, TypedEntityProxy };
@@ -1,3 +1,3 @@
1
1
  import { a as IEntity, c as IEntityProxy, d as TypedEntityProxy, i as EntityUid, l as IEntityProxyRepository, o as IEntityModel, r as EntityTypeUid, s as EntityProxy, u as RequiredProxies } from "../identity-component-CgzvgBVh.mjs";
2
- import { a as EntityUpdateType, c as IEntitySnapshot, d as EntityEventSubscriptionOptions, f as EntityEventUid, g as IEventData, h as IEntityEventsManager, i as IEntityRepository, l as IEntitySnapshotProvider, m as IEntityEventsDispatcher, n as IEntityScheduler, o as IEntityUpdate, p as IEntityEvent, r as SchedulerPauseType, s as IEntityUpdateQueue, t as EntitySchedule, u as EntityEventSubscriptionFilter } from "../index-xgRroB4J.mjs";
2
+ import { a as EntityUpdateType, c as IEntitySnapshot, d as EntityEventSubscriptionOptions, f as EntityEventUid, g as IEventData, h as IEntityEventsManager, i as IEntityRepository, l as IEntitySnapshotProvider, m as IEntityEventsDispatcher, n as IEntityScheduler, o as IEntityUpdate, p as IEntityEvent, r as SchedulerPauseType, s as IEntityUpdateQueue, t as EntitySchedule, u as EntityEventSubscriptionFilter } from "../index-C0v9GTM7.mjs";
3
3
  export { EntityEventSubscriptionFilter, EntityEventSubscriptionOptions, EntityEventUid, EntityProxy, EntitySchedule, EntityTypeUid, EntityUid, EntityUpdateType, IEntity, IEntityEvent, IEntityEventsDispatcher, IEntityEventsManager, IEntityModel, IEntityProxy, IEntityProxyRepository, IEntityRepository, IEntityScheduler, IEntitySnapshot, IEntitySnapshotProvider, IEntityUpdate, IEntityUpdateQueue, IEventData, RequiredProxies, SchedulerPauseType, TypedEntityProxy };
@@ -1,6 +1,6 @@
1
1
  import { a as IEntity } from "../identity-component-uU0yDR-y.cjs";
2
2
  import { l as IPipelineContext, o as IPipeline } from "../index-BQojRXVz.cjs";
3
- import { n as ISystemsRuntimeContext, o as ISystemsModuleBuilder, u as ISystemContext } from "../index-BPKNH5VY.cjs";
3
+ import { n as ISystemsRuntimeContext, o as ISystemsModuleBuilder, u as ISystemContext } from "../index-CrMUhuEK.cjs";
4
4
 
5
5
  //#region src/factories/context-factory.d.ts
6
6
  interface IContextFactory {
@@ -1,6 +1,6 @@
1
1
  import { a as IEntity } from "../identity-component-CgzvgBVh.mjs";
2
2
  import { l as IPipelineContext, o as IPipeline } from "../index-DeYfvKO0.mjs";
3
- import { n as ISystemsRuntimeContext, o as ISystemsModuleBuilder, u as ISystemContext } from "../index-Iv388eRi.mjs";
3
+ import { n as ISystemsRuntimeContext, o as ISystemsModuleBuilder, u as ISystemContext } from "../index-DQYLun1o.mjs";
4
4
 
5
5
  //#region src/factories/context-factory.d.ts
6
6
  interface IContextFactory {
@@ -110,22 +110,38 @@ interface IEntityEventsManager {
110
110
  /**
111
111
  * Event dispatcher for publishing events to interested entities.
112
112
  * Responsible for routing events to their subscribers through the update queue.
113
+ *
114
+ * Use `dispatchEvent` / `dispatchEvents` for targeted delivery (requires explicit targets).
115
+ * Use `broadcastEvent` / `broadcastEvents` for subscription-based delivery to all subscribers.
113
116
  */
114
117
  interface IEntityEventsDispatcher {
115
118
  /**
116
- * Publishes a single event to subscribers.
117
- * The event is routed based on subscriptions or explicit target(s).
119
+ * Publishes a single event to one or more explicit targets.
120
+ * The event is sent only to the specified target(s) — it does NOT fall back to subscriptions.
118
121
  * @param event - The event to dispatch.
119
- * @param targets - Optional specific entities to send to. If provided, event is only sent to these targets.
122
+ * @param target - The entity or entities to send the event to.
120
123
  */
121
- dispatchEvent(event: IEntityEvent<IEventData>, ...targets: IEntityProxy[]): void;
124
+ dispatchEvent(event: IEntityEvent<IEventData>, target: IEntityProxy | IEntityProxy[]): void;
122
125
  /**
123
- * Publishes multiple events to subscribers.
124
- * Efficiently dispatches an array of events in bulk.
126
+ * Publishes multiple events to one or more explicit targets.
127
+ * Each target receives all events in a single update.
125
128
  * @param events - The events to dispatch.
126
- * @param targets - Optional specific entities to send to. If provided, events are only sent to these targets.
129
+ * @param target - The entity or entities to send the events to.
130
+ */
131
+ dispatchEvents(events: IEntityEvent<IEventData>[], target: IEntityProxy | IEntityProxy[]): void;
132
+ /**
133
+ * Broadcasts a single event to all subscribers registered for that event type.
134
+ * Uses the subscription registry to resolve targets. Use intentionally — this can
135
+ * generate O(N) queue entries where N is the subscriber count.
136
+ * @param event - The event to broadcast.
137
+ */
138
+ broadcastEvent(event: IEntityEvent<IEventData>): void;
139
+ /**
140
+ * Broadcasts multiple events to all subscribers.
141
+ * Events are grouped per subscriber so each receives a single update.
142
+ * @param events - The events to broadcast.
127
143
  */
128
- dispatchEvents(events: IEntityEvent<IEventData>[], ...targets: IEntityProxy[]): void;
144
+ broadcastEvents(events: IEntityEvent<IEventData>[]): void;
129
145
  }
130
146
  //#endregion
131
147
  //#region src/entities/entity-snapshot.d.ts
@@ -396,4 +412,4 @@ interface IEntityScheduler {
396
412
  }
397
413
  //#endregion
398
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 };
399
- //# sourceMappingURL=index-xgRroB4J.d.mts.map
415
+ //# sourceMappingURL=index-C0v9GTM7.d.mts.map
@@ -110,22 +110,38 @@ interface IEntityEventsManager {
110
110
  /**
111
111
  * Event dispatcher for publishing events to interested entities.
112
112
  * Responsible for routing events to their subscribers through the update queue.
113
+ *
114
+ * Use `dispatchEvent` / `dispatchEvents` for targeted delivery (requires explicit targets).
115
+ * Use `broadcastEvent` / `broadcastEvents` for subscription-based delivery to all subscribers.
113
116
  */
114
117
  interface IEntityEventsDispatcher {
115
118
  /**
116
- * Publishes a single event to subscribers.
117
- * The event is routed based on subscriptions or explicit target(s).
119
+ * Publishes a single event to one or more explicit targets.
120
+ * The event is sent only to the specified target(s) — it does NOT fall back to subscriptions.
118
121
  * @param event - The event to dispatch.
119
- * @param targets - Optional specific entities to send to. If provided, event is only sent to these targets.
122
+ * @param target - The entity or entities to send the event to.
120
123
  */
121
- dispatchEvent(event: IEntityEvent<IEventData>, ...targets: IEntityProxy[]): void;
124
+ dispatchEvent(event: IEntityEvent<IEventData>, target: IEntityProxy | IEntityProxy[]): void;
122
125
  /**
123
- * Publishes multiple events to subscribers.
124
- * Efficiently dispatches an array of events in bulk.
126
+ * Publishes multiple events to one or more explicit targets.
127
+ * Each target receives all events in a single update.
125
128
  * @param events - The events to dispatch.
126
- * @param targets - Optional specific entities to send to. If provided, events are only sent to these targets.
129
+ * @param target - The entity or entities to send the events to.
130
+ */
131
+ dispatchEvents(events: IEntityEvent<IEventData>[], target: IEntityProxy | IEntityProxy[]): void;
132
+ /**
133
+ * Broadcasts a single event to all subscribers registered for that event type.
134
+ * Uses the subscription registry to resolve targets. Use intentionally — this can
135
+ * generate O(N) queue entries where N is the subscriber count.
136
+ * @param event - The event to broadcast.
137
+ */
138
+ broadcastEvent(event: IEntityEvent<IEventData>): void;
139
+ /**
140
+ * Broadcasts multiple events to all subscribers.
141
+ * Events are grouped per subscriber so each receives a single update.
142
+ * @param events - The events to broadcast.
127
143
  */
128
- dispatchEvents(events: IEntityEvent<IEventData>[], ...targets: IEntityProxy[]): void;
144
+ broadcastEvents(events: IEntityEvent<IEventData>[]): void;
129
145
  }
130
146
  //#endregion
131
147
  //#region src/entities/entity-snapshot.d.ts
@@ -396,4 +412,4 @@ interface IEntityScheduler {
396
412
  }
397
413
  //#endregion
398
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 };
399
- //# sourceMappingURL=index-s3-CSfQd.d.cts.map
415
+ //# sourceMappingURL=index-C1Ojam4M.d.cts.map
@@ -1,6 +1,6 @@
1
1
  import { a as IEntity, c as IEntityProxy, l as IEntityProxyRepository, o as IEntityModel, r as EntityTypeUid, s as EntityProxy } from "./identity-component-uU0yDR-y.cjs";
2
2
  import { n as Immutable } from "./types-DLOd2zXO.cjs";
3
- import { c as IEntitySnapshot, d as EntityEventSubscriptionOptions, f as EntityEventUid, g as IEventData, o as IEntityUpdate, p as IEntityEvent } from "./index-s3-CSfQd.cjs";
3
+ import { c as IEntitySnapshot, d as EntityEventSubscriptionOptions, f as EntityEventUid, g as IEventData, o as IEntityUpdate, p as IEntityEvent } from "./index-C1Ojam4M.cjs";
4
4
  import { a as ILogger, c as IJsonSerializer, r as PerformanceTimeEntry } from "./index-Cs9Eerjt.cjs";
5
5
  import { c as IMiddleware, l as IPipelineContext, o as IPipeline } from "./index-BQojRXVz.cjs";
6
6
 
@@ -12,20 +12,31 @@ import { c as IMiddleware, l as IPipelineContext, o as IPipeline } from "./index
12
12
  */
13
13
  interface ISystemContextEvents {
14
14
  /**
15
- * Publishes an event to subscribers or specific targets.
16
- * If targets are provided, event is sent only to those entities.
17
- * Otherwise, event is routed to all subscribers based on subscription registry.
15
+ * Publishes an event to one or more explicit targets.
16
+ * The event is sent only to the specified target(s) — it does NOT fall back to subscriptions.
18
17
  * @param data - The event payload.
19
- * @param targets - Optional specific entities to send to.
18
+ * @param target - The entity or entities to send the event to.
20
19
  */
21
- dispatchEvent<TEventData extends IEventData>(data: TEventData, ...targets: IEntityProxy[]): void;
20
+ dispatchEvent<TEventData extends IEventData>(data: TEventData, target: IEntityProxy | IEntityProxy[]): void;
22
21
  /**
23
- * Publishes multiple events in bulk.
24
- * More efficient than calling dispatchEvent repeatedly.
22
+ * Publishes multiple events to one or more explicit targets.
23
+ * Each target receives all events in a single update.
25
24
  * @param data - Array of event payloads to dispatch.
26
- * @param targets - Optional specific entities to send to.
25
+ * @param target - The entity or entities to send the events to.
27
26
  */
28
- dispatchEvents<TEventData extends IEventData>(data: TEventData[], ...targets: IEntityProxy[]): void;
27
+ dispatchEvents<TEventData extends IEventData>(data: TEventData[], target: IEntityProxy | IEntityProxy[]): void;
28
+ /**
29
+ * Broadcasts an event to all subscribers registered for that event type.
30
+ * Uses the subscription registry to resolve targets.
31
+ * @param data - The event payload.
32
+ */
33
+ broadcastEvent<TEventData extends IEventData>(data: TEventData): void;
34
+ /**
35
+ * Broadcasts multiple events to all subscribers.
36
+ * Events are grouped per subscriber so each receives a single update.
37
+ * @param data - Array of event payloads to broadcast.
38
+ */
39
+ broadcastEvents<TEventData extends IEventData>(data: TEventData[]): void;
29
40
  /**
30
41
  * Retrieves an event from the current context by its identifier.
31
42
  * Useful for checking if an event was received this frame.
@@ -530,4 +541,4 @@ interface ISystemsRuntimeContext<TEntity extends IEntity> extends IPipelineConte
530
541
  type ISystemsRuntimeMiddleware<TEntity extends IEntity> = IMiddleware<ISystemsRuntimeContext<TEntity>>;
531
542
  //#endregion
532
543
  export { ISystemsModuleRepository as a, ISystemsModule as c, ISystemContextSnapshot as d, ISystemContextScheduler as f, ISystemContextEvents as h, ISystemContextEntity as i, SystemType as l, ISystemContextProxies as m, ISystemsRuntimeContext as n, ISystemsModuleBuilder as o, ISystemContextRepository as p, ISystemsRuntime as r, ISystemMiddleware as s, ISystemsRuntimeMiddleware as t, ISystemContext as u };
533
- //# sourceMappingURL=index-BPKNH5VY.d.cts.map
544
+ //# sourceMappingURL=index-CrMUhuEK.d.cts.map
@@ -1,6 +1,6 @@
1
1
  import { a as IEntity, c as IEntityProxy, l as IEntityProxyRepository, o as IEntityModel, r as EntityTypeUid, s as EntityProxy } from "./identity-component-CgzvgBVh.mjs";
2
2
  import { n as Immutable } from "./types-CnDtpKsY.mjs";
3
- import { c as IEntitySnapshot, d as EntityEventSubscriptionOptions, f as EntityEventUid, g as IEventData, o as IEntityUpdate, p as IEntityEvent } from "./index-xgRroB4J.mjs";
3
+ import { c as IEntitySnapshot, d as EntityEventSubscriptionOptions, f as EntityEventUid, g as IEventData, o as IEntityUpdate, p as IEntityEvent } from "./index-C0v9GTM7.mjs";
4
4
  import { a as ILogger, c as IJsonSerializer, r as PerformanceTimeEntry } from "./index-hHkhvmkO.mjs";
5
5
  import { c as IMiddleware, l as IPipelineContext, o as IPipeline } from "./index-DeYfvKO0.mjs";
6
6
 
@@ -12,20 +12,31 @@ import { c as IMiddleware, l as IPipelineContext, o as IPipeline } from "./index
12
12
  */
13
13
  interface ISystemContextEvents {
14
14
  /**
15
- * Publishes an event to subscribers or specific targets.
16
- * If targets are provided, event is sent only to those entities.
17
- * Otherwise, event is routed to all subscribers based on subscription registry.
15
+ * Publishes an event to one or more explicit targets.
16
+ * The event is sent only to the specified target(s) — it does NOT fall back to subscriptions.
18
17
  * @param data - The event payload.
19
- * @param targets - Optional specific entities to send to.
18
+ * @param target - The entity or entities to send the event to.
20
19
  */
21
- dispatchEvent<TEventData extends IEventData>(data: TEventData, ...targets: IEntityProxy[]): void;
20
+ dispatchEvent<TEventData extends IEventData>(data: TEventData, target: IEntityProxy | IEntityProxy[]): void;
22
21
  /**
23
- * Publishes multiple events in bulk.
24
- * More efficient than calling dispatchEvent repeatedly.
22
+ * Publishes multiple events to one or more explicit targets.
23
+ * Each target receives all events in a single update.
25
24
  * @param data - Array of event payloads to dispatch.
26
- * @param targets - Optional specific entities to send to.
25
+ * @param target - The entity or entities to send the events to.
27
26
  */
28
- dispatchEvents<TEventData extends IEventData>(data: TEventData[], ...targets: IEntityProxy[]): void;
27
+ dispatchEvents<TEventData extends IEventData>(data: TEventData[], target: IEntityProxy | IEntityProxy[]): void;
28
+ /**
29
+ * Broadcasts an event to all subscribers registered for that event type.
30
+ * Uses the subscription registry to resolve targets.
31
+ * @param data - The event payload.
32
+ */
33
+ broadcastEvent<TEventData extends IEventData>(data: TEventData): void;
34
+ /**
35
+ * Broadcasts multiple events to all subscribers.
36
+ * Events are grouped per subscriber so each receives a single update.
37
+ * @param data - Array of event payloads to broadcast.
38
+ */
39
+ broadcastEvents<TEventData extends IEventData>(data: TEventData[]): void;
29
40
  /**
30
41
  * Retrieves an event from the current context by its identifier.
31
42
  * Useful for checking if an event was received this frame.
@@ -530,4 +541,4 @@ interface ISystemsRuntimeContext<TEntity extends IEntity> extends IPipelineConte
530
541
  type ISystemsRuntimeMiddleware<TEntity extends IEntity> = IMiddleware<ISystemsRuntimeContext<TEntity>>;
531
542
  //#endregion
532
543
  export { ISystemsModuleRepository as a, ISystemsModule as c, ISystemContextSnapshot as d, ISystemContextScheduler as f, ISystemContextEvents as h, ISystemContextEntity as i, SystemType as l, ISystemContextProxies as m, ISystemsRuntimeContext as n, ISystemsModuleBuilder as o, ISystemContextRepository as p, ISystemsRuntime as r, ISystemMiddleware as s, ISystemsRuntimeMiddleware as t, ISystemContext as u };
533
- //# sourceMappingURL=index-Iv388eRi.d.mts.map
544
+ //# sourceMappingURL=index-DQYLun1o.d.mts.map
@@ -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-BPKNH5VY.cjs";
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-CrMUhuEK.cjs";
2
2
  export { ISystemContext, ISystemContextEntity, 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-Iv388eRi.mjs";
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-DQYLun1o.mjs";
2
2
  export { ISystemContext, ISystemContextEntity, ISystemContextEvents, ISystemContextProxies, ISystemContextRepository, ISystemContextScheduler, ISystemContextSnapshot, ISystemMiddleware, ISystemsModule, ISystemsModuleBuilder, ISystemsModuleRepository, ISystemsRuntime, ISystemsRuntimeContext, ISystemsRuntimeMiddleware, SystemType };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awesome-ecs/abstract",
3
- "version": "0.27.0",
3
+ "version": "0.28.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": "2497216453c86197b6a5e15e7a569b9ccf79a1f1"
100
+ "gitHead": "41492d7ce0a5e4182798619fe238d0a6d4af6e5a"
101
101
  }