import { Dayjs } from 'dayjs'; import { AnyObject } from '../../utils'; import { TextInputProps } from '../textInput/TextInput.types.ts'; export type Picker = 'day' | 'month' | 'year' | 'range'; export type DateRangePosition = 'start' | 'end' | 'both'; export interface BasicDatePickerProps extends Omit { value?: ValueType; onChange?: (value?: ValueType) => void; clearable?: boolean; format?: string; minDate?: Dayjs; maxDate?: Dayjs; autoClose?: boolean; } export interface DatePickerProps extends BasicDatePickerProps { } export interface MonthPickerProps extends BasicDatePickerProps { } export interface YearPickerProps extends BasicDatePickerProps { } export type RangePickerValue = (Dayjs | undefined)[]; export interface RangePickerProps extends BasicDatePickerProps { } export interface CalendarProps { currentMonth: Dayjs; startSelectedDate?: Dayjs; endSelectedDate?: Dayjs; onChange: (position: DateRangePosition, value?: Dayjs, extraValue?: Dayjs) => void; minDate: Date; maxDate: Date; isDateRange: IsDateRange; closePopup?: () => void; } export interface DatePickerViewContextType { viewMode: Picker; picker: Picker; setViewMode: (picker: Picker) => void; currentMonth: Dayjs; setCurrentMonth: (month: Dayjs) => void; hoveredDate: Dayjs | undefined; setHoveredDate: (date: Dayjs | undefined) => void; } export interface DatePickerContextType { selectedDates: Array; onDayClicked: (selectedDate: Dayjs | undefined) => void; minDate?: Dayjs; maxDate?: Dayjs; } export interface DatePickerContentProps { clearable?: boolean; autoClose?: boolean; } export interface DatePickerFooterProps { clearable?: boolean; }