Skip to main content
zerotal

Documentation


Documentation / @zerotal/flow / index / ValidationRules

Type Alias: ValidationRules

ValidationRules = Record<string, (rule) => FieldRule>

Defined in: flow/src/validation.ts:26

A per-field rule map built with the framework validator's chain — the explicit-rules form of this.validate(...), mirroring the @validate decorator. Keys are field names; each value is a builder callback that turns the fluent RuleBuilder into a FieldRule.

Example

this.validate({
  name:  (rule) => rule.required().min(2).max(50),
  email: (rule) => rule.required().email(),
} satisfies ValidationRules);