import * as React from 'react'; export interface BaseInputProps { /** * Event emitted once the value changes. */ onChange?(e: TEventArgs): void; /** * The currently displayed error message. */ error?: React.ReactChild; } export interface ValidatorProps { onSuccess?(): void; onError?(): void; } export interface ValidatorState { error: React.ReactChild | undefined; } /** * Provides automatic validation for a wrapped component. * @param validate The validation function. * @returns A constructor function taking a component to be wrapped with the validation. */ export declare function withValidation(validate: (e: TEventArgs) => React.ReactChild | undefined): >(Component: React.ComponentType) => { new (props: TProps & ValidatorProps): { validate: (e: TEventArgs) => void; render(): JSX.Element; context: any; setState(state: ValidatorState | ((prevState: Readonly, props: Readonly) => ValidatorState | Pick | null) | Pick | 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; }; contextType?: React.Context | undefined; } & { inner: Readonly<{ Component: React.ComponentType; }>; };