Skip to main content

Type Alias: FieldDef<T>

FieldDef<T> = object

Defined in: cfds/base/schema.ts:73

A definition of a single field in a schema.

Type Parameters

Type Parameter
T extends ValueType

Properties

PropertyTypeDescriptionDefined in
default?(data) => FieldValue<T>A default initializer. Used to create a default value when the field is missing.cfds/base/schema.ts:92
required?booleanDetermines whether this field is required or not. If a required fields is missing, the Document will throw when attempting to serialize it. Default falsecfds/base/schema.ts:99
typeTThe type this field defines.cfds/base/schema.ts:77
validate?(data) => booleanA function that validates the field value.cfds/base/schema.ts:106