Skip to content

Interface: ValidationRegistry

API / @xmachines/play-dom / ValidationRegistry

Defined in: @xmachines/json-render-dom

Registry of validated fields for one rendered tree.

Properties

PropertyModifierTypeDescriptionDefined in
clearpublic(path) => voidForget a field’s recorded state; the registration itself survives.-
customFunctionsreadonlyRecord<string, ValidationFunction>Custom validation functions available to every check.-
fieldStatesreadonlyRecord<string, FieldValidationState>Validation state by field state path.-
registerFieldpublic(path, config) => voidRegister (or update) a field’s validation config. Called by component implementations during render, normally via ctx.validation. Registrations are reference-counted per path: two elements bound to the same state path each hold one, so one of them going away does not un-validate the other.-
releaseFieldpublic(path) => voidDrop one reference to a field’s registration, keeping its recorded state. The registration itself goes away once the last reference is released. This is what the render context’s per-element cleanup calls: an element instance releases its registrations when it unmounts or before it re-renders, and fieldStates survives — matching the framework ValidationProvider, whose field states outlive a re-render.-
touchpublic(path) => voidMark a field as interacted with, without validating it.-
unregisterFieldpublic(path) => voidDrop a field’s registration entirely, references and recorded state.-
validatepublic(path, config?) => ValidationResultValidate one field against the live store snapshot and record the result. Uses the field’s registered config unless one is passed explicitly.-
validateAllpublic() => booleanValidate every registered field. Returns true when all are valid.-