import type { CalendarEvent, Weekday } from "./types"; /** * A repeating event, in the shape business scheduling actually uses. * * **This is deliberately NOT RFC 5545.** A full RRULE (`BYSETPOS`, ordinal * `BYDAY`, `EXDATE`, the DST rules) is either a real dependency or several hundred * lines of spec, in a calendar whose stated virtue is that it adds no date library * to an app. What it buys is the long tail — "the last working Friday of the * quarter" — and what it costs is paid by every app that only needed "every * weekday at 06:00". When something genuinely needs the tail, the answer is a * recurrence FIELD TYPE in the platform, not widening this. */ export interface RepeatRule { every: "day" | "week" | "month"; /** Every N days/weeks/months. Default 1; values below 1 are treated as 1. */ interval?: number; /** `week` only — which weekdays. Defaults to the start date's own weekday. */ on?: Weekday[]; /** Inclusive last day the event may occur on. */ until?: Date | null; /** Stop after this many occurrences, counting the first. */ count?: number | null; } /** * The id an occurrence carries: the source event's id, then the day it falls on. * Occurrences need distinct ids — React keys them, and the layout dedupes on them * — but a press has to reach the ROW the series came from, which is what * {@link sourceEventId} takes back off. */ export declare function occurrenceId(sourceId: string, day: Date): string; /** The id of the event an occurrence came from — its own id, if it is not one. */ export declare function sourceEventId(id: string): string; /** * Expand every repeating event in `events` into the occurrences that fall in * [rangeStart, rangeEnd]. Events without a `repeat` pass through untouched. * * Bounded by the range, so the calendar calls it per view: expanding a year of a * daily timetable up front materialises thousands of events nobody looks at. */ export declare function expandRepeats(events: CalendarEvent[], rangeStart: Date, rangeEnd: Date): CalendarEvent[]; /** * The days a rule fires on inside a range. Walks from the series start rather than * from the range, because `count` and `interval` are both defined relative to the * FIRST occurrence. */ export declare function occurrenceDays(seriesStart: Date, rule: RepeatRule, rangeStart: Date, rangeEnd: Date): Date[];