import { CSSProperties, ElementType } from 'react'; import { FormikHelpers, FormikProps } from 'formik'; import { FieldProps } from '../Field/Field'; import { FieldArrayProps } from '../FieldArray/FieldArray'; import { ValidatedApiResult } from '../Validation/ValidatedApiResult'; export declare type FormBuilderProp = { Field: (props: FieldProps) => JSX.Element; FieldArray: (props: FieldArrayProps) => JSX.Element; }; export interface FullFormProps { /** The `` and `` components. */ children: (formBuilder: FormBuilderProp) => JSX.Element; /** Submission handler */ onSubmit: (formValues: TForm, formikBag: FormikHelpers) => Promise; /** Submission handler for forms that use [FormData](https://developer.mozilla.org/en-US/docs/Web/API/FormData).*/ onFormDataSubmit: (formValues: FormData, formikBag: FormikHelpers) => Promise; className?: string; style?: CSSProperties; /** Prevent the user from leaving the form if they have edited any field. This is presented as a JS `alert()`. */ ignoreLostChanges?: boolean; /** The intitial values of the form. */ initialValues?: TForm; /** A ref to the form element. */ innerRef?: React.Ref>; } declare type RequireAtLeastOne = Pick> & { [K in Keys]-?: Required> & Partial>>; }[Keys]; export declare type FormProps = RequireAtLeastOne, 'onSubmit' | 'onFormDataSubmit'>; /** Define a form. Uses [formik](https://formik.org/docs/overview). Usually contains many `` components. */ declare function Form({ children, className, style, ignoreLostChanges, onSubmit, onFormDataSubmit, initialValues, ...props }: FormProps): JSX.Element; declare namespace Form { var DisplayFormState: () => JSX.Element; } export default Form;