import { MuiPickersAdapterContextValue } from '../../../LocalizationProvider/LocalizationProvider'; export interface ValidationProps { /** * Callback that fired when input value or new `value` prop validation returns **new** validation error (or value is valid after error). * In case of validation error detected `reason` prop return non-null value and `TextField` must be displayed in `error` state. * This can be used to render appropriate form error. * * [Read the guide](https://next.material-ui-pickers.dev/guides/forms) about form integration and error displaying. * @DateIOType * * @template TError, TInputValue * @param {TError} reason The reason why the current value is not valid. * @param {TInputValue} value The invalid value. */ onError?: (reason: TError, value: TInputValue) => void; value: TInputValue; } export declare type InferError = TProps extends Pick, 'onError'> ? Parameters>[0] : never; declare type InferInputValue = TProps extends { value: any; } ? TProps['value'] : never; export declare type Validator = (params: { adapter: MuiPickersAdapterContextValue; value: InferInputValue; props: Omit; }) => InferError; export declare function useValidation>(props: TProps, validate: Validator, isSameError: (a: InferError, b: InferError | null) => boolean): InferError; export {};