FieldModule

PackageReified.Schema
Functions for inspecting schema field metadata.

Summary

NameSignatureSynopsis
createField.create externalName getter valueCreates a standalone typed schema field from a boundary-facing name, a trusted-model getter, and a trusted value schema.
externalNameField.externalName fieldReturns the boundary-facing name for a schema field.
orderField.order fieldReturns the zero-based field order used for trusted construction and ordered interpreter output.
getValueField.getValue field modelReads a schema field value from an existing trusted model.
constraintsField.constraints fieldReturns the constraint descriptions attached to a schema field, in declaration order.
supplyField.supply fieldReturns the boundary supply declaration attached to a schema field, when one was made.
withConstraintField.withConstraint constraint' fieldReturns a schema field with additional portable constraint metadata appended in declaration order.
withConstraintsField.withConstraints constraints fieldReturns a schema field that also requires every supplied constraint, in declaration order.

create

Field.create externalName getter value
Member
Creates a standalone typed schema field from a boundary-facing name, a trusted-model getter, and a trusted value schema.

Parameters

NameTypeDescription
externalNamestring
getter'model -> 'value
valueSchema<'value>

Returns

Field<'model, 'value>

externalName

Field.externalName field
Member
Returns the boundary-facing name for a schema field.

Parameters

NameTypeDescription
fieldField<'model, 'value>

Returns

ExternalFieldName

order

Field.order field
Member
Returns the zero-based field order used for trusted construction and ordered interpreter output.

Parameters

NameTypeDescription
fieldField<'model, 'value>

Returns

FieldOrder

getValue

Field.getValue field model
Member
Reads a schema field value from an existing trusted model.

Parameters

NameTypeDescription
fieldField<'model, 'value>
model'model

Returns

'value

constraints

Field.constraints field
Member
Returns the constraint descriptions attached to a schema field, in declaration order.

Parameters

NameTypeDescription
fieldField<'model, 'value>

Returns

ConstraintDescription list

supply

Field.supply field
Member
Returns the boundary supply declaration attached to a schema field, when one was made.

Parameters

NameTypeDescription
fieldField<'model, 'value>

Returns

Supply option

withConstraint

Field.withConstraint constraint' field
Member
Returns a schema field with additional portable constraint metadata appended in declaration order.

Parameters

NameTypeDescription
constraint'Constraint<'value>
fieldField<'model, 'value>

Returns

Field<'model, 'value>

withConstraints

Field.withConstraints constraints field
Member
Returns a schema field that also requires every supplied constraint, in declaration order.

Parameters

NameTypeDescription
constraintsConstraint<'value> list
fieldField<'model, 'value>

Returns

Field<'model, 'value>