UNPKG

962 BTypeScriptView Raw
1import type { CalendarDay } from "./classes/index.js";
2import type { MoveFocusBy, MoveFocusDir, DateLib, DayPickerProps, Modifiers } from "./types/index.js";
3import { Calendar } from "./useCalendar.js";
4export type UseFocus = {
5 /** The date that is currently focused. */
6 focused: CalendarDay | undefined;
7 /** Check if the given day is the focus target when entering the calendar. */
8 isFocusTarget: (day: CalendarDay) => boolean;
9 /** Focus the given day. */
10 setFocused: (day: CalendarDay | undefined) => void;
11 /** Blur the focused day. */
12 blur: () => void;
13 /** Move the current focus to the next day according to the given direction. */
14 moveFocus: (moveBy: MoveFocusBy, moveDir: MoveFocusDir) => void;
15};
16/** @private */
17export declare function useFocus<T extends DayPickerProps>(props: T, calendar: Calendar, getModifiers: (day: CalendarDay) => Modifiers, isSelected: (date: Date) => boolean, dateLib: DateLib): UseFocus;