import { ReactNode } from 'react'; import { SlotClassNames, SlotStyles } from '../types/slots.types.js'; import { CalendarEvent, CalendarEventChange, CalendarEventContext, CalendarLabels, CalendarSlot, CalendarSlots, CalendarWeekStart } from './calendar.types.js'; import { CalendarPeriod } from './dates.js'; /** What Calendar hands each of its views. Internal, so it stays out of the published types. */ export interface CalendarViewProps { events: readonly E[]; /** Local midnight of the selected day. */ date: Date; /** The view, or the narrow calendar's three-day Week. */ period: CalendarPeriod; /** Midnight of today, a new value when the day changes. */ today: Date; locale: string | undefined; weekStartsOn: CalendarWeekStart; slotMinutes: number; /** Weekdays left out, as `Date#getDay()` counts. `date` is never one of them. */ hidden: ReadonlySet; scrollToHour: number | undefined; workingHours: readonly [start: number, end: number] | undefined; showWeekNumbers: boolean; text: Required; onDateChange: (date: Date) => void; /** Opens a day in the Day view, or `undefined` where the Day view is not offered. */ onOpenDay: ((date: Date) => void) | undefined; onEventClick: ((event: E, anchor: HTMLElement) => void) | undefined; onEventChange: ((change: CalendarEventChange) => void) | undefined; onSlotCreate: ((slot: CalendarSlot, anchor: HTMLElement) => void) | undefined; renderEvent: ((event: E, context: CalendarEventContext) => ReactNode) | undefined; eventClassName: ((event: E) => string | undefined) | undefined; classNames: SlotClassNames | undefined; slotStyles: SlotStyles | undefined; }