Represents a pre-parsed Entity field
Examples:
Array<MyEnum.A> will result in:
Array<MyEnum.A>
{ type: "Enum", value: "A", ref: MyEnum }
Where MyEnum is not an identifier, but a reference to the Enum:
MyEnum
const entity = layer.entities[0]; entity.fields["enum_field"].ref.uid // you can access the enum properties
Having all the field interfaces in a union allows narrowing a generic field type down to a specific field type:
const field: Field = // ... if (field.type === FieldType.Int) { // value has type `number | null` const value = field.value; }
Generated using TypeDoc
Represents a pre-parsed Entity field
Examples:
Array<MyEnum.A>
will result in:Where
MyEnum
is not an identifier, but a reference to the Enum:Having all the field interfaces in a union allows narrowing a generic field type down to a specific field type: