import type { ActionFieldDef, FieldValidation } from './types'; import type { FieldIssue } from './server-error'; export interface ValidationSpec { required?: boolean; type?: string; regex?: string; min?: number; max?: number; custom?: string; options?: string[]; } /** Parse `required|min:2|email` or `required,min=2,max=100` or a custom slug. */ export declare function parseRuleString(s: string): ValidationSpec; /** Normalize ActionFieldDef.validation (object, laravel string, or `rules`). */ export declare function fieldValidationOf(field: ActionFieldDef | Record): FieldValidation; /** Evaluate spec against one value; collect every issue (not fail-fast). */ export declare function checkValue(value: unknown, spec: ValidationSpec): FieldIssue[]; /** Validate a form payload the way Laravel's Validator does: collect every * field issue, dotted keys for line-items (`items.0.qty`). */ export declare function validateValues(fields: readonly ActionFieldDef[], values: Record): Record; export declare function bagHasErrors(bag: Record): boolean; /** * Edit mode: drop the rule issues (regex/min/max/custom) of a top-level field * whose value is the one already persisted. The edit form posts every field * back, so a rule added after the row was written (an RFC pattern over legacy * data) would otherwise block saving a record over a field nobody touched. * Mirrors the kernel (dynamic.validateWrite grandfathers unchanged values on * update). required / invalid_option / invalid_type are kept. */ export declare function exemptUnchangedRuleIssues(bag: Record, values: Record, persisted: Record | null | undefined): Record; //# sourceMappingURL=validator.d.ts.map