import * as React from 'react'; import { PickerRangeValue, RangePosition } from '../utils/dateRangeUtils'; import { DatePickerView } from '../types'; export interface UseDateRangePickerParams { /** * The selected range. */ value?: PickerRangeValue; /** * The default selected range. */ defaultValue?: PickerRangeValue; /** * Callback fired when the range changes. */ onChange?: (range: PickerRangeValue) => void; /** * Controls whether the popup is open. */ open?: boolean; /** * Callback fired when the popup is opened. */ onOpen?: () => void; /** * Callback fired when the popup is closed. */ onClose?: () => void; /** * If `true`, the component is disabled. */ disabled?: boolean; /** * If `true`, the component is read-only. */ readOnly?: boolean; /** * Minimum selectable date. */ minDate?: any; /** * Maximum selectable date. */ maxDate?: any; /** * If `true`, disable dates after the current date. */ disableFuture?: boolean; /** * If `true`, disable dates before the current date. */ disablePast?: boolean; /** * Function that returns a boolean if the given date should be disabled. */ shouldDisableDate?: (date: any) => boolean; /** * Format of the date when rendered in the input. */ format?: string; /** * If `true`, the picker closes after a date is selected. */ closeOnSelect?: boolean; /** * The position in the currently edited date range. */ rangePosition?: RangePosition; /** * The default position in the range. */ defaultRangePosition?: RangePosition; /** * Callback fired when the range position changes. */ onRangePositionChange?: (position: RangePosition) => void; /** * If `true`, focuses the calendar on open. */ autoFocus?: boolean; /** * Available views for the date picker. */ views?: readonly DatePickerView[] | DatePickerView[]; /** * Callback fired when the view changes. */ onViewChange?: (view: DatePickerView) => void; } export interface UseDateRangePickerResult { selectedRange: PickerRangeValue; previewRange: PickerRangeValue; updateRange: (newRange: PickerRangeValue) => void; rangePosition: RangePosition; setRangePosition: (position: RangePosition) => void; open: boolean; handleOpen: (event?: React.MouseEvent) => void; handleClose: () => void; anchorEl: HTMLElement | null; currentView: DatePickerView; availableViews: readonly DatePickerView[]; disabled: boolean; readOnly: boolean; closeOnSelect: boolean; validateDate: (date: any) => boolean; handleAccept: () => void; handleCancel: () => void; handleClear: () => void; handleViewChange: (view: DatePickerView) => void; } /** * Hook to manage DateRangePicker state and logic. * * @param props DateRangePicker props * @returns State and handlers for the range picker */ export declare function useDateRangePicker(props: UseDateRangePickerParams): UseDateRangePickerResult;