import type { CalendarEvent, CalendarViewMode, DateCategory, DateRange, EventDayInfo } from './calendar.types.js'; import type { CalendarSlotName } from './index.js'; export interface CalendarContext { readonly displayedMonth: number; readonly displayedYear: number; readonly displayedDate: Date; /** * The agenda view's window: `agendaDays` days starting at the reference date, * both ends inclusive, plus the resolved day count — `agendaDays` when it is a * whole number in 1–366, the default (30) otherwise. Derived once by `Calendar` * and read by the list *and* the header, so the days the agenda lists and the * days its title names cannot drift apart. Present in every view — only the * agenda reads it. */ readonly agendaWindow: { start: Date; end: Date; days: number; }; readonly today: Date; readonly view: CalendarViewMode; readonly views: CalendarViewMode[]; readonly selectionMode: 'single' | 'range' | 'multiple'; readonly selectedDate: Date | null; readonly selectedDates: Date[]; readonly selectedRange: DateRange | null; readonly events: CalendarEvent[]; readonly categories: DateCategory[]; getEventsForDate: (date: Date) => CalendarEvent[]; getEventsWithDayInfo: (date: Date) => EventDayInfo[]; getCategoryById: (id: string) => DateCategory | undefined; readonly size: 'sm' | 'md' | 'lg'; readonly variant: 'default' | 'bordered' | 'ghost'; readonly locale: string; readonly weekStartsOn: number; readonly showWeekNumbers: boolean; readonly showOutsideDays: boolean; readonly fixedWeeks: boolean; /** * Whether today gets its visual marker. Every view draws today itself — the * month cell through the `dayState` variant, the week/year/agenda/mini * headers through inline classes — so the flag lives here rather than being * threaded prop-by-prop; that is what keeps the five paths in step. Read it * for *styling only*: `aria-current="date"` stays unconditional. */ readonly highlightToday: boolean; readonly disabled: boolean; readonly canGoBack: boolean; readonly canGoForward: boolean; readonly canGoToToday: boolean; readonly grid: Date[][]; readonly weekdays: string[]; readonly headerTitle: string; readonly weekDates: Date[]; readonly yearMonths: { month: number; year: number; }[]; readonly focusedDate: Date; readonly hoveredDate: Date | null; navigate: (delta: number) => void; navigateMonth: (delta: number) => void; navigateWeek: (delta: number) => void; navigateDay: (delta: number) => void; navigateYear: (delta: number) => void; goToToday: () => void; selectDate: (date: Date) => void; setFocusedDate: (date: Date) => void; /** Move the roving focus by whole days (keyboard arrows / page keys). */ moveFocus: (deltaDays: number) => void; setHoveredDate: (date: Date | null) => void; setView: (view: CalendarViewMode) => void; /** Navigate to a specific month (used by year grid drill-down). */ goToMonth: (month: number, year: number) => void; /** Jump the reference date to a specific day, clamped to [minDate, maxDate] * (mini-calendar drill-down into week/day view). */ goToDate: (date: Date) => void; isDateDisabled: (date: Date) => boolean; isDateSelected: (date: Date) => boolean; isDateToday: (date: Date) => boolean; isDateInRange: (date: Date) => boolean; isDateRangeStart: (date: Date) => boolean; isDateRangeEnd: (date: Date) => boolean; isDateInPreviewRange: (date: Date) => boolean; isDateInMonth: (date: Date) => boolean; readonly navDirection: 'forward' | 'backward' | null; readonly shouldAnimate: boolean; readonly swipeable: boolean; readonly showTimeGrid: boolean; readonly timeGridStartHour: number; readonly timeGridEndHour: number; readonly timeGridInterval: 30 | 60; /** Resolved pixel height of one hour row — the `timeGridHourHeight` prop, or * the `size`-derived default when it is unset. Always a number, so the grid * never re-derives the fallback. */ readonly timeGridHourHeight: number; readonly eventPopover: boolean; onDateCreate?: (date: Date, view: CalendarViewMode) => void; onTimeSlotCreate?: (start: Date, end: Date) => void; readonly showMiniCalendar: boolean; readonly miniCalendarPosition: 'left' | 'right'; readonly draggable: boolean; onEventMove?: (event: CalendarEvent, newStart: Date, newEnd: Date) => void; readonly resizable: boolean; onEventResize?: (event: CalendarEvent, newEnd: Date) => void; readonly unstyled: boolean; readonly slotClasses: Partial>; readonly styles: ReturnType; } declare const setCalendarContext: (value: CalendarContext | undefined) => CalendarContext | undefined; export { setCalendarContext }; export declare function getCalendarContext(): CalendarContext; /** * Create a slot-class helper bound to a CalendarContext. * Replaces the 15x-duplicated `slot()` pattern in sub-components. */ export declare function createSlotHelper(ctx: CalendarContext): (key: CalendarSlotName, extra?: string) => string;