Files
ETB/ETB-FrontEnd/node_modules/@mui/x-date-pickers/internals/hooks/validation/useTimeValidation.d.ts
Iliyan Angelov 306b20e24a Frontend start
2025-09-14 00:54:48 +03:00

38 lines
1.8 KiB
TypeScript

import { ValidationProps, Validator } from './useValidation';
import { ClockPickerView } from '../../models';
export interface ExportedTimeValidationProps<TDate> {
/**
* Min time acceptable time.
* For input validation date part of passed object will be ignored if `disableIgnoringDatePartForTimeValidation` not specified.
*/
minTime?: TDate;
/**
* Max time acceptable time.
* For input validation date part of passed object will be ignored if `disableIgnoringDatePartForTimeValidation` not specified.
*/
maxTime?: TDate;
/**
* Step over minutes.
* @default 1
*/
minutesStep?: number;
/**
* Dynamically check if time is disabled or not.
* If returns `false` appropriate time point will ot be acceptable.
* @param {number} timeValue The value to check.
* @param {ClockPickerView} clockType The clock type of the timeValue.
* @returns {boolean} Returns `true` if the time should be disabled
*/
shouldDisableTime?: (timeValue: number, clockType: ClockPickerView) => boolean;
/**
* Do not ignore date part when validating min/max time.
* @default false
*/
disableIgnoringDatePartForTimeValidation?: boolean;
}
export interface TimeValidationProps<TInputDate, TDate> extends ExportedTimeValidationProps<TDate>, ValidationProps<TimeValidationError, TInputDate | null> {
}
export declare type TimeValidationError = 'invalidDate' | 'minutesStep' | 'minTime' | 'maxTime' | 'shouldDisableTime-hours' | 'shouldDisableTime-minutes' | 'shouldDisableTime-seconds' | null;
export declare const validateTime: Validator<any, TimeValidationProps<any, any>>;
export declare const useTimeValidation: <TInputDate, TDate>(props: TimeValidationProps<TInputDate, TDate>) => TimeValidationError;