import type { ColorName } from "../color_tokens"; import type { RepeatRule } from "./repeat"; /** * Calendar primitive — data model. Mirrors the minimum shape every calendar API * converges on ({title, start, end}) plus the layered extras (all-day, color). * `data` carries the consumer's row so render/press callbacks stay typed. */ export interface CalendarEvent { id: string; title: string; /** Event start (local time). For an all-day event, the day it begins. */ start: Date; /** INCLUSIVE end day for an all-day event; exclusive instant for a timed one. * Null/undefined → a zero-length point (floored in the time grid). */ end?: Date | null; /** All-day / multi-day banner event (rendered in the all-day row, not the time grid). */ allDay?: boolean; /** * Design-token colour for the event. A TOKEN, not a hex string: the views * derive a fill, a tint and a border from it, and a raw hex cannot be tinted * without string surgery — the previous version concatenated `"1f"` onto the * value, which silently produced garbage for any colour that was not a * 6-digit hex. */ color?: ColorName; /** Secondary line — a room, an owner, a status. Shown where there is room. */ meta?: string; /** * Repeat this event. The calendar expands it to the occurrences that fall in * the view's own range, so a daily timetable costs one event, not a year of * them. An occurrence's `id` encodes its source (see `sourceEventId`), so * `onEventPress` still hands you the row the series came from. */ repeat?: RepeatRule; data?: T; } export type CalendarViewMode = "month" | "week" | "day" | "agenda"; /** * User-facing chrome strings. Resolution is **prop → `LoticsLocale.calendarView` * → English default**, the kit-wide rule; `labels` overrides one instance. * Dates/weekday/month names come from `locale` via Intl and are not part of this set. */ export interface CalendarViewLabels { today: string; month: string; week: string; day: string; agenda: string; previous: string; next: string; allDay: string; /** Day-cell overflow chip, e.g. (3) => "+3 more". */ more: (count: number) => string; /** Agenda / empty range. */ noEvents: string; /** Accessible name of an empty time slot's press target. */ addAt: (when: string) => string; } export declare const DEFAULT_CALENDAR_VIEW_LABELS: CalendarViewLabels; /** 0 = Sunday … 6 = Saturday. */ export type Weekday = 0 | 1 | 2 | 3 | 4 | 5 | 6; /** * Geometry produced by the overlap layout for one timed event: which column it * occupies and how many columns its overlap cluster spans. width = 1/columns, * left = column/columns — concurrent events render side-by-side, FullCalendar-style. */ export interface EventColumn { event: CalendarEvent; /** Minutes from midnight of the grid day (clamped to [0, 1440]). */ topMinutes: number; /** Height in minutes (>= a floor so very short events stay tappable). */ heightMinutes: number; column: number; columns: number; }