import { type Dispatch, type RefObject } from 'react'; import { type MessageDescriptor } from 'react-intl'; import type { Precision, TimeErrorKey } from './shared.types.js'; import { type FormFieldMessagesReducerAction } from '../../forms/forms-core/state/formfield-messages-state-reducer.js'; import { type TimeValue } from '../types/time.js'; type TimeBoundaryErrorKey = Extract; type TimeBoundaryMessageValues = { min: string; max: string; }; type TimeBoundaryMessageData = { errorKey: TimeBoundaryErrorKey; values: TimeBoundaryMessageValues; }; /** @internal */ export type ValidateOptions = { formMessageDispatch?: Dispatch; formerError?: TimeErrorKey; precision?: Precision; showError?: boolean; checkOrder?: boolean; ref?: RefObject; expectedFormat?: string; valueMode?: 'single' | 'timeframeSelector' | 'dateTimePicker'; required?: boolean; /** Optional per-key message overrides. Falls back to built-in defaults for any omitted keys. @internal */ errorMessages?: Partial>; }; /** * Checks if a date is outside the given min and/or max bounds. * @internal */ export declare function isOutOfBounds(date?: string | Date, min?: TimeValue | null, max?: TimeValue | null): TimeErrorKey | undefined; /** * Gets the timeframe boundary message data while hiding default Grail limits * unless the current value actually exceeds the Grail range. * @internal */ export declare function getTimeBoundaryMessageData(value: { from: TimeValue | null; to: TimeValue | null; } | TimeValue | null, min?: TimeValue | string | null, max?: TimeValue | string | null, precision?: Precision, onlyWhenOutOfBounds?: boolean): TimeBoundaryMessageData | undefined; /** * Validates a Timeframe or a TimeValue against the provided constraints (min, max, required, order) and dispatches appropriate error messages. * @internal */ export declare function validate(value: { from: TimeValue | null; to: TimeValue | null; } | TimeValue | null, min?: TimeValue | null, max?: TimeValue | null, options?: ValidateOptions): TimeErrorKey | undefined; export {};