@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,3 @@
|
|
|
1
|
-
import { n as Immutable } from "./types-DLOd2zXO.cjs";
|
|
2
|
-
|
|
3
1
|
//#region src/components/component.d.ts
|
|
4
2
|
type ComponentTypeUid = string | number;
|
|
5
3
|
/**
|
|
@@ -169,8 +167,9 @@ type EntityUid = string | number;
|
|
|
169
167
|
/**
|
|
170
168
|
* Represents the core identification and initialization data for an entity.
|
|
171
169
|
* @template TProxyTypes - A readonly array of entity type IDs that must be provided as proxies when creating an entity.
|
|
170
|
+
* When non-empty, the `proxies` property is required on the model.
|
|
172
171
|
*/
|
|
173
|
-
|
|
172
|
+
type IEntityModel<TProxyTypes extends readonly EntityTypeUid[] = readonly []> = {
|
|
174
173
|
/**
|
|
175
174
|
* The unique identifier for this entity instance.
|
|
176
175
|
*/
|
|
@@ -181,12 +180,11 @@ interface IEntityModel<TProxyTypes extends readonly EntityTypeUid[] = undefined>
|
|
|
181
180
|
* child entities inherit from their parent via addEntity().
|
|
182
181
|
*/
|
|
183
182
|
readonly scopeId?: string;
|
|
184
|
-
|
|
185
|
-
* Optional array of proxies (references) to other entities.
|
|
186
|
-
* Used to establish relationships at entity creation time.
|
|
187
|
-
*/
|
|
183
|
+
} & (TProxyTypes extends readonly [] ? {
|
|
188
184
|
readonly proxies?: RequiredProxies<TProxyTypes>;
|
|
189
|
-
}
|
|
185
|
+
} : {
|
|
186
|
+
readonly proxies: RequiredProxies<TProxyTypes>;
|
|
187
|
+
});
|
|
190
188
|
/**
|
|
191
189
|
* The core entity interface representing a composition of components and relationships.
|
|
192
190
|
* Entities are immutable containers that store data (components) and maintain relationships (proxies) to other entities.
|
|
@@ -212,6 +210,74 @@ interface IEntity {
|
|
|
212
210
|
readonly myProxy: Readonly<EntityProxy<this>>;
|
|
213
211
|
}
|
|
214
212
|
//#endregion
|
|
213
|
+
//#region src/utils/types.d.ts
|
|
214
|
+
/**
|
|
215
|
+
* Maps all properties of a type to boolean flags.
|
|
216
|
+
* Useful for feature flags, capability indicators, or boolean option sets.
|
|
217
|
+
*
|
|
218
|
+
* @template T - The type whose properties are mapped to booleans.
|
|
219
|
+
* @example type Features = BooleanProps<{health: any; armor: any}>; // => {health: boolean, armor: boolean}
|
|
220
|
+
*/
|
|
221
|
+
type BooleanProps<T> = { [Property in keyof T]: boolean };
|
|
222
|
+
/**
|
|
223
|
+
* Removes readonly modifiers from all properties, making them mutable.
|
|
224
|
+
* One level of immutability removal (see MutableDeep for recursive removal).
|
|
225
|
+
*
|
|
226
|
+
* @template T - The type to make mutable.
|
|
227
|
+
* @example type Mut = Mutable<{readonly x: number}>; // => {x: number}
|
|
228
|
+
*/
|
|
229
|
+
type Mutable<T> = { -readonly [K in keyof T]: T[K] };
|
|
230
|
+
/**
|
|
231
|
+
* Recursively removes readonly modifiers from all properties at all nesting levels.
|
|
232
|
+
* Makes entire object graph mutable.
|
|
233
|
+
*
|
|
234
|
+
* @template T - The type to make mutable recursively.
|
|
235
|
+
*/
|
|
236
|
+
type MutableDeep<T> = { -readonly [K in keyof T]: Mutable<T[K]> };
|
|
237
|
+
type ImmutablePrimitive = undefined | null | boolean | string | number | Function;
|
|
238
|
+
/**
|
|
239
|
+
* Makes a type fully immutable at the top level only.
|
|
240
|
+
* Primitives and functions remain unchanged.
|
|
241
|
+
* Collections (Array, Map, Set) become readonly.
|
|
242
|
+
* Objects have their properties made readonly.
|
|
243
|
+
*
|
|
244
|
+
* @template T - The type to make immutable.
|
|
245
|
+
* @example type Imm = Immutable<{x: number}>; // => {readonly x: number}
|
|
246
|
+
*/
|
|
247
|
+
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>;
|
|
248
|
+
/**
|
|
249
|
+
* Readonly array variant for use in Immutable type transformation.
|
|
250
|
+
*
|
|
251
|
+
* @template T - Element type of the array.
|
|
252
|
+
*/
|
|
253
|
+
type ImmutableArray<T> = ReadonlyArray<Immutable<T>>;
|
|
254
|
+
/**
|
|
255
|
+
* Readonly map variant for use in Immutable type transformation.
|
|
256
|
+
*
|
|
257
|
+
* @template K - Key type of the map.
|
|
258
|
+
* @template V - Value type of the map.
|
|
259
|
+
*/
|
|
260
|
+
type ImmutableMap<K, V> = ReadonlyMap<Immutable<K>, Immutable<V>>;
|
|
261
|
+
/**
|
|
262
|
+
* Readonly set variant for use in Immutable type transformation.
|
|
263
|
+
*
|
|
264
|
+
* @template T - Element type of the set.
|
|
265
|
+
*/
|
|
266
|
+
type ImmutableSet<T> = ReadonlySet<Immutable<T>>;
|
|
267
|
+
/**
|
|
268
|
+
* Makes all object properties readonly (one level only).
|
|
269
|
+
*
|
|
270
|
+
* @template T - The type to make immutable.
|
|
271
|
+
*/
|
|
272
|
+
type ImmutableObject<T> = { readonly [K in keyof T]: T[K] };
|
|
273
|
+
/**
|
|
274
|
+
* Recursively makes all properties readonly at all nesting levels.
|
|
275
|
+
* Provides complete immutability guarantee for the entire object graph.
|
|
276
|
+
*
|
|
277
|
+
* @template T - The type to make deeply immutable.
|
|
278
|
+
*/
|
|
279
|
+
type ImmutableObjectDeep<T> = { readonly [K in keyof T]: Immutable<T[K]> };
|
|
280
|
+
//#endregion
|
|
215
281
|
//#region src/components/identity-component.d.ts
|
|
216
282
|
/**
|
|
217
283
|
* The `BasicComponentType` enum defines the types of basic components available.
|
|
@@ -250,5 +316,5 @@ interface IdentityComponent<TModel extends IEntityModel> extends IComponent {
|
|
|
250
316
|
readonly lastUpdated?: Date;
|
|
251
317
|
}
|
|
252
318
|
//#endregion
|
|
253
|
-
export {
|
|
254
|
-
//# sourceMappingURL=identity-component-
|
|
319
|
+
export { IComponent as S, IEntityProxy as _, ImmutableArray as a, TypedEntityProxy as b, ImmutableObjectDeep as c, MutableDeep as d, EntityTypeUid as f, EntityProxy as g, IEntityModel as h, Immutable as i, ImmutableSet as l, IEntity as m, IdentityComponent as n, ImmutableMap as o, EntityUid as p, BooleanProps as r, ImmutableObject as s, BasicComponentType as t, Mutable as u, IEntityProxyRepository as v, ComponentTypeUid as x, RequiredProxies as y };
|
|
320
|
+
//# sourceMappingURL=identity-component-DLDaOTyK.d.cts.map
|