Entities · interface
ComponentType
Explained in Entities.
interface ComponentTypeimport type { ComponentType } from '@driftengine/entities';Properties
| Name | Type | Description |
|---|---|---|
namereadonly | string | |
schemareadonly | Schema | |
idreadonly | number | A small dense integer, for indexing by component type in a query or a schedule.MoreAllocated in declaration order at module load, so it is the same on every run of the same code — and it is deliberately not what a scene is written with. A scene uses field ids, which survive a reorder; this survives nothing and is never stored. |
entityFieldsreadonly | readonly string[] | Fields typed Entity, which a scene load has to rewrite through its id map. |
defaultsreadonly | Readonly<Record<string, ComponentDefault>> | The value each field was declared with, by field name; a field with none is absent and starts
at zero, false or nothing.MoreRead wherever a field is not given: an entity added with some of its fields, a prefab that
names a few, a saved scene from before the field existed. A DriftScript component's come from
the module's metadata ( |