@awesome-ecs/abstract 0.22.0 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +126 -228
- package/dist/components/index.cjs +3 -3
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +1 -2
- package/dist/components/index.d.mts +2 -0
- package/dist/components/{index.js → index.mjs} +4 -4
- package/dist/components/index.mjs.map +1 -0
- package/dist/entities/index.cjs +12 -5
- package/dist/entities/index.cjs.map +1 -1
- package/dist/entities/index.d.cts +3 -4
- package/dist/entities/index.d.mts +3 -0
- package/dist/entities/index.mjs +20 -0
- package/dist/entities/index.mjs.map +1 -0
- package/dist/factories/index.d.cts +47 -35
- package/dist/factories/index.d.mts +69 -0
- package/dist/factories/index.mjs +1 -0
- package/dist/identity-component-CgzvgBVh.d.mts +254 -0
- package/dist/identity-component-uU0yDR-y.d.cts +254 -0
- package/dist/index-BWmhFdFg.d.mts +148 -0
- package/dist/index-CfEs8NEA.d.mts +328 -0
- package/dist/index-D4jK3qG1.d.mts +224 -0
- package/dist/index-DULE7rVz.d.mts +515 -0
- package/dist/index-DZvjMjYZ.d.cts +224 -0
- package/dist/index-J5AU4JAU.d.cts +515 -0
- package/dist/index-eECJUE_O.d.cts +148 -0
- package/dist/index-qSeVF9hf.d.cts +328 -0
- package/dist/pipelines/index.cjs +0 -31
- package/dist/pipelines/index.d.cts +2 -4
- package/dist/pipelines/index.d.mts +2 -0
- package/dist/pipelines/index.mjs +1 -0
- package/dist/systems/index.cjs +18 -18
- package/dist/systems/index.cjs.map +1 -1
- package/dist/systems/index.d.cts +2 -7
- package/dist/systems/index.d.mts +2 -0
- package/dist/systems/index.mjs +33 -0
- package/dist/systems/index.mjs.map +1 -0
- package/dist/types-CnDtpKsY.d.mts +70 -0
- package/dist/types-DLOd2zXO.d.cts +70 -0
- package/dist/utils/index.cjs +11 -11
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.cts +2 -2
- package/dist/utils/index.d.mts +3 -0
- package/dist/utils/index.mjs +27 -0
- package/dist/utils/index.mjs.map +1 -0
- package/package.json +14 -14
- package/dist/components/index.d.ts +0 -3
- package/dist/components/index.js.map +0 -1
- package/dist/entities/index.d.ts +0 -4
- package/dist/entities/index.js +0 -13
- package/dist/entities/index.js.map +0 -1
- package/dist/factories/index.d.ts +0 -57
- package/dist/factories/index.js +0 -0
- package/dist/identity-component-BDWEtAXA.d.cts +0 -238
- package/dist/identity-component-CR1ULadR.d.ts +0 -238
- package/dist/index-C3UGZqUG.d.ts +0 -288
- package/dist/index-CH8ucsKZ.d.ts +0 -472
- package/dist/index-ChV4Q5j6.d.cts +0 -137
- package/dist/index-CjNeb3ML.d.cts +0 -472
- package/dist/index-Cm-YSPhK.d.ts +0 -254
- package/dist/index-D81Fo9XN.d.cts +0 -254
- package/dist/index-DLm-DKAk.d.cts +0 -288
- package/dist/index-oenqxDCa.d.ts +0 -137
- package/dist/pipelines/index.cjs.map +0 -1
- package/dist/pipelines/index.d.ts +0 -4
- package/dist/pipelines/index.js +0 -30
- package/dist/pipelines/index.js.map +0 -1
- package/dist/systems/index.d.ts +0 -7
- package/dist/systems/index.js +0 -33
- package/dist/systems/index.js.map +0 -1
- package/dist/types-DvzdpbLu.d.cts +0 -69
- package/dist/types-yh4pOGEm.d.ts +0 -69
- package/dist/utils/index.d.ts +0 -3
- package/dist/utils/index.js +0 -27
- package/dist/utils/index.js.map +0 -1
|
@@ -1,288 +0,0 @@
|
|
|
1
|
-
import { EntityTypeUid, IComponent, IEntity, IEntityModel, IEntityProxy, IdentityComponent } from "./identity-component-BDWEtAXA.cjs";
|
|
2
|
-
|
|
3
|
-
//#region src/entities/entity-events.d.ts
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Represents a unique identifier for an entity event.
|
|
7
|
-
* Can be either a string or a number.
|
|
8
|
-
*/
|
|
9
|
-
type EntityEventUid = string | number;
|
|
10
|
-
/**
|
|
11
|
-
* A filter function for entity event subscriptions.
|
|
12
|
-
* Returns true if the event should be processed, false otherwise.
|
|
13
|
-
*/
|
|
14
|
-
type EntityEventSubscriptionFilter = (event: IEntityEvent<IEventData>) => boolean;
|
|
15
|
-
/**
|
|
16
|
-
* The `IEventData` interface represents the data associated with an entity event.
|
|
17
|
-
* It contains at least the `Event Unique Identifier`.
|
|
18
|
-
*/
|
|
19
|
-
interface IEventData {
|
|
20
|
-
uid: EntityEventUid;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* The `IEntityEvent` interface represents a basic building block for a Publish/Subscribe pattern.
|
|
24
|
-
* It is used to synchronize state between multiple entities.
|
|
25
|
-
*
|
|
26
|
-
* The events are scheduled as part of the `EntityUpdate` model.
|
|
27
|
-
* Systems subscribe and receive updates with the events included in their `SystemContext`.
|
|
28
|
-
*/
|
|
29
|
-
interface IEntityEvent<TEventData extends IEventData> {
|
|
30
|
-
origin: IEntityProxy;
|
|
31
|
-
target?: IEntityProxy;
|
|
32
|
-
data: TEventData;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* The `IEntityEventsManager` interface represents a Publish/Subscribe broker for `IEntityEvent` instances.
|
|
36
|
-
* It keeps track of entity subscriptions (as part of the Observer design pattern).
|
|
37
|
-
*/
|
|
38
|
-
interface IEntityEventsManager {
|
|
39
|
-
/**
|
|
40
|
-
* Subscribes an entity to a specific event.
|
|
41
|
-
* @param uid - The unique identifier of the event.
|
|
42
|
-
* @param entity - The entity subscribing to the event.
|
|
43
|
-
* @param filter - An optional filter function to determine if the event should be processed.
|
|
44
|
-
*/
|
|
45
|
-
subscribe(uid: EntityEventUid, entity: IEntityProxy, filter?: EntityEventSubscriptionFilter): void;
|
|
46
|
-
/**
|
|
47
|
-
* Unsubscribes an entity from a specific event.
|
|
48
|
-
* @param uid - The unique identifier of the event.
|
|
49
|
-
* @param entity - The entity unsubscribing from the event.
|
|
50
|
-
*/
|
|
51
|
-
unsubscribe(uid: EntityEventUid, entity: IEntityProxy): void;
|
|
52
|
-
/**
|
|
53
|
-
* Retrieves the entities subscribed to a specific event.
|
|
54
|
-
* @param event - The event to retrieve subscriptions for.
|
|
55
|
-
* @returns An array of entities subscribed to the event.
|
|
56
|
-
*/
|
|
57
|
-
getSubscriptions(event: IEntityEvent<IEventData>): IEntityProxy[];
|
|
58
|
-
/**
|
|
59
|
-
* Retrieves the unique identifiers of events subscribed to by a specific entity.
|
|
60
|
-
* @param entity - The entity to retrieve subscriptions for.
|
|
61
|
-
* @returns An array of unique identifiers of events subscribed to by the entity.
|
|
62
|
-
*/
|
|
63
|
-
getSubscriptionsForEntity(entity: IEntityProxy): EntityEventUid[];
|
|
64
|
-
/**
|
|
65
|
-
* Removes all subscriptions for all entities.
|
|
66
|
-
*/
|
|
67
|
-
clearSubscriptions(): void;
|
|
68
|
-
/**
|
|
69
|
-
* Removes all subscriptions for a specific event.
|
|
70
|
-
* @param uid - The unique identifier of the event to remove subscriptions from.
|
|
71
|
-
*/
|
|
72
|
-
clearSubscriptionsForEvent(uid: EntityEventUid): void;
|
|
73
|
-
/**
|
|
74
|
-
* Removes all subscriptions for a specific entity.
|
|
75
|
-
* @param entity - The entity to remove subscriptions from.
|
|
76
|
-
*/
|
|
77
|
-
clearSubscriptionsForEntity(entity: IEntityProxy): void;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* The `IEntityEventsDispatcher` interface represents the main access point for dispatching events to entities.
|
|
81
|
-
* It can leverage the `IEntityEventsManager` to find subscribers and the `IEntityUpdateQueue` to register events
|
|
82
|
-
* into each observer entity's next update.
|
|
83
|
-
*/
|
|
84
|
-
interface IEntityEventsDispatcher {
|
|
85
|
-
/**
|
|
86
|
-
* Dispatches a single event to entities.
|
|
87
|
-
* @param event - The event to dispatch.
|
|
88
|
-
* @param targets - The entities to dispatch the event to.
|
|
89
|
-
*/
|
|
90
|
-
dispatchEvent(event: IEntityEvent<IEventData>, ...targets: IEntityProxy[]): void;
|
|
91
|
-
/**
|
|
92
|
-
* Dispatches multiple events to entities.
|
|
93
|
-
* @param events - The events to dispatch.
|
|
94
|
-
* @param targets - The entities to dispatch the events to.
|
|
95
|
-
*/
|
|
96
|
-
dispatchEvents(events: IEntityEvent<IEventData>[], ...targets: IEntityProxy[]): void;
|
|
97
|
-
}
|
|
98
|
-
//#endregion
|
|
99
|
-
//#region src/entities/entity-snapshot.d.ts
|
|
100
|
-
/**
|
|
101
|
-
* The `IEntitySnapshot` interface represents a serializable state of an Entity.
|
|
102
|
-
* It can contain the full or partial state of the Entity, including its identity, components, proxies, and events.
|
|
103
|
-
* This interface is used to capture Entity state changes (deltas) or update existing Entity with changes from a remote source.
|
|
104
|
-
*/
|
|
105
|
-
interface IEntitySnapshot {
|
|
106
|
-
/**
|
|
107
|
-
* The identity of the Entity.
|
|
108
|
-
*/
|
|
109
|
-
readonly identity?: Readonly<IdentityComponent<IEntityModel>>;
|
|
110
|
-
/**
|
|
111
|
-
* An array of components associated with the Entity.
|
|
112
|
-
*/
|
|
113
|
-
readonly components?: IComponent[];
|
|
114
|
-
/**
|
|
115
|
-
* An array of proxies associated with the Entity.
|
|
116
|
-
*/
|
|
117
|
-
readonly proxies?: IEntityProxy[];
|
|
118
|
-
/**
|
|
119
|
-
* An array of events associated with the Entity.
|
|
120
|
-
*/
|
|
121
|
-
readonly events?: IEntityEvent<IEventData>[];
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* The `IEntitySnapshotProvider` interface is the main provider for creating and updating Entity snapshots.
|
|
125
|
-
* It provides methods to apply a snapshot to an Entity and to create a snapshot from an Entity.
|
|
126
|
-
*/
|
|
127
|
-
interface IEntitySnapshotProvider {
|
|
128
|
-
/**
|
|
129
|
-
* Applies a snapshot to an Entity.
|
|
130
|
-
* This method updates the Entity's state based on the provided snapshot.
|
|
131
|
-
*
|
|
132
|
-
* @param entity - The Entity to apply the snapshot to.
|
|
133
|
-
* @param snapshot - The snapshot to apply to the Entity.
|
|
134
|
-
*/
|
|
135
|
-
applySnapshot(entity: IEntity, snapshot: IEntitySnapshot): void;
|
|
136
|
-
/**
|
|
137
|
-
* Creates a snapshot from an Entity.
|
|
138
|
-
* This method captures the current state of the Entity and returns it as a snapshot.
|
|
139
|
-
*
|
|
140
|
-
* @param entity - The Entity to create a snapshot from.
|
|
141
|
-
* @returns The created snapshot.
|
|
142
|
-
*/
|
|
143
|
-
createSnapshot(entity: IEntity): IEntitySnapshot;
|
|
144
|
-
}
|
|
145
|
-
//#endregion
|
|
146
|
-
//#region src/entities/entity-queue.d.ts
|
|
147
|
-
/**
|
|
148
|
-
* The `EntityUpdateType` enum specifies whether the current Entity should be `updated` or `removed`.
|
|
149
|
-
*/
|
|
150
|
-
declare enum EntityUpdateType {
|
|
151
|
-
update = "update",
|
|
152
|
-
remove = "remove",
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* The `IEntityUpdate` interface represents an Entity update that should be applied over an existing Entity.
|
|
156
|
-
*/
|
|
157
|
-
interface IEntityUpdate {
|
|
158
|
-
/**
|
|
159
|
-
* The type of the update, which can be either `update` or `remove`.
|
|
160
|
-
*/
|
|
161
|
-
type: EntityUpdateType;
|
|
162
|
-
/**
|
|
163
|
-
* The proxy of the Entity that needs to be updated.
|
|
164
|
-
*/
|
|
165
|
-
entity: IEntityProxy;
|
|
166
|
-
/**
|
|
167
|
-
* Optional. The model of the Entity that needs to be updated.
|
|
168
|
-
*/
|
|
169
|
-
model?: IEntityModel;
|
|
170
|
-
/**
|
|
171
|
-
* Optional. The snapshot of the Entity that needs to be updated.
|
|
172
|
-
*/
|
|
173
|
-
snapshot?: IEntitySnapshot;
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* The `IEntityUpdateQueue` interface is the main mechanism to queue and retrieve `EntityUpdate` instances.
|
|
177
|
-
*
|
|
178
|
-
* The interface can be implemented using a simple queue mechanism, or perhaps, a Priority Queue.
|
|
179
|
-
*/
|
|
180
|
-
interface IEntityUpdateQueue {
|
|
181
|
-
/**
|
|
182
|
-
* The number of `EntityUpdate` instances currently in the queue.
|
|
183
|
-
*/
|
|
184
|
-
readonly size: number;
|
|
185
|
-
/**
|
|
186
|
-
* Adds an `EntityUpdate` instance to the end of the queue.
|
|
187
|
-
* @param change - The `EntityUpdate` instance to be added.
|
|
188
|
-
*/
|
|
189
|
-
enqueue(change: IEntityUpdate): void;
|
|
190
|
-
/**
|
|
191
|
-
* Removes and returns the `EntityUpdate` instance at the front of the queue.
|
|
192
|
-
* @returns The `EntityUpdate` instance at the front of the queue.
|
|
193
|
-
*/
|
|
194
|
-
dequeue(): IEntityUpdate;
|
|
195
|
-
/**
|
|
196
|
-
* Returns the `EntityUpdate` instance at the front of the queue without removing it.
|
|
197
|
-
* @returns The `EntityUpdate` instance at the front of the queue.
|
|
198
|
-
*/
|
|
199
|
-
peek(): IEntityUpdate;
|
|
200
|
-
/**
|
|
201
|
-
* Removes all `EntityUpdate` instances from the queue.
|
|
202
|
-
*/
|
|
203
|
-
clear(): void;
|
|
204
|
-
}
|
|
205
|
-
//#endregion
|
|
206
|
-
//#region src/entities/entity-repository.d.ts
|
|
207
|
-
/**
|
|
208
|
-
* The `IEntityRepository` is the central storage for keeping track of existing Entities.
|
|
209
|
-
* It provides basic CRUD functionality.
|
|
210
|
-
*/
|
|
211
|
-
interface IEntityRepository {
|
|
212
|
-
/**
|
|
213
|
-
* Returns the number of entities in the repository.
|
|
214
|
-
*/
|
|
215
|
-
readonly size: number;
|
|
216
|
-
/**
|
|
217
|
-
* Checks if the repository contains an entity represented by the given proxy.
|
|
218
|
-
* @param proxy - The proxy of the entity to check.
|
|
219
|
-
* @returns True if the repository contains the entity, false otherwise.
|
|
220
|
-
*/
|
|
221
|
-
has(proxy: IEntityProxy): boolean;
|
|
222
|
-
/**
|
|
223
|
-
* Retrieves an entity from the repository by its proxy.
|
|
224
|
-
* @template TEntity - The type of the entity to retrieve.
|
|
225
|
-
* @param proxy - The proxy of the entity to retrieve.
|
|
226
|
-
* @returns The retrieved entity.
|
|
227
|
-
*/
|
|
228
|
-
get<TEntity extends IEntity>(proxy: IEntityProxy): TEntity;
|
|
229
|
-
/**
|
|
230
|
-
* Retrieves all entities of a specific type from the repository.
|
|
231
|
-
* @template TEntity - The type of the entities to retrieve.
|
|
232
|
-
* @param entityType - The type UID of the entities to retrieve.
|
|
233
|
-
* @returns An array of the retrieved entities.
|
|
234
|
-
*/
|
|
235
|
-
getAll<TEntity extends IEntity>(entityType: EntityTypeUid): TEntity[];
|
|
236
|
-
/**
|
|
237
|
-
* Iterator over all entities in the repository.
|
|
238
|
-
* @returns An iterator of all entities in the repository.
|
|
239
|
-
*/
|
|
240
|
-
listAll(): IterableIterator<IEntity>;
|
|
241
|
-
/**
|
|
242
|
-
* Adds or updates an entity in the repository.
|
|
243
|
-
* @param entity - The entity to add or update.
|
|
244
|
-
*/
|
|
245
|
-
set(entity: IEntity): void;
|
|
246
|
-
/**
|
|
247
|
-
* Deletes an entity from the repository by its proxy.
|
|
248
|
-
* @param proxy - The proxy of the entity to delete.
|
|
249
|
-
*/
|
|
250
|
-
delete(proxy: IEntityProxy): void;
|
|
251
|
-
/**
|
|
252
|
-
* Clears all entities of a specific type from the repository.
|
|
253
|
-
* @param entityType - The type UID of the entities to clear.
|
|
254
|
-
*/
|
|
255
|
-
clear(entityType: EntityTypeUid): void;
|
|
256
|
-
}
|
|
257
|
-
//#endregion
|
|
258
|
-
//#region src/entities/entity-scheduler.d.ts
|
|
259
|
-
/**
|
|
260
|
-
* The `IEntityScheduler` is the main way of queuing `IEntityUpdate` instances on an Interval (based on time or a custom implementation).
|
|
261
|
-
*
|
|
262
|
-
* It usually reads the Entities from the `IEntityRepository`, and uses the `IEntityUpdateQueue` to enqueue Entity updates.
|
|
263
|
-
*/
|
|
264
|
-
interface IEntityScheduler {
|
|
265
|
-
/**
|
|
266
|
-
* Schedules an entity for updates at a specified interval.
|
|
267
|
-
*
|
|
268
|
-
* @param entityProxy - The entity to schedule for updates.
|
|
269
|
-
* @param intervalMs - The interval at which to schedule updates, in milliseconds. If not provided, the default interval will be used.
|
|
270
|
-
*/
|
|
271
|
-
schedule(entityProxy: IEntityProxy, intervalMs?: number): void;
|
|
272
|
-
/**
|
|
273
|
-
* Removes an entity from the scheduler.
|
|
274
|
-
*
|
|
275
|
-
* @param entityProxy - The entity to remove from the scheduler.
|
|
276
|
-
*/
|
|
277
|
-
remove(entityProxy: IEntityProxy): void;
|
|
278
|
-
/**
|
|
279
|
-
* Checks if an entity is currently scheduled for updates.
|
|
280
|
-
*
|
|
281
|
-
* @param entityProxy - The entity to check.
|
|
282
|
-
* @returns `true` if the entity is scheduled, `false` otherwise.
|
|
283
|
-
*/
|
|
284
|
-
has(entityProxy: IEntityProxy): boolean;
|
|
285
|
-
}
|
|
286
|
-
//#endregion
|
|
287
|
-
export { EntityEventSubscriptionFilter, EntityEventUid, EntityUpdateType, IEntityEvent, IEntityEventsDispatcher, IEntityEventsManager, IEntityRepository, IEntityScheduler, IEntitySnapshot, IEntitySnapshotProvider, IEntityUpdate, IEntityUpdateQueue, IEventData };
|
|
288
|
-
//# sourceMappingURL=index-DLm-DKAk.d.cts.map
|
package/dist/index-oenqxDCa.d.ts
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
//#region src/utils/json-serializer.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* A custom `IJsonSerializer` interface allows for different ways of serializing and parsing objects.
|
|
4
|
-
*/
|
|
5
|
-
interface IJsonSerializer {
|
|
6
|
-
/**
|
|
7
|
-
* Serializes the given object into a JSON string.
|
|
8
|
-
*
|
|
9
|
-
* @param value The object to be serialized.
|
|
10
|
-
* @returns A JSON string representation of the object.
|
|
11
|
-
*/
|
|
12
|
-
serializeCustom(value: object): string;
|
|
13
|
-
/**
|
|
14
|
-
* Parses a JSON string into the specified object type.
|
|
15
|
-
*
|
|
16
|
-
* @template TObject The type of the object to be parsed.
|
|
17
|
-
* @param text The JSON string to be parsed.
|
|
18
|
-
* @returns The parsed object of type `TObject`.
|
|
19
|
-
*/
|
|
20
|
-
parseCustom<TObject>(text: string): TObject;
|
|
21
|
-
}
|
|
22
|
-
//#endregion
|
|
23
|
-
//#region src/utils/logger.d.ts
|
|
24
|
-
/**
|
|
25
|
-
* An ILogger instance allows printing messages to console or other targets.
|
|
26
|
-
*/
|
|
27
|
-
interface ILogger {
|
|
28
|
-
/**
|
|
29
|
-
* Logs a message with a specified level.
|
|
30
|
-
* @param level The level of the message.
|
|
31
|
-
* @param message The message to be logged.
|
|
32
|
-
* @param ...args Additional arguments to be included in the message.
|
|
33
|
-
*/
|
|
34
|
-
log(level: LogLevel, message: any, ...args: any[]): void;
|
|
35
|
-
/**
|
|
36
|
-
* Logs a trace-level message.
|
|
37
|
-
* @param message The message to be logged.
|
|
38
|
-
* @param ...args Additional arguments to be included in the message.
|
|
39
|
-
*/
|
|
40
|
-
trace(message: any, ...args: any[]): void;
|
|
41
|
-
/**
|
|
42
|
-
* Logs a debug-level message.
|
|
43
|
-
* @param message The message to be logged.
|
|
44
|
-
* @param ...args Additional arguments to be included in the message.
|
|
45
|
-
*/
|
|
46
|
-
debug(message: any, ...args: any[]): void;
|
|
47
|
-
/**
|
|
48
|
-
* Logs a warning-level message.
|
|
49
|
-
* @param message The message to be logged.
|
|
50
|
-
* @param ...args Additional arguments to be included in the message.
|
|
51
|
-
*/
|
|
52
|
-
warn(message: any, ...args: any[]): void;
|
|
53
|
-
/**
|
|
54
|
-
* Logs an error-level message.
|
|
55
|
-
* @param message The message to be logged.
|
|
56
|
-
* @param ...args Additional arguments to be included in the message.
|
|
57
|
-
*/
|
|
58
|
-
error(message: any, ...args: any[]): void;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* An enumeration of log levels.
|
|
62
|
-
*/
|
|
63
|
-
declare enum LogLevel {
|
|
64
|
-
/**
|
|
65
|
-
* Trace-level logging.
|
|
66
|
-
*/
|
|
67
|
-
trace = 0,
|
|
68
|
-
/**
|
|
69
|
-
* Debug-level logging.
|
|
70
|
-
*/
|
|
71
|
-
debug = 1,
|
|
72
|
-
/**
|
|
73
|
-
* Warning-level logging.
|
|
74
|
-
*/
|
|
75
|
-
warn = 2,
|
|
76
|
-
/**
|
|
77
|
-
* Error-level logging.
|
|
78
|
-
*/
|
|
79
|
-
error = 3,
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Options for configuring an ILogger instance.
|
|
83
|
-
*/
|
|
84
|
-
interface ILoggerOptions {
|
|
85
|
-
/**
|
|
86
|
-
* A map of log levels to their corresponding enabled status.
|
|
87
|
-
*/
|
|
88
|
-
enabled: Map<LogLevel, boolean>;
|
|
89
|
-
}
|
|
90
|
-
//#endregion
|
|
91
|
-
//#region src/utils/performance-timer.d.ts
|
|
92
|
-
/**
|
|
93
|
-
* A unique identifier for a timer.
|
|
94
|
-
*/
|
|
95
|
-
type PerformanceTimerUid = number;
|
|
96
|
-
/**
|
|
97
|
-
* A record of a timer's execution.
|
|
98
|
-
*
|
|
99
|
-
* @remarks
|
|
100
|
-
* This interface represents the details of a timer's execution.
|
|
101
|
-
* It includes the timer's name, start timestamp, end timestamp, and the duration of the timer's execution in milliseconds.
|
|
102
|
-
*
|
|
103
|
-
* @property {string} name - The name of the timer.
|
|
104
|
-
* @property {number} startedAt - The timestamp when the timer started.
|
|
105
|
-
* @property {number} [endedAt] - The timestamp when the timer ended.
|
|
106
|
-
* @property {number} [msPassed] - The time in milliseconds that the timer was active.
|
|
107
|
-
*/
|
|
108
|
-
interface PerformanceTimeEntry {
|
|
109
|
-
name: string;
|
|
110
|
-
startedAt: number;
|
|
111
|
-
endedAt?: number;
|
|
112
|
-
msPassed?: number;
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* An interface for a performance timer.
|
|
116
|
-
* This interface provides methods to start and end timers,
|
|
117
|
-
* and retrieve information about their execution.
|
|
118
|
-
*/
|
|
119
|
-
interface IPerformanceTimer {
|
|
120
|
-
/**
|
|
121
|
-
* Starts a new timer with the given name.
|
|
122
|
-
* @param {string} name - The name of the timer.
|
|
123
|
-
* @returns {PerformanceTimerUid} - A unique identifier for the newly started timer.
|
|
124
|
-
*/
|
|
125
|
-
startTimer(name: string): PerformanceTimerUid;
|
|
126
|
-
/**
|
|
127
|
-
* Ends the timer with the given timerUid and returns a record of its execution.
|
|
128
|
-
* @param {PerformanceTimerUid} timerUid - The unique identifier of the timer to end.
|
|
129
|
-
* @returns {PerformanceTimeEntry} - A record of the timer's execution.
|
|
130
|
-
* The returned object contains the timer's name, start timestamp, end timestamp,
|
|
131
|
-
* and the duration of the timer's execution in milliseconds.
|
|
132
|
-
*/
|
|
133
|
-
endTimer(timerUid: PerformanceTimerUid): PerformanceTimeEntry;
|
|
134
|
-
}
|
|
135
|
-
//#endregion
|
|
136
|
-
export { IJsonSerializer, ILogger, ILoggerOptions, IPerformanceTimer, LogLevel, PerformanceTimeEntry, PerformanceTimerUid };
|
|
137
|
-
//# sourceMappingURL=index-oenqxDCa.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/pipelines/pipeline-status.ts"],"sourcesContent":["/**\n * The PipelineStatus enum represents the different states a pipeline can be in.\n *\n * @remarks\n * This enum is used to track the current status of the pipeline.\n */\nexport enum PipelineStatus {\n /**\n * The pipeline is currently idle and not processing any tasks.\n */\n idle = 'idle',\n\n /**\n * The pipeline is currently processing tasks.\n */\n ongoing = 'ongoing',\n\n /**\n * The pipeline has completed all tasks successfully.\n */\n completed = 'completed',\n\n /**\n * The pipeline has been halted due to an error or middleware intervention.\n */\n halted = 'halted'\n}\n"],"mappings":";;;;;;;;AAMA,IAAY,4DAAL;;;;AAIL;;;;AAKA;;;;AAKA;;;;AAKA;;AACD"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import "../types-yh4pOGEm.js";
|
|
2
|
-
import { IMiddleware, IMiddlewareRunner, INestedContext, INestedMiddleware, IParentContext, IParentMiddleware, IPipeline, IPipelineContext, IPipelineRunner, PipelineResult, PipelineRuntime, PipelineStatus } from "../index-Cm-YSPhK.js";
|
|
3
|
-
import "../index-oenqxDCa.js";
|
|
4
|
-
export { IMiddleware, IMiddlewareRunner, INestedContext, INestedMiddleware, IParentContext, IParentMiddleware, IPipeline, IPipelineContext, IPipelineRunner, PipelineResult, PipelineRuntime, PipelineStatus };
|
package/dist/pipelines/index.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
//#region src/pipelines/pipeline-status.ts
|
|
2
|
-
/**
|
|
3
|
-
* The PipelineStatus enum represents the different states a pipeline can be in.
|
|
4
|
-
*
|
|
5
|
-
* @remarks
|
|
6
|
-
* This enum is used to track the current status of the pipeline.
|
|
7
|
-
*/
|
|
8
|
-
let PipelineStatus = /* @__PURE__ */ function(PipelineStatus$1) {
|
|
9
|
-
/**
|
|
10
|
-
* The pipeline is currently idle and not processing any tasks.
|
|
11
|
-
*/
|
|
12
|
-
PipelineStatus$1["idle"] = "idle";
|
|
13
|
-
/**
|
|
14
|
-
* The pipeline is currently processing tasks.
|
|
15
|
-
*/
|
|
16
|
-
PipelineStatus$1["ongoing"] = "ongoing";
|
|
17
|
-
/**
|
|
18
|
-
* The pipeline has completed all tasks successfully.
|
|
19
|
-
*/
|
|
20
|
-
PipelineStatus$1["completed"] = "completed";
|
|
21
|
-
/**
|
|
22
|
-
* The pipeline has been halted due to an error or middleware intervention.
|
|
23
|
-
*/
|
|
24
|
-
PipelineStatus$1["halted"] = "halted";
|
|
25
|
-
return PipelineStatus$1;
|
|
26
|
-
}({});
|
|
27
|
-
|
|
28
|
-
//#endregion
|
|
29
|
-
export { PipelineStatus };
|
|
30
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/pipelines/pipeline-status.ts"],"sourcesContent":["/**\n * The PipelineStatus enum represents the different states a pipeline can be in.\n *\n * @remarks\n * This enum is used to track the current status of the pipeline.\n */\nexport enum PipelineStatus {\n /**\n * The pipeline is currently idle and not processing any tasks.\n */\n idle = 'idle',\n\n /**\n * The pipeline is currently processing tasks.\n */\n ongoing = 'ongoing',\n\n /**\n * The pipeline has completed all tasks successfully.\n */\n completed = 'completed',\n\n /**\n * The pipeline has been halted due to an error or middleware intervention.\n */\n halted = 'halted'\n}\n"],"mappings":";;;;;;;AAMA,IAAY,4DAAL;;;;AAIL;;;;AAKA;;;;AAKA;;;;AAKA;;AACD"}
|
package/dist/systems/index.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import "../identity-component-CR1ULadR.js";
|
|
2
|
-
import "../types-yh4pOGEm.js";
|
|
3
|
-
import "../index-C3UGZqUG.js";
|
|
4
|
-
import "../index-Cm-YSPhK.js";
|
|
5
|
-
import "../index-oenqxDCa.js";
|
|
6
|
-
import { ISystemContext, ISystemContextEntity, ISystemContextEvents, ISystemContextProxies, ISystemContextRepository, ISystemContextScheduler, ISystemContextSnapshot, ISystemMiddleware, ISystemsModule, ISystemsModuleDefinition, ISystemsModuleRepository, ISystemsRuntime, ISystemsRuntimeContext, ISystemsRuntimeMiddleware, SystemRuntime, SystemType } from "../index-CH8ucsKZ.js";
|
|
7
|
-
export { ISystemContext, ISystemContextEntity, ISystemContextEvents, ISystemContextProxies, ISystemContextRepository, ISystemContextScheduler, ISystemContextSnapshot, ISystemMiddleware, ISystemsModule, ISystemsModuleDefinition, ISystemsModuleRepository, ISystemsRuntime, ISystemsRuntimeContext, ISystemsRuntimeMiddleware, SystemRuntime, SystemType };
|
package/dist/systems/index.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
//#region src/systems/module/system-type.ts
|
|
2
|
-
/**
|
|
3
|
-
* Enum representing the built-in System pipeline types.
|
|
4
|
-
* These types can be extended to introduce more types, and the System Runtime Pipeline should
|
|
5
|
-
* add Middleware to handle the newly added types.
|
|
6
|
-
*/
|
|
7
|
-
let SystemType = /* @__PURE__ */ function(SystemType$1) {
|
|
8
|
-
/**
|
|
9
|
-
* The initialization phase of the Module pipeline.
|
|
10
|
-
* This phase is typically used for setting up initial state and resources.
|
|
11
|
-
*/
|
|
12
|
-
SystemType$1[SystemType$1["initialize"] = 0] = "initialize";
|
|
13
|
-
/**
|
|
14
|
-
* The update phase of the Module pipeline.
|
|
15
|
-
* This phase is responsible for updating the game logic and state of entities.
|
|
16
|
-
*/
|
|
17
|
-
SystemType$1[SystemType$1["update"] = 1] = "update";
|
|
18
|
-
/**
|
|
19
|
-
* The render phase of the Module pipeline.
|
|
20
|
-
* This phase is used for rendering the game to the screen.
|
|
21
|
-
*/
|
|
22
|
-
SystemType$1[SystemType$1["render"] = 2] = "render";
|
|
23
|
-
/**
|
|
24
|
-
* The synchronization phase of the Module pipeline.
|
|
25
|
-
* This phase is used for synchronizing game state with external systems or other components.
|
|
26
|
-
*/
|
|
27
|
-
SystemType$1[SystemType$1["sync"] = 3] = "sync";
|
|
28
|
-
return SystemType$1;
|
|
29
|
-
}({});
|
|
30
|
-
|
|
31
|
-
//#endregion
|
|
32
|
-
export { SystemType };
|
|
33
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/systems/module/system-type.ts"],"sourcesContent":["/**\n * Enum representing the built-in System pipeline types.\n * These types can be extended to introduce more types, and the System Runtime Pipeline should\n * add Middleware to handle the newly added types.\n */\nexport enum SystemType {\n /**\n * The initialization phase of the Module pipeline.\n * This phase is typically used for setting up initial state and resources.\n */\n initialize = 0,\n\n /**\n * The update phase of the Module pipeline.\n * This phase is responsible for updating the game logic and state of entities.\n */\n update = 1,\n\n /**\n * The render phase of the Module pipeline.\n * This phase is used for rendering the game to the screen.\n */\n render = 2,\n\n /**\n * The synchronization phase of the Module pipeline.\n * This phase is used for synchronizing game state with external systems or other components.\n */\n sync = 3\n}\n"],"mappings":";;;;;;AAKA,IAAY,oDAAL;;;;;AAKL;;;;;AAMA;;;;;AAMA;;;;;AAMA;;AACD"}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
//#region src/utils/types.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Creates a type that maps all properties of T to boolean.
|
|
4
|
-
*
|
|
5
|
-
* @template T - The type to map properties to boolean.
|
|
6
|
-
* @returns A type with all properties of T mapped to boolean.
|
|
7
|
-
*/
|
|
8
|
-
type BooleanProps<T> = { [Property in keyof T]: boolean };
|
|
9
|
-
/**
|
|
10
|
-
* Creates a type that makes all properties of T mutable.
|
|
11
|
-
*
|
|
12
|
-
* @template T - The type to make properties mutable.
|
|
13
|
-
* @returns A type with all properties of T made mutable.
|
|
14
|
-
*/
|
|
15
|
-
type Mutable<T> = { -readonly [K in keyof T]: T[K] };
|
|
16
|
-
/**
|
|
17
|
-
* Creates a type that makes all properties of T mutable recursively.
|
|
18
|
-
*
|
|
19
|
-
* @template T - The type to make properties mutable recursively.
|
|
20
|
-
* @returns A type with all properties of T made mutable recursively.
|
|
21
|
-
*/
|
|
22
|
-
type MutableDeep<T> = { -readonly [K in keyof T]: Mutable<T[K]> };
|
|
23
|
-
type ImmutablePrimitive = undefined | null | boolean | string | number | Function;
|
|
24
|
-
/**
|
|
25
|
-
* Creates a type that makes all properties of T immutable.
|
|
26
|
-
*
|
|
27
|
-
* @template T - The type to make properties immutable.
|
|
28
|
-
* @returns A type with all properties of T made immutable.
|
|
29
|
-
*/
|
|
30
|
-
type Immutable<T> = T extends ImmutablePrimitive ? T : T extends Array<infer U> ? ImmutableArray<U> : T extends Map<infer K, infer V> ? ImmutableMap<K, V> : T extends Set<infer M> ? ImmutableSet<M> : ImmutableObject<T>;
|
|
31
|
-
/**
|
|
32
|
-
* Creates a type that makes all properties of T immutable in an array.
|
|
33
|
-
*
|
|
34
|
-
* @template T - The type to make properties immutable in an array.
|
|
35
|
-
* @returns A type with all properties of T made immutable in an array.
|
|
36
|
-
*/
|
|
37
|
-
type ImmutableArray<T> = ReadonlyArray<Immutable<T>>;
|
|
38
|
-
/**
|
|
39
|
-
* Creates a type that makes all properties of T immutable in a map.
|
|
40
|
-
*
|
|
41
|
-
* @template K - The key type of the map.
|
|
42
|
-
* @template V - The value type of the map.
|
|
43
|
-
* @returns A type with all properties of T made immutable in a map.
|
|
44
|
-
*/
|
|
45
|
-
type ImmutableMap<K, V> = ReadonlyMap<Immutable<K>, Immutable<V>>;
|
|
46
|
-
/**
|
|
47
|
-
* Creates a type that makes all properties of T immutable in a set.
|
|
48
|
-
*
|
|
49
|
-
* @template T - The type to make properties immutable in a set.
|
|
50
|
-
* @returns A type with all properties of T made immutable in a set.
|
|
51
|
-
*/
|
|
52
|
-
type ImmutableSet<T> = ReadonlySet<Immutable<T>>;
|
|
53
|
-
/**
|
|
54
|
-
* Creates a type that makes all properties of T immutable.
|
|
55
|
-
*
|
|
56
|
-
* @template T - The type to make properties immutable.
|
|
57
|
-
* @returns A type with all properties of T made immutable.
|
|
58
|
-
*/
|
|
59
|
-
type ImmutableObject<T> = { readonly [K in keyof T]: T[K] };
|
|
60
|
-
/**
|
|
61
|
-
* Creates a type that makes all properties of T immutable recursively.
|
|
62
|
-
*
|
|
63
|
-
* @template T - The type to make properties immutable recursively.
|
|
64
|
-
* @returns A type with all properties of T made immutable recursively.
|
|
65
|
-
*/
|
|
66
|
-
type ImmutableObjectDeep<T> = { readonly [K in keyof T]: Immutable<T[K]> };
|
|
67
|
-
//#endregion
|
|
68
|
-
export { BooleanProps, Immutable, ImmutableArray, ImmutableMap, ImmutableObject, ImmutableObjectDeep, ImmutableSet, Mutable, MutableDeep };
|
|
69
|
-
//# sourceMappingURL=types-DvzdpbLu.d.cts.map
|
package/dist/types-yh4pOGEm.d.ts
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
//#region src/utils/types.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Creates a type that maps all properties of T to boolean.
|
|
4
|
-
*
|
|
5
|
-
* @template T - The type to map properties to boolean.
|
|
6
|
-
* @returns A type with all properties of T mapped to boolean.
|
|
7
|
-
*/
|
|
8
|
-
type BooleanProps<T> = { [Property in keyof T]: boolean };
|
|
9
|
-
/**
|
|
10
|
-
* Creates a type that makes all properties of T mutable.
|
|
11
|
-
*
|
|
12
|
-
* @template T - The type to make properties mutable.
|
|
13
|
-
* @returns A type with all properties of T made mutable.
|
|
14
|
-
*/
|
|
15
|
-
type Mutable<T> = { -readonly [K in keyof T]: T[K] };
|
|
16
|
-
/**
|
|
17
|
-
* Creates a type that makes all properties of T mutable recursively.
|
|
18
|
-
*
|
|
19
|
-
* @template T - The type to make properties mutable recursively.
|
|
20
|
-
* @returns A type with all properties of T made mutable recursively.
|
|
21
|
-
*/
|
|
22
|
-
type MutableDeep<T> = { -readonly [K in keyof T]: Mutable<T[K]> };
|
|
23
|
-
type ImmutablePrimitive = undefined | null | boolean | string | number | Function;
|
|
24
|
-
/**
|
|
25
|
-
* Creates a type that makes all properties of T immutable.
|
|
26
|
-
*
|
|
27
|
-
* @template T - The type to make properties immutable.
|
|
28
|
-
* @returns A type with all properties of T made immutable.
|
|
29
|
-
*/
|
|
30
|
-
type Immutable<T> = T extends ImmutablePrimitive ? T : T extends Array<infer U> ? ImmutableArray<U> : T extends Map<infer K, infer V> ? ImmutableMap<K, V> : T extends Set<infer M> ? ImmutableSet<M> : ImmutableObject<T>;
|
|
31
|
-
/**
|
|
32
|
-
* Creates a type that makes all properties of T immutable in an array.
|
|
33
|
-
*
|
|
34
|
-
* @template T - The type to make properties immutable in an array.
|
|
35
|
-
* @returns A type with all properties of T made immutable in an array.
|
|
36
|
-
*/
|
|
37
|
-
type ImmutableArray<T> = ReadonlyArray<Immutable<T>>;
|
|
38
|
-
/**
|
|
39
|
-
* Creates a type that makes all properties of T immutable in a map.
|
|
40
|
-
*
|
|
41
|
-
* @template K - The key type of the map.
|
|
42
|
-
* @template V - The value type of the map.
|
|
43
|
-
* @returns A type with all properties of T made immutable in a map.
|
|
44
|
-
*/
|
|
45
|
-
type ImmutableMap<K, V> = ReadonlyMap<Immutable<K>, Immutable<V>>;
|
|
46
|
-
/**
|
|
47
|
-
* Creates a type that makes all properties of T immutable in a set.
|
|
48
|
-
*
|
|
49
|
-
* @template T - The type to make properties immutable in a set.
|
|
50
|
-
* @returns A type with all properties of T made immutable in a set.
|
|
51
|
-
*/
|
|
52
|
-
type ImmutableSet<T> = ReadonlySet<Immutable<T>>;
|
|
53
|
-
/**
|
|
54
|
-
* Creates a type that makes all properties of T immutable.
|
|
55
|
-
*
|
|
56
|
-
* @template T - The type to make properties immutable.
|
|
57
|
-
* @returns A type with all properties of T made immutable.
|
|
58
|
-
*/
|
|
59
|
-
type ImmutableObject<T> = { readonly [K in keyof T]: T[K] };
|
|
60
|
-
/**
|
|
61
|
-
* Creates a type that makes all properties of T immutable recursively.
|
|
62
|
-
*
|
|
63
|
-
* @template T - The type to make properties immutable recursively.
|
|
64
|
-
* @returns A type with all properties of T made immutable recursively.
|
|
65
|
-
*/
|
|
66
|
-
type ImmutableObjectDeep<T> = { readonly [K in keyof T]: Immutable<T[K]> };
|
|
67
|
-
//#endregion
|
|
68
|
-
export { BooleanProps, Immutable, ImmutableArray, ImmutableMap, ImmutableObject, ImmutableObjectDeep, ImmutableSet, Mutable, MutableDeep };
|
|
69
|
-
//# sourceMappingURL=types-yh4pOGEm.d.ts.map
|
package/dist/utils/index.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { BooleanProps, Immutable, ImmutableArray, ImmutableMap, ImmutableObject, ImmutableObjectDeep, ImmutableSet, Mutable, MutableDeep } from "../types-yh4pOGEm.js";
|
|
2
|
-
import { IJsonSerializer, ILogger, ILoggerOptions, IPerformanceTimer, LogLevel, PerformanceTimeEntry, PerformanceTimerUid } from "../index-oenqxDCa.js";
|
|
3
|
-
export { BooleanProps, IJsonSerializer, ILogger, ILoggerOptions, IPerformanceTimer, Immutable, ImmutableArray, ImmutableMap, ImmutableObject, ImmutableObjectDeep, ImmutableSet, LogLevel, Mutable, MutableDeep, PerformanceTimeEntry, PerformanceTimerUid };
|