Skip to content

Commit cfd3ea2

Browse files
committed
refactor(entity): update symbol brands for EntityId
1 parent 9f82912 commit cfd3ea2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/entity.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/**
2-
* Brand for EntityId to create nominal typing with component type information
2+
* Unique symbol brand for associating component type information with EntityId
33
*/
4-
declare const __entityIdBrand: unique symbol;
4+
declare const __componentTypeMarker: unique symbol;
55

66
/**
7-
* Brand for EntityId type information
7+
* Unique symbol brand for tagging the kind of EntityId (e.g., 'component', 'entity-relation')
88
*/
9-
declare const __entityIdTypeBrand: unique symbol;
9+
declare const __entityIdTypeTag: unique symbol;
1010

1111
/**
1212
* Entity ID type for ECS architecture
@@ -16,8 +16,8 @@ declare const __entityIdTypeBrand: unique symbol;
1616
* - Relation IDs: negative numbers encoding component and entity associations
1717
*/
1818
export type EntityId<T = void, U = unknown> = number & {
19-
readonly [__entityIdBrand]: T;
20-
readonly [__entityIdTypeBrand]: U;
19+
readonly [__componentTypeMarker]: T;
20+
readonly [__entityIdTypeTag]: U;
2121
};
2222

2323
export type ComponentId<T = void> = EntityId<T, "component">;

0 commit comments

Comments
 (0)