entities library
Shared field definitions and schema helpers for typed entities.
Import this library when a feature needs reusable field metadata that can be shared across forms, validation, and persistence flows.
Classes
-
DraftModeEntityField<
TEntity, TValue> - Entity-aware field definition that can extract a value from a typed object.
-
DraftModeEntitySchema<
TEntity> - Reusable schema that validates a typed object through shared fields.
-
DraftModeEntityValidationContext<
TEntity> - Validation context that lets one entity field inspect sibling entity fields.
-
DraftModeEntityValidationFailure<
TEntity> - Validation failure produced when an entity violates one field contract.
-
DraftModeFieldDefinition<
T> - Reusable field definition that keeps field-level metadata in one place.
- DraftModeValidationDependencyContext
- Extended validation context that can optionally track dependencies.
- DraftModeValidationValueContext
- Context used by reusable validation contracts to inspect related values without depending on a specific runtime like forms or repositories.
Exceptions / Errors
-
DraftModeEntityValidationException<
TEntity> - Exception raised when repository/storage validation fails.