import { CalendarMode, DateType } from '@mezzanine-ui/core/calendar'; export interface UseRangeScanProps { /** Locale defining the first day of each displayed week. */ displayWeekDayLocale?: string; /** * Predicate marking a date as unselectable. Consulted in `day` mode. */ isDateDisabled?: (target: DateType) => boolean; /** * Predicate marking a half year as unselectable. Consulted in `half-year` mode. */ isHalfYearDisabled?: (target: DateType) => boolean; /** * Predicate marking a month as unselectable. Consulted in `month` mode. */ isMonthDisabled?: (target: DateType) => boolean; /** * Predicate marking a quarter as unselectable. Consulted in `quarter` mode. */ isQuarterDisabled?: (target: DateType) => boolean; /** * Predicate marking a week as unselectable. Consulted in `week` mode. */ isWeekDisabled?: (target: DateType) => boolean; /** * Predicate marking a year as unselectable. Consulted in `year` mode. */ isYearDisabled?: (target: DateType) => boolean; /** * The granularity the calendar is selecting at. Decides which predicate is * consulted and how wide each step of the scan is. */ mode: CalendarMode; } /** Maximum predicate calls per scan, regardless of the supplied range. */ export declare const maxRangeScanSteps = 4000; /** An incomplete scan does not establish that a range is selectable. */ export type RangeScanResult = 'clear' | 'disabled' | 'incomplete'; export type RangeScan = (start: DateType, end: DateType) => RangeScanResult; /** * Checks each selection unit once, using the displayed calendar's week start. * With no predicate, every range is clear without walking any dates. * A capped scan reports incomplete so callers can withhold highlighting and * selection without mistaking an unchecked range for a valid one. */ export declare function useRangeScan({ displayWeekDayLocale, isDateDisabled, isHalfYearDisabled, isMonthDisabled, isQuarterDisabled, isWeekDisabled, isYearDisabled, mode, }: UseRangeScanProps): RangeScan;