import { ReactNode } from 'react'; import { FormSubscription } from 'final-form'; export interface FormDataConsumerRenderParams { formData: any; scopedFormData?: any; getSource?: (source: string) => string; } export declare type FormDataConsumerRender = (params: FormDataConsumerRenderParams) => ReactNode; interface ConnectedProps { children: FormDataConsumerRender; form?: string; record?: any; source?: string; subscription?: FormSubscription; [key: string]: any; } interface Props extends ConnectedProps { formData: any; index?: number; } /** * Get the current (edited) value of the record from the form and pass it * to a child function * * @example * * const PostEdit = (props) => ( * * * * * {({ formData, ...rest }) => formData.hasEmail && * * } * * * * ); * * @example * * const OrderEdit = (props) => ( * * * * * {({ formData, ...rest }) => * * } * * * * ); */ declare const FormDataConsumer: ({ subscription, ...props }: ConnectedProps) => JSX.Element; export declare const FormDataConsumerView: (props: Props) => any; export default FormDataConsumer;