import { Dayjs } from 'dayjs'; import { RangeSelectionStep } from './use-range-step-manager'; export interface DateStateSnapshot { tempStart: Dayjs | null; tempEnd: Dayjs | null; } export interface UseRangeDateStateOptions { value: [Dayjs | null, Dayjs | null]; defaultDate: Dayjs; /** Transforms a clicked date before storing; pass time-of-day defaults for datetime variants. */ mapDate?: (date: Dayjs, role: 'start' | 'end') => Dayjs; /** Called when the end date is selected; used for auto-apply in date-only variants. */ onEndDateSelected?: (start: Dayjs | null, end: Dayjs) => void; } export interface UseRangeDateStateReturn { tempStart: Dayjs | null; tempEnd: Dayjs | null; displayedMonth: Dayjs; hoverDate: Dayjs | null; /** Synchronous ref — use inside callbacks to avoid stale closures. */ stateRef: React.MutableRefObject; handleDateClick: (date: Dayjs, step: RangeSelectionStep) => void; handleDateHover: (date: Dayjs | null) => void; handleMonthChange: (month: Dayjs) => void; /** Returns the new [start, end] tuple, or null if the segment was already empty (signals caller to move focus to start). */ clearActiveSegment: (step: RangeSelectionStep) => [Dayjs | null, Dayjs | null] | null; resetDates: (value: [Dayjs | null, Dayjs | null]) => void; } export declare const useRangeDateState: ({ value, defaultDate, mapDate, onEndDateSelected, }: UseRangeDateStateOptions) => UseRangeDateStateReturn;