@edirect/form-engine
Version:
Achieve form logic reusage with forms expressed in json format.
12 lines (11 loc) • 582 B
TypeScript
import { TErrorMessages, TErrors, TFieldData, TVAvailableValidations } from '../types.js';
type TRuleValue = string | number | boolean | undefined;
export interface ICustomValidationValue {
from: number;
to: number;
validations: Record<string, any>;
}
declare const run: (value: TRuleValue, rules: TVAvailableValidations, errorMessages?: TErrorMessages, formData?: TFieldData) => TErrors;
declare const generateCustomError: (name: string, message: string) => TErrors;
declare const hasError: (errors?: TErrors) => boolean;
export { run, generateCustomError, hasError };