import * as React from 'react'; import { FormikHelpers, FormikProps, FormikSharedConfig, FormikValues, FormikTouched, FormikErrors } from './types'; /** * State, handlers, and helpers injected as props into the wrapped form component. * Used with withFormik() * * @deprecated Use `OuterProps & FormikProps` instead. */ export declare type InjectedFormikProps = Props & FormikProps; /** * Formik helpers + { props } */ export declare type FormikBag = { props: P; } & FormikHelpers; /** * withFormik() configuration options. Backwards compatible. */ export interface WithFormikConfig extends FormikSharedConfig { /** * Set the display name of the component. Useful for React DevTools. */ displayName?: string; /** * Submission handler */ handleSubmit: (values: Values, formikBag: FormikBag) => void; /** * Map props to the form values */ mapPropsToValues?: (props: Props) => Values; /** * Map props to the form status */ mapPropsToStatus?: (props: Props) => any; /** * Map props to the form touched state */ mapPropsToTouched?: (props: Props) => FormikTouched; /** * Map props to the form errors state */ mapPropsToErrors?: (props: Props) => FormikErrors; /** * @deprecated in 0.9.0 (but needed to break TS types) */ mapValuesToPayload?: (values: Values) => DeprecatedPayload; /** * A Yup Schema or a function that returns a Yup schema */ validationSchema?: any | ((props: Props) => any); /** * Validation function. Must return an error object or promise that * throws an error object where that object keys map to corresponding value. */ validate?: (values: Values, props: Props) => void | object | Promise; } export declare type CompositeComponent

= React.ComponentClass

| React.StatelessComponent

; export interface ComponentDecorator { (component: CompositeComponent): React.ComponentType; } export interface InferableComponentDecorator { >(component: T): T; } /** * A public higher-order component to access the imperative API */ export declare function withFormik({ mapPropsToValues, ...config }: WithFormikConfig): ComponentDecorator>;