import * as React from 'react'; import { PickerDateType } from '../models/pickers'; import { DatePickerView } from '../types'; export interface UseDatePickerParams { /** * The selected date. */ value?: PickerDateType | null; /** * The default selected date. */ defaultValue?: PickerDateType | null; /** * Callback fired when the date changes. */ onChange?: (date: PickerDateType | null) => 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; /** * 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 UseDatePickerResult { dateState: { selectedDate: PickerDateType | null; tempDate: PickerDateType | null; }; setDateState: React.Dispatch>; 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; handleViewDateChange: (date: PickerDateType | null) => void; handleDateChange: (date: PickerDateType) => void; handleInputChange: (date: PickerDateType | null) => void; handleViewChange: (view: DatePickerView) => void; handleAccept: () => void; handleCancel: () => void; handleClear: () => void; } /** * Hook to manage DatePicker state and logic. * * @param props DatePicker props * @returns State and handlers for the date picker */ export declare function useDatePicker(props: UseDatePickerParams): UseDatePickerResult;