export type CalendarView = "month" | "week" | "day"; export type WeekStart = 0 | 1; export type SpanEvent = { /** Unique key of the event. */ id: string; /** First day covered; time of day is ignored. */ start: Date; /** Last day covered, inclusive; omit for a single-day event. */ end?: Date; /** Event text, used as a sort tie-break when laying out lanes. */ label: string; }; export type WeekSegment = { /** The event this bar draws. */ event: E; /** First column the bar covers, clamped to the week. */ startCol: number; /** Last column the bar covers, clamped to the week. */ endCol: number; /** Row index of the bar; lanes at or past `maxLanes` are counted in `hiddenByCol`, not drawn. */ lane: number; /** True when the event began in an earlier week. */ continuesBefore: boolean; /** True when the event runs into a later week. */ continuesAfter: boolean; }; export type WeekLayout = { /** Every bar for the week, including those in hidden lanes. */ segments: WeekSegment[]; /** Number of lanes to draw, capped at `maxLanes`. */ visibleLanes: number; /** Per column, how many events fall in lanes that are not drawn. */ hiddenByCol: number[]; }; export declare const startOfDay: (d: Date) => Date; export declare const addDays: (d: Date, n: number) => Date; export declare const addMonths: (d: Date, n: number) => Date; export declare const isSameDay: (a: Date, b: Date) => boolean; export declare const dayKey: (d: Date) => string; export declare const isWeekend: (d: Date) => boolean; /** Whole calendar days from `a` to `b`, counted on date components so a DST day is still one day. */ export declare const diffDays: (a: Date, b: Date) => number; export declare const startOfWeek: (d: Date, weekStartsOn: WeekStart) => Date; export declare const weekDays: (d: Date, weekStartsOn: WeekStart) => Date[]; /** Whole weeks that cover the month of `d`, padded with the neighbouring months' days. */ export declare const monthWeeks: (d: Date, weekStartsOn: WeekStart) => Date[][]; export declare const visibleWeeks: (view: CalendarView, d: Date, weekStartsOn: WeekStart) => Date[][]; export declare const shiftAnchor: (view: CalendarView, d: Date, direction: 1 | -1) => Date; export declare const eventRange: (e: Pick) => { start: Date; end: Date; }; export declare const eventsOnDay: (events: readonly E[], day: Date) => E[]; /** Lays events out in lanes across one week row; lanes past `maxLanes` are counted per column, not drawn. */ export declare const layoutWeek: (days: readonly Date[], events: readonly E[], maxLanes: number) => WeekLayout; export type NavKey = "ArrowLeft" | "ArrowRight" | "ArrowUp" | "ArrowDown" | "Home" | "End" | "PageUp" | "PageDown"; export declare const NAV_KEYS: readonly string[]; export declare const isNavKey: (key: string) => key is NavKey; export declare const moveFocus: (view: CalendarView, d: Date, key: NavKey, weekStartsOn: WeekStart) => Date; export declare const weekdayLabels: (locale: string | undefined, weekStartsOn: WeekStart, style?: "short" | "long") => string[]; export declare const formatTitle: (view: CalendarView, d: Date, locale: string | undefined, weekStartsOn: WeekStart) => string; export declare const formatFullDate: (d: Date, locale: string | undefined) => string;