Editor model · type

FieldKind

What a field is, derived from its declared type rather than from what a read returned.

type FieldKind = 'number' | 'integer' | 'boolean' | 'text' | 'entity' | 'enum'
import type { FieldKind } from '@driftengine/editor';

In depth

A read cannot tell them apart: bool arrives as 0 or 1, an enum: discriminant as an integer, and an Entity as a number. The declaration can, and it is what a panel needs to know whether to draw a checkbox, a stepper or a menu.