import { CustomFieldInputProps } from './CustomFieldInputProps'; import { CustomFieldMetaProps } from './CustomFieldMetaProps'; import { NormalizationFunction } from '../Normalization/NormalizationFunction'; import { ValidationFunction } from '../Validation/ValidationFunction'; export interface useStandardFieldProps { /** Id of the field. */ id?: string; /** Name of the field. */ name: string; /** Whether the field should be disabled. */ disabled?: boolean; /** Function to validate the field. */ validate?: ValidationFunction | ValidationFunction[]; /** Function to modify the field value without making the form dirty. (e.g. phone number) */ normalize?: NormalizationFunction; } /** Provides a consistent way to deal with all form fields (non array). */ export default function useStandardField({ id: providedId, name: providedName, disabled, validate, normalize, }: useStandardFieldProps): [ CustomFieldInputProps, CustomFieldMetaProps ];