import { ChangeEventHandler, ComponentType, FocusEventHandler, FunctionComponent, Ref } from 'react'; import { AsyncValidator, Validator } from '@gecogvidanto/shared'; import { ValidationEvent } from '../../hooks'; interface InnerElement extends Element { value: string; } interface VisibleFieldProps { id: string; onChange?: ChangeEventHandler; onBlur?: FocusEventHandler; } interface FieldProps extends VisibleFieldProps { inputRef: Ref; } interface Props extends VisibleFieldProps { label: string; validators?: Validator[]; asyncValidators?: AsyncValidator[]; onValidate?: (event: ValidationEvent) => void; disabled?: boolean; required?: boolean; fullWidth?: boolean; } export declare type ValidableFieldProps>, I extends InnerElement> = Props & Omit>; /** * Convert an input field into a validable field. * * @param Field - The fiels to convert. * @returns The validable field. */ export declare function buildValidableField>, I extends InnerElement>(Field: ComponentType): FunctionComponent>; export {};