import { MuiPickersAdapterContextValue } from '../../LocalizationProvider/LocalizationProvider'; interface ValidationCommonProps { /** * 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. * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value. * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value. * @param {TError} reason The reason why the current value is not valid. * @param {TValue} value The invalid value. */ onError?: (reason: TError, value: TValue) => void; value: TValue; } export type ValidationProps = ValidationCommonProps & TValidationProps; export type InferError = TProps extends Pick, 'onError'> ? Parameters>[0] : never; export type Validator = (params: { adapter: MuiPickersAdapterContextValue; value: TValue; props: Omit; }) => TError; export declare function useValidation(props: ValidationProps, validate: Validator, isSameError: (a: TError, b: TError | null) => boolean, defaultErrorState: TError): TError; export {};