API REFERENCE

ValidationRule

Fields, allowed values, and APIs that use ValidationRule.

Type definition

A question mark (?) marks an optional field; readonly marks a value you should not change directly. A union (|) accepts one of the listed forms. Functions are callbacks that Grid invokes at the relevant point.

typescript
export interface ValidationRule {
  field: string;
  type: ValidationRuleType;
  value?: unknown;
  value2?: unknown;
  values?: readonly unknown[];
  pattern?: string;
  validator?: (value: unknown, data: Record<string, unknown>) => boolean | string;
  message?: string;
}

APIs using this type