import type { Config, FormApi, SubmissionErrors } from 'final-form' import type { FC } from 'react' export { ISelectProps } from '../SelectField/SelectField' export interface IFormActionProps { isNew?: boolean submitLabel?: string cancelLabel?: string onCancel?: VoidFunction hideCancel?: boolean } export type DeepPartial = { [P in keyof T]?: T[P] extends object ? DeepPartial : T[P] } export type EditingFields = { [P in keyof T]?: T[P] extends object ? EditingFields : T[P] | string } export type AsyncValidate = Config['validate'] export type FormSubmitHandler = ( values: EditingFields, form: FormApi>, callback?: (errors?: SubmissionErrors) => void, ) => Promise | void export type FormResultHandler = (fields: F) => Promise interface IFormWrapperProps extends Partial< IFormActionProps & Omit>, 'onSubmit'> > { onResult: FormResultHandler initialValues: EditingFields } export type FormComponent = FC & P>