FieldModule
PackageReified.Schema
Functions for inspecting schema field metadata.
Summary
| Name | Signature | Synopsis |
|---|---|---|
| create | Field.create externalName getter value | Creates a standalone typed schema field from a boundary-facing name, a trusted-model getter, and a trusted value schema. |
| externalName | Field.externalName field | Returns the boundary-facing name for a schema field. |
| order | Field.order field | Returns the zero-based field order used for trusted construction and ordered interpreter output. |
| getValue | Field.getValue field model | Reads a schema field value from an existing trusted model. |
| constraints | Field.constraints field | Returns the constraint descriptions attached to a schema field, in declaration order. |
| supply | Field.supply field | Returns the boundary supply declaration attached to a schema field, when one was made. |
| withConstraint | Field.withConstraint constraint' field | Returns a schema field with additional portable constraint metadata appended in declaration order. |
| withConstraints | Field.withConstraints constraints field | Returns a schema field that also requires every supplied constraint, in declaration order. |
Creates a standalone typed schema field from a boundary-facing name, a trusted-model getter, and a trusted
value schema.
Parameters
| Name | Type | Description |
|---|---|---|
| externalName | string | |
| getter | 'model -> 'value | |
| value | Schema<'value> |
Returns
Field<'model, 'value>
Returns the boundary-facing name for a schema field.
Parameters
| Name | Type | Description |
|---|---|---|
| field | Field<'model, 'value> |
Returns
ExternalFieldName
Returns the zero-based field order used for trusted construction and ordered interpreter output.
Parameters
| Name | Type | Description |
|---|---|---|
| field | Field<'model, 'value> |
Returns
FieldOrder
Reads a schema field value from an existing trusted model.
Parameters
| Name | Type | Description |
|---|---|---|
| field | Field<'model, 'value> | |
| model | 'model |
Returns
'value
Returns the constraint descriptions attached to a schema field, in declaration order.
Parameters
| Name | Type | Description |
|---|---|---|
| field | Field<'model, 'value> |
Returns
ConstraintDescription list
Returns the boundary supply declaration attached to a schema field, when one was made.
Parameters
| Name | Type | Description |
|---|---|---|
| field | Field<'model, 'value> |
Returns
Supply option
Returns a schema field with additional portable constraint metadata appended in declaration order.
Parameters
| Name | Type | Description |
|---|---|---|
| constraint' | Constraint<'value> | |
| field | Field<'model, 'value> |
Returns
Field<'model, 'value>