FieldRule.ts 410 B

12345678910111213141516171819
  1. import ErrorMessageId from './ErrorMessageId';
  2. export enum RuleType {
  3. Required = 'required',
  4. Regex = 'regex',
  5. MaximumLength = 'maxLength',
  6. MinimumLength = 'minLength',
  7. }
  8. type RuleValue = string | boolean | number;
  9. type FieldRule = {
  10. type: RuleType;
  11. value: RuleValue;
  12. errorId?: ErrorMessageId;
  13. errorMessage?: string;
  14. errorExtraParams?: Record<string, unknown>;
  15. };
  16. export default FieldRule;