import { type ReactNode } from "react"; import type { CalendarEvent, CalendarViewLabels, CalendarViewMode, Weekday } from "./types"; /** * What every calendar part reads. * * Events are held as `CalendarEvent` and the press/render callbacks are * keyed by event **id**, not by the typed event. That is what lets the root be * generic over the consumer's row type while the parts stay plain: the root * closes over its own typed array and resolves the id back before calling out, * so no part ever has to launder a type it does not know. */ export interface CalendarContextValue { events: CalendarEvent[]; /** The anchor date; which days are in view is each part's own business. */ date: Date; setDate: (date: Date) => void; view: CalendarViewMode; setView: (view: CalendarViewMode) => void; /** Which modes the toolbar offers. */ views: CalendarViewMode[]; weekStartsOn: Weekday; locale?: string; labels: CalendarViewLabels; /** What the calendar treats as "now" — the today badge, the red line, and the * hour a grid opens at. Supplied rather than read from the clock so a * workspace in another zone can hand over ITS wall clock, and so a test can * pin a day. */ now: Date; /** Default visible window of a day in the time grid, in minutes from midnight. * A viewport, never a filter — an event outside it still widens the grid. */ dayStartMinutes: number; dayEndMinutes: number; onEventPress?: (id: string) => void; onSlotPress?: (start: Date, end: Date) => void; renderEvent?: (event: CalendarEvent) => ReactNode; } export declare const CalendarProvider: import("react").Provider; export declare function useCalendar(): CalendarContextValue;