import type { FieldProps } from 'formik'; import type React from 'react'; import type { IValidationCategory, IValidator } from '../validation'; /** * These props are used by controlled components, such as or Input components like TextInput * Some of the typings reference the typings supplied by formik FieldProps */ export interface IControlledInputProps { value: FieldProps['field']['value']; onChange(e: React.ChangeEvent): void; onBlur: FieldProps['field']['onBlur']; name: FieldProps['field']['name']; } export type Omit = Pick>; export type OmitControlledInputPropsFrom = Omit; /** These props are used by Input components, such as TextInput */ export interface IFormInputValidation { touched: boolean; hidden: boolean; category: IValidationCategory | undefined; messageNode: React.ReactNode | undefined; revalidate: () => void; addValidator: (validator: IValidator) => void; removeValidator: (validator: IValidator) => void; } /** These props are used by Form Input components, such as TextInput */ export interface IFormInputProps extends Partial { validation?: IFormInputValidation; inputClassName?: string; }