import { Adapter } from '@mui/x-scheduler-internals/use-adapter'; import { RecurringEventWeekDayCode, RecurringEventByDayValue, SchedulerProcessedEvent, TemporalSupportedObject, SchedulerProcessedEventRecurrenceRule } from '@mui/x-scheduler-internals/models'; /** * Returns cached adapter data. */ export declare function getAdapterCache(adapter: Adapter): { /** * Week day number (1..7) of Monday for a given adapter. */ mondayWeekDayNumber: number; /** * Date format string for UNTIL serialization (RFC5545 format: YYYYMMDDTHHmmssZ) */ untilFormat: string; }; /** * The week day codes for all 7 days of the week. */ export declare const NOT_LOCALIZED_WEEK_DAYS: RecurringEventWeekDayCode[]; /** * A map of week day codes to their indexes in NOT_LOCALIZED_WEEK_DAYS. */ export declare const NOT_LOCALIZED_WEEK_DAYS_INDEXES: Map; /** * Returns the week day code (MO..SU) for a given date. * Day numbers come from adapter.getDayOfWeek(), so it respects the adapter’s locale numbering. */ export declare function getWeekDayCode(adapter: Adapter, date: TemporalSupportedObject): RecurringEventWeekDayCode; /** * Returns the week day number (1..7) for a given week day code (MO..SU). * Day numbers come from adapter.getDayOfWeek(), so it respects the adapter’s locale numbering. */ export declare function getWeekDayNumberFromCode(adapter: Adapter, code: RecurringEventWeekDayCode): number; /** * Tokenizes a byDay value into { ord, code }. * @returns { ord: number | null, code: RecurringEventWeekDayCode } * @throws if the value is invalid. */ export declare function tokenizeByDay(byDay: RecurringEventByDayValue): { ord: number | null; code: RecurringEventWeekDayCode; }; /** * Parses the byDay property for a weekly frequency. * It only accepts weekday codes (MO..SU) without ordinal. * If `ruleByDay` is empty, returns `fallback`. * @throws if any ordinal is present (e.g. 1MO, -1FR). */ export declare function parsesByDayForWeeklyFrequency(ruleByDay: SchedulerProcessedEventRecurrenceRule['byDay'] | undefined): RecurringEventWeekDayCode[] | null; /** * Parses the byDay property for a monthly frequency. * Expects a single ordinal entry (e.g. 2TU, -1FR). * Returns normalized tokens with positive/negative ordinals. * @throws if byDay property is missing, multiple, or missing ordinal. */ export declare function parsesByDayForMonthlyFrequency(ruleByDay: RecurringEventByDayValue[]): { ord: number; code: RecurringEventWeekDayCode; }; /** * Duration of the event in days. * @returns At least 1, start==end yields 1. */ export declare function getEventDurationInDays(adapter: Adapter, event: SchedulerProcessedEvent): number; /** * Returns the startOfDay for the Nth weekday in a given month. * ordinal > 0 → Nth from the start (1..5). ordinal < 0 → Nth from the end (-1 = last). * If that occurrence doesn't exist in the month, returns null. */ export declare function nthWeekdayOfMonth(adapter: Adapter, monthStart: TemporalSupportedObject, weekdayCode: RecurringEventWeekDayCode, ordinal: number): TemporalSupportedObject | null; /** * Computes how many occurrences remain after `date` (inclusive) given a total `count`. * Used to enforce COUNT. Delegates to frequency-specific counters. * Returns `count` if `date` is before DTSTART (day precision). * Returns 0 if all occurrences have been consumed. */ export declare function getRemainingOccurrences(adapter: Adapter, rule: SchedulerProcessedEventRecurrenceRule, seriesStart: TemporalSupportedObject, date: TemporalSupportedObject, count: number): number; interface GetRemainingOccurrencesParameters { adapter: Adapter; rule: SchedulerProcessedEventRecurrenceRule; /** * The series start date (DTSTART). * This is normalized to startOfDay internally. */ seriesStartDay: TemporalSupportedObject; date: TemporalSupportedObject; /** * The total count of occurrences allowed. */ count: number; } /** * Given a week start and a BYDAY code, returns the exact date in that week. */ export declare function dayInWeek(adapter: Adapter, weekStart: TemporalSupportedObject, code: RecurringEventWeekDayCode): Date; /** * Remaining DAILY occurrences after `date` (inclusive). */ export declare function getRemainingDailyOccurrences(parameters: GetRemainingOccurrencesParameters): number; /** * Remaining WEEKLY occurrences after `date` (inclusive). * Iterates weeks by `interval`, checking each BYDAY. Skips days before DTSTART. * BYDAY defaults to DTSTART weekday if omitted. * Short-circuits when count is exhausted. */ export declare function getRemainingWeeklyOccurrences(parameters: GetRemainingOccurrencesParameters): number; /** * Remaining MONTHLY occurrences after `date` (inclusive). * Modes: BYDAY with a single ordinal (e.g. "2TU" or "-1FR"; only one element) OR single BYMONTHDAY (default = DTSTART day). * Skips months without a match. Steps by `interval`, respecting series start and target boundaries. * Short-circuits when count is exhausted. * @throws If BYDAY is combined with BYMONTHDAY, or BYMONTHDAY has >1 value. */ export declare function getRemainingMonthlyOccurrences(parameters: GetRemainingOccurrencesParameters): number; /** * Remaining YEARLY occurrences after `date` (inclusive). * Only same month/day as DTSTART, skips non-leap years for Feb 29. * Iterates years by `interval`, bounded by series start and target year. * Short-circuits when count is exhausted. * @throws If BYMONTH/DAY/BYDAY are present (unsupported for YEARLY at the moment). */ export declare function getRemainingYearlyOccurrences(parameters: GetRemainingOccurrencesParameters): number; /** * RRULE weekly expansion must use a Monday-based "recurrence week". * We MUST NOT use adapter.startOfWeek() because it's locale-driven (often Sunday in en-US), * which can reorder weekly occurrences for BYDAY combos like SU+TU and break COUNT, * especially when timezone projection shifts weekdays around the week boundary. */ export declare function startOfRRuleWeek(adapter: Adapter, date: TemporalSupportedObject): Date; export {};