UNPKG

@data-driven-forms/react-form-renderer

Version:

React Form Renderer. Data Driven Forms converts JSON form definitions into fully functional React forms.

32 lines (31 loc) 1.13 kB
import { ValidatorFunction } from '../validators'; import { ReactNode } from 'react'; interface ValidatorOptions { message?: ReactNode | ((arg: any) => ReactNode); } interface PatternOptions extends ValidatorOptions { pattern?: string | RegExp; flags?: string; } export declare const required: ValidatorFunction; export declare const length: ValidatorFunction; export declare const pattern: ValidatorFunction; export declare const numericality: ValidatorFunction; type DataType = 'string' | 'integer' | 'boolean' | 'number' | 'float'; export declare const dataTypeValidator: (type: DataType) => ((options?: ValidatorOptions) => Promise<any> | ReactNode | { type: "warning"; error: any; }) | ((options?: PatternOptions) => Promise<any> | ReactNode | { type: "warning"; error: any; }) | ((options?: ValidatorOptions) => Promise<any> | ReactNode | { type: "warning"; error: any; }) | ((options?: PatternOptions) => Promise<any> | ReactNode | { type: "warning"; error: any; }) | ((options?: PatternOptions) => Promise<any> | ReactNode | { type: "warning"; error: any; }); export {};