Optional
validatorThe ValidatorType used by the ValidatorFactory. Leave it null or undefined to use the built-in Validator class.
Optional
errorProvides the error code associated with this instance. When unassigned, the Validator uses the ConditionType as the error code.
ConditionConfig that allows the ConditionFactory to provide the Condition. Like all Configs in this system, this is expected to be immutable. Only use this when ConditionCreator is null.
Optional
conditionUse to create the Condition instance yourself, especially to support
implementations of ICondition that don't implement IConditionCore
Optional
enabledWhen false, validation is never run. This supersedes the Enabler too. Values:
Optional
severityResolves the Severity for when the Condition evaluates as NoMatch. Values:
Optional
errorThe error message "template" that will appear on screen when the condition is NoMatch. It can use tokens, which are resolved with current data at the time of validation. Tokens are resolved with Services.MessageTokenResolver. It should already be localized, except for the tokens. It can contain HTML tags if the platform supports them. In that case, be sure to use HTML encoded characters. The string shown to the actual user is stored in ValueHostInstanceState.errorMessage. Values:
Optional
errorLocalization key for errorMessage. Its value will be matched to an entry made to ValidationServices.TextLocalizerService, specific to the active culture. If setup and no entry was found in TextLocalizerService, the value from the errorMessage property is used.
Optional
summaryVariation of the errorMessage intended to be displayed in a Validation Summary area. A summary is usually not near the field with the error. As a result, it helps to shape the message differently, usually by including the Label token. "{Label} is required." Values:
Optional
summaryLocalization key for summaryMessage. Its value will be matched to an entry made to ValidationServices.TextLocalizerService, specific to the active culture. If setup and no entry was found in TextLocalizerService, the value from the errorMessage property is used.
Generated using TypeDoc v0.25.12
Just the data that is used to describe one validator assigned to a ValueHost. It should not contain any supporting functions or services. It should be generatable from JSON, and simply gets typed to ValidatorConfig. This provides the backing data for each ValidatorInfo. When placed into the ValidatorInfo, it is treated as immutable and can be used as state in React. The server side could in fact supply this object via JSON, allowing the server's Model to dictate this. However, there are sometimes cases a business rule is client side only (parser error converting "abc" to number) and times when a business rule is server side only (looking for injection attacks for the purpose of logging and blocking.)
NOTE: extensions of this interface can implement IDisposable knowing that the Validator will call dispose() if supplied, during its own disposal.