import * as React from 'react'; import { LayoutType, ComponentValue } from '../types'; /** * Props coming from the `withFormsy` hoc. */ interface ExternalProps { errorMessage: any; hasValue: any; innerRef: any; isFormDisabled: boolean; isFormSubmitted: boolean; isPristine: boolean; isRequired: boolean; isValid: boolean; isValidValue: boolean; resetValue: any; setValidations: any; setValue: any; showError: boolean; showRequired: boolean; validationError: any; validationErrors: any; validations: any; } /** * Props that come from our components. */ interface RequiredFromOriginalComponentProps { validateBeforeSubmit: boolean; validatePristine: boolean; layout: LayoutType; name: string; value: ComponentValue; disabled: boolean; id: string; label: React.ReactNode; componentRef: React.RefObject; } /** * withFRC HOC * * This HOC provides shared code for our form components. * * We use this to merge props set using our FrcContext, so that * we can set commonly used props on an enclosing component. * * This allows us to set these properties 'as a whole' for each component in the * the form, while retaining the ability to override the prop on a per-component * basis. */ declare const withFRC: (Component: React.ComponentClass | React.FunctionComponent) => { new (props: TOriginalProps & ExternalProps & RequiredFromOriginalComponentProps): { render(): JSX.Element; context: any; setState(state: {} | ((prevState: Readonly<{}>, props: Readonly) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void; forceUpdate(callback?: (() => void) | undefined): void; readonly props: Readonly & Readonly<{ children?: React.ReactNode; }>; state: Readonly<{}>; refs: { [key: string]: React.ReactInstance; }; componentDidMount?(): void; shouldComponentUpdate?(nextProps: Readonly, nextState: Readonly<{}>, nextContext: any): boolean; componentWillUnmount?(): void; componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void; getSnapshotBeforeUpdate?(prevProps: Readonly, prevState: Readonly<{}>): any; componentDidUpdate?(prevProps: Readonly, prevState: Readonly<{}>, snapshot?: any): void; componentWillMount?(): void; UNSAFE_componentWillMount?(): void; componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void; UNSAFE_componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void; componentWillUpdate?(nextProps: Readonly, nextState: Readonly<{}>, nextContext: any): void; UNSAFE_componentWillUpdate?(nextProps: Readonly, nextState: Readonly<{}>, nextContext: any): void; }; displayName: string; contextType: React.Context<{ elementWrapperClassName: import("classnames/types").ClassValue; labelClassName: import("classnames/types").ClassValue; layout: LayoutType; rowClassName: import("classnames/types").ClassValue; validateBeforeSubmit: boolean; validatePristine: boolean; }>; }; export default withFRC;