File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ declare const __entityIdTypeTag: unique symbol;
1717 * - Entity IDs: 1024+
1818 * - Relation IDs: negative numbers encoding component and entity associations
1919 */
20- export type EntityId < T = void , U = unknown > = number & {
20+ export type EntityId < T = unknown , U = unknown > = number & {
2121 readonly [ __componentTypeMarker ] : T ;
2222 readonly [ __entityIdTypeTag ] : U ;
2323} ;
Original file line number Diff line number Diff line change @@ -157,13 +157,13 @@ export class World {
157157 * Create a new entity
158158 * @returns The ID of the newly created entity
159159 */
160- new ( ) : EntityId {
160+ new < T = void > ( ) : EntityId < T > {
161161 const entityId = this . entityIdManager . allocate ( ) ;
162162 // Create empty archetype for entities with no components
163163 let emptyArchetype = this . ensureArchetype ( [ ] ) ;
164164 emptyArchetype . addEntity ( entityId , new Map ( ) ) ;
165165 this . entityToArchetype . set ( entityId , emptyArchetype ) ;
166- return entityId ;
166+ return entityId as EntityId < T > ;
167167 }
168168
169169 /**
You can’t perform that action at this time.
0 commit comments