import PropTypes from 'prop-types'; import React from 'react'; import { FormsyContextInterface, IModel, InputComponent, IResetModel, IUpdateInputsWithError, IUpdateInputsWithValue, ValidationError } from './interfaces'; import { PassDownProps } from './withFormsy'; declare type FormHTMLAttributesCleaned = Omit, 'onChange' | 'onSubmit'>; declare type OnSubmitCallback = (model: IModel, resetModel: IResetModel, updateInputsWithError: IUpdateInputsWithError, event: React.SyntheticEvent>) => void; declare type FormElementType = string | React.ComponentType<{ onReset?: (e: React.SyntheticEvent) => void; onSubmit?: (e: React.SyntheticEvent) => void; disabled?: boolean; children?: React.ReactChildren; }>; export interface FormsyProps extends FormHTMLAttributesCleaned { disabled: boolean; mapping: null | ((model: IModel) => IModel); onChange: (model: IModel, isChanged: boolean) => void; onInvalid: () => void; onReset?: () => void; onSubmit?: OnSubmitCallback; onValidSubmit?: OnSubmitCallback; onInvalidSubmit: OnSubmitCallback; onValid: () => void; preventDefaultSubmit?: boolean; preventExternalInvalidation?: boolean; validationErrors?: null | object; formElement?: FormElementType; } export interface FormsyState { canChange: boolean; contextValue: FormsyContextInterface; formSubmitted?: boolean; isPristine?: boolean; isSubmitting: boolean; isValid: boolean; } export declare class Formsy extends React.Component { inputs: InstanceType>[]; emptyArray: any[]; prevInputNames: any[] | null; static displayName: string; static propTypes: { disabled: PropTypes.Requireable; mapping: PropTypes.Requireable<(...args: any[]) => any>; formElement: PropTypes.Requireable; onChange: PropTypes.Requireable<(...args: any[]) => any>; onInvalid: PropTypes.Requireable<(...args: any[]) => any>; onInvalidSubmit: PropTypes.Requireable<(...args: any[]) => any>; onReset: PropTypes.Requireable<(...args: any[]) => any>; onSubmit: PropTypes.Requireable<(...args: any[]) => any>; onValid: PropTypes.Requireable<(...args: any[]) => any>; onValidSubmit: PropTypes.Requireable<(...args: any[]) => any>; preventDefaultSubmit: PropTypes.Requireable; preventExternalInvalidation: PropTypes.Requireable; validationErrors: PropTypes.Requireable; }; static defaultProps: Partial; private readonly throttledValidateForm; constructor(props: FormsyProps); componentDidMount: () => void; componentDidUpdate: (prevProps: FormsyProps) => void; getCurrentValues: () => any; getModel: () => any; getPristineValues: () => any; setFormPristine: (isPristine: boolean) => void; setInputValidationErrors: (errors: any) => void; setFormValidState: (allIsValid: boolean) => void; isValidValue: (component: any, value: any) => boolean; isFormDisabled: () => boolean; mapModel: (model: IModel) => IModel; reset: (model?: IModel) => void; private resetInternal; private resetModel; runValidation: (component: InputComponent, value?: V) => { isRequired: boolean; isValid: boolean; validationError: ValidationError[]; }; attachToForm: (component: any) => void; detachFromForm: (component: InputComponent) => void; isChanged: () => boolean; submit: (event?: React.SyntheticEvent) => void; updateInputsWithError: IUpdateInputsWithError; updateInputsWithValue: IUpdateInputsWithValue; validate: (component: InputComponent) => void; validateForm: () => void; render(): React.FunctionComponentElement>; } export {};