Core Types
Core Types
Current core type:
export type ID = string | number;
Why ID Exists
ID is the base identity type for engine entities.
It is used anywhere the engine needs stable object identity:
- node ids
- layer/handle/module ids
- entity managers and maps
- selection/history/serialization links
Using a shared ID type keeps APIs consistent across the whole core.
Why string | number
numberis convenient for local runtime ids and counters.stringis convenient for external systems, database keys, UUIDs, and imported JSON.
This union allows both workflows without forcing converters in every subsystem.
Practical Rule
Choose one ID style per product layer and keep it stable:
- use
numberfor purely internal runtime pipelines - use
stringwhen ids come from external sources or need cross-system compatibility