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
| Property | Type | Description | Defined 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? | boolean | Determines whether this field is required or not. If a required fields is missing, the Document will throw when attempting to serialize it. Default false | cfds/base/schema.ts:99 |
type | T | The type this field defines. | cfds/base/schema.ts:77 |
validate? | (data) => boolean | A function that validates the field value. | cfds/base/schema.ts:106 |