import { FormikErrors } from 'formik'; import { SetStateAction } from 'react'; export function isErrorType( error: string | FormikErrors | undefined ): error is FormikErrors { return error !== undefined && typeof error !== 'string'; } export function isArrayErrorType( error: | string[] | FormikErrors[] | string | undefined | (FormikErrors | undefined)[] ): error is FormikErrors[] { return error !== undefined && typeof error !== 'string'; } export interface FieldsetValues { values: TFieldset; errors?: FormikErrors; } export type SetFieldValue = ( field: keyof TFieldset, value: TField ) => void; export type SetValues = SetStateAction; export type OnChange = (value: TFieldset) => void;