import { CalendarView, CalendarRange, CalendarSlot, CalendarWeekStart } from './calendar.types.js'; export declare const MINUTES_PER_DAY = 1440; export declare function startOfDay(date: Date): Date; /** Midnight, `days` calendar days away. */ export declare function addDays(date: Date, days: number): Date; /** The same wall-clock time, `days` calendar days away. */ export declare function shiftDays(date: Date, days: number): Date; export declare function daysInMonth(year: number, month: number): number; /** Midnight, `months` months away. The day is clamped, so 31 January plus one month is the end of February. */ export declare function addMonths(date: Date, months: number): Date; export declare function startOfMonth(date: Date): Date; export declare function startOfWeek(date: Date, weekStartsOn: CalendarWeekStart): Date; /** Calendar days from `a` to `b`, whatever their times of day. */ export declare function dayDiff(a: Date, b: Date): number; export declare function isSameDay(a: Date, b: Date): boolean; export { dateToDay } from '../utils/day.js'; /** Wall-clock minutes since midnight. On a 25-hour day the repeated hour maps onto itself. */ export declare function minutesOfDay(date: Date): number; /** * The wall-clock time `minutes` after the start of `day`; 1440 is the next midnight. A time the * clock skips resolves forwards (02:30 becomes 03:30) and a repeated one to its first occurrence. */ export declare function atMinutes(day: Date, minutes: number): Date; /** * `end`, unless a clock change turned the range around: where one end lands in the hour the * clocks skip, a wall-clock end can fall on or before its start. Then `minutes` of real time * after the start instead. */ export declare function endAfter(start: Date, end: Date, minutes: number): Date; /** * The Week view of a narrow calendar: three shown days from the selected one, paged by three, where * seven columns would leave no room for a title. Not a `CalendarView`: the switcher still says Week. */ export declare const NARROW_WEEK = "narrowWeek"; /** What the period arithmetic is keyed by: a view, or the narrow calendar's Week. */ export type CalendarPeriod = CalendarView | typeof NARROW_WEEK; /** Midnight of the first day of the period `date` is in. */ export declare function periodStart(period: CalendarPeriod, date: Date, weekStartsOn: CalendarWeekStart): Date; /** The days a view shows for `date`. The month view is always six full weeks. */ export declare function periodRange(period: CalendarPeriod, date: Date, weekStartsOn: CalendarWeekStart, hidden?: ReadonlySet): CalendarRange; /** `hiddenDays` as a lookup. A list that leaves no day of the week hides nothing. */ export declare function hiddenDaySet(hiddenDays: readonly number[] | undefined): ReadonlySet; /** `date`, or the first shown day from it on in `direction`. */ export declare function shownDay(date: Date, hidden: ReadonlySet, direction?: 1 | -1): Date; /** `date` moved by `steps` periods, keeping its place in the period where it can. */ export declare function stepDate(period: CalendarPeriod, date: Date, steps: number, hidden?: ReadonlySet): Date; /** The shown period plus one on either side: what the swipe pager can reveal. */ export declare function rangeWithNeighbours(period: CalendarPeriod, date: Date, weekStartsOn: CalendarWeekStart, hidden?: ReadonlySet): CalendarRange; /** Every day from `first` to `last`, in either order: what creating whole days hands out. */ export declare function allDaySlot(first: Date, last?: Date): CalendarSlot; /** * What the header's New event button creates on `day`: in the week and day views the hour from * the next full hour of the clock, as calendar apps do, and elsewhere the whole day. */ export declare function newEventSlot(period: CalendarPeriod, day: Date, now: Date, slotMinutes: number): CalendarSlot; /** The ISO 8601 week `date` falls in: weeks run Monday to Sunday, and week 1 holds 4 January. */ export declare function weekNumber(date: Date): number; /** Midnight of each of `count` days from `start`. */ export declare function daysFrom(start: Date, count: number): Date[]; /** The days of `count` from `start` that are not hidden: the columns a row of them draws. */ export declare function shownDays(start: Date, count: number, hidden?: ReadonlySet): Date[]; /** * The day a month grid moves to for `key`, or `null` for a key it does not handle. A hidden day * gives way to the next shown one in the direction the key points, so the focus stays on a cell. */ export declare function gridKeyTarget(key: string, day: Date, weekStartsOn: CalendarWeekStart, hidden?: ReadonlySet): Date | null;