import { ReferableValue } from '../components/syncField/EntityReference'; import { Entity } from '../api/types'; /** * A validator function is receives a value and returns an error as a string or undefined when there is no error * * value is undefined when not contained at entity * value is null when set to null */ export interface ValidatorFunction { (value: unknown): string | undefined; } export interface ValidationResult { hasError: boolean; error: string | undefined; } export interface ErrorReferences { [index: number]: ValidationResult; } /** * * @param entity * @param value * @param validate */ export declare function useDynamicValidation(entity: E, value: any, validate?: ReferableValue): ValidationResult;