rrule-temporal 1.5.1 → 1.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- import { Temporal } from '@js-temporal/polyfill';
1
+ import { Temporal } from "@js-temporal/polyfill";
2
2
 
3
+ //#region src/RRuleTemporal.d.ts
3
4
  declare const allowedFreq: readonly ["YEARLY", "MONTHLY", "WEEKLY", "DAILY", "HOURLY", "MINUTELY", "SECONDLY"];
4
5
  type Freq = (typeof allowedFreq)[number];
5
6
  declare const allowedWeekdays: readonly ["MO", "TU", "WE", "TH", "FR", "SA", "SU"];
@@ -9,295 +10,295 @@ declare const weekdayToIsoDay: Record<Weekday, number>;
9
10
  * Shared options for all rule constructors.
10
11
  */
11
12
  interface BaseOpts {
12
- /** Time zone identifier as defined in RFC&nbsp;5545 §3.2.19. */
13
- tzid?: string;
14
- /** Safety cap when generating occurrences. */
15
- maxIterations?: number;
16
- /** Include DTSTART as an occurrence even if it does not match the rule pattern. */
17
- includeDtstart?: boolean;
18
- /** Enforce RFC 5545 constraints strictly (defaults to false). */
19
- strict?: boolean;
20
- /** RSCALE per RFC 7529: calendar system for recurrence generation (e.g., GREGORIAN). */
21
- rscale?: string;
22
- /** SKIP behavior per RFC 7529: OMIT (default), BACKWARD, FORWARD (requires RSCALE). */
23
- skip?: 'OMIT' | 'BACKWARD' | 'FORWARD';
13
+ /** Time zone identifier as defined in RFC&nbsp;5545 §3.2.19. */
14
+ tzid?: string;
15
+ /** Safety cap when generating occurrences. */
16
+ maxIterations?: number;
17
+ /** Include DTSTART as an occurrence even if it does not match the rule pattern. */
18
+ includeDtstart?: boolean;
19
+ /** Enforce RFC 5545 constraints strictly (defaults to false). */
20
+ strict?: boolean;
21
+ /** RSCALE per RFC 7529: calendar system for recurrence generation (e.g., GREGORIAN). */
22
+ rscale?: string;
23
+ /** SKIP behavior per RFC 7529: OMIT (default), BACKWARD, FORWARD (requires RSCALE). */
24
+ skip?: 'OMIT' | 'BACKWARD' | 'FORWARD';
24
25
  }
25
26
  /**
26
27
  * Manual rule definition following the recurrence rule parts defined in
27
28
  * RFC 5545 §3.3.10.
28
29
  */
29
30
  interface ManualOpts extends BaseOpts {
30
- /** FREQ: recurrence frequency */
31
- freq: Freq;
32
- /** INTERVAL between each occurrence of {@link freq} */
33
- interval?: number;
34
- /** COUNT: total number of occurrences */
35
- count?: number;
36
- /** UNTIL: last possible occurrence */
37
- until?: Temporal.ZonedDateTime;
38
- /** BYHOUR: hours to include (0-23) */
39
- byHour?: number[];
40
- /** BYMINUTE: minutes to include (0-59) */
41
- byMinute?: number[];
42
- /** BYSECOND: seconds to include (0-59) */
43
- bySecond?: number[];
44
- /** BYDAY: list of weekdays e.g. ["MO","WE","FR"] */
45
- byDay?: string[];
46
- /** BYMONTH: months of the year (1-12). With RSCALE (RFC 7529) may contain values like "5L". */
47
- byMonth?: Array<number | string>;
48
- /** BYMONTHDAY: days of the month (1..31 or negative from end) */
49
- byMonthDay?: number[];
50
- /** BYYEARDAY: days of the year (1..366 or negative from end) */
51
- byYearDay?: number[];
52
- /** BYWEEKNO: ISO week numbers (1..53 or negative from end) */
53
- byWeekNo?: number[];
54
- /** BYSETPOS: select n-th occurrence(s) after other filters */
55
- bySetPos?: number[];
56
- /** WKST: weekday on which the week starts ("MO".."SU") */
57
- wkst?: string;
58
- /** RDATE: additional dates to include */
59
- rDate?: Temporal.ZonedDateTime[];
60
- /** EXDATE: exception dates to exclude */
61
- exDate?: Temporal.ZonedDateTime[];
62
- /** DTSTART: first occurrence */
63
- dtstart: Temporal.ZonedDateTime;
31
+ /** FREQ: recurrence frequency */
32
+ freq: Freq;
33
+ /** INTERVAL between each occurrence of {@link freq} */
34
+ interval?: number;
35
+ /** COUNT: total number of occurrences */
36
+ count?: number;
37
+ /** UNTIL: last possible occurrence */
38
+ until?: Temporal.ZonedDateTime;
39
+ /** BYHOUR: hours to include (0-23) */
40
+ byHour?: number[];
41
+ /** BYMINUTE: minutes to include (0-59) */
42
+ byMinute?: number[];
43
+ /** BYSECOND: seconds to include (0-59) */
44
+ bySecond?: number[];
45
+ /** BYDAY: list of weekdays e.g. ["MO","WE","FR"] */
46
+ byDay?: string[];
47
+ /** BYMONTH: months of the year (1-12). With RSCALE (RFC 7529) may contain values like "5L". */
48
+ byMonth?: Array<number | string>;
49
+ /** BYMONTHDAY: days of the month (1..31 or negative from end) */
50
+ byMonthDay?: number[];
51
+ /** BYYEARDAY: days of the year (1..366 or negative from end) */
52
+ byYearDay?: number[];
53
+ /** BYWEEKNO: ISO week numbers (1..53 or negative from end) */
54
+ byWeekNo?: number[];
55
+ /** BYSETPOS: select n-th occurrence(s) after other filters */
56
+ bySetPos?: number[];
57
+ /** WKST: weekday on which the week starts ("MO".."SU") */
58
+ wkst?: string;
59
+ /** RDATE: additional dates to include */
60
+ rDate?: Temporal.ZonedDateTime[];
61
+ /** EXDATE: exception dates to exclude */
62
+ exDate?: Temporal.ZonedDateTime[];
63
+ /** DTSTART: first occurrence */
64
+ dtstart: Temporal.ZonedDateTime;
64
65
  }
65
66
  interface IcsOpts extends BaseOpts {
66
- rruleString: string;
67
- dtstart?: Temporal.ZonedDateTime;
68
- /** COUNT: total number of occurrences, used when missing from rruleString */
69
- count?: number;
70
- /** UNTIL: last possible occurrence, used when missing from rruleString */
71
- until?: Temporal.ZonedDateTime;
67
+ rruleString: string;
68
+ dtstart?: Temporal.ZonedDateTime;
69
+ /** COUNT: total number of occurrences, used when missing from rruleString */
70
+ count?: number;
71
+ /** UNTIL: last possible occurrence, used when missing from rruleString */
72
+ until?: Temporal.ZonedDateTime;
72
73
  }
73
74
  type RRuleOptions = ManualOpts | IcsOpts;
74
75
  type RRuleTemporalIterator = (date: Temporal.ZonedDateTime, i: number) => boolean;
75
76
  type DateFilter = Date | Temporal.ZonedDateTime;
76
77
  declare class RRuleTemporal {
77
- private readonly tzid;
78
- private readonly originalDtstart;
79
- private readonly opts;
80
- private readonly maxIterations;
81
- private readonly includeDtstart;
82
- private readonly parsedByDayTokens?;
83
- private readonly simpleByDayIsoDays?;
84
- private readonly allByDayIsoDays?;
85
- private readonly hasOrdinalByDay;
86
- private readonly canUseEpochMillisecondsPrecisionFlag;
87
- private readonly timeSlotOffsetsMs?;
88
- private readonly numericByMonths?;
89
- private static readonly rscaleCalendarSupport;
90
- /**
91
- * Normalize a ZonedDateTime to the polyfill implementation.
92
- * This prevents type mismatches when mixing native and polyfill Temporal objects.
93
- */
94
- private static normalizeToPolyfill;
95
- constructor(params: RRuleOptions);
96
- private buildParsedByDayTokens;
97
- private buildByDayIsoDays;
98
- private sanitizeNumericArray;
99
- private sanitizeByDay;
100
- private enforceStrictRfc;
101
- private sanitizeOpts;
102
- private rawAdvance;
103
- /** Expand one base ZonedDateTime into all BYHOUR × BYMINUTE × BYSECOND
104
- * combinations, keeping chronological order. If the options are not
105
- * present the original date is returned unchanged.
106
- */
107
- private expandByTime;
108
- private nextCandidateSameDate;
109
- private applyTimeOverride;
110
- private computeFirst;
111
- private matchesByDay;
112
- private matchesByMonth;
113
- private matchesNumericConstraint;
114
- private matchesByMonthDay;
115
- private matchesByHour;
116
- private matchesByMinute;
117
- private matchesBySecond;
118
- private matchesAll;
119
- private matchesByYearDay;
120
- private getIsoWeekInfo;
121
- private matchesByWeekNo;
122
- options(): ManualOpts;
123
- private cloneOptions;
124
- private cloneUpdateOptions;
125
- /**
126
- * Create a new {@link RRuleTemporal} instance with modified options while keeping the current one unchanged.
127
- *
128
- * @example
129
- * ```ts
130
- * const updated = rule.with({byMonthDay: [3]});
131
- * ```
132
- */
133
- with(updates: Partial<ManualOpts>): RRuleTemporal;
134
- private addDtstartIfNeeded;
135
- private canUseUtcLinearFastPath;
136
- private canUseUtcWeeklyFastPath;
137
- private canUseUtcMonthlyFastPath;
138
- private utcZdtFromEpochNanoseconds;
139
- private utcZdtFromEpochMilliseconds;
140
- private canUseUtcEpochMillisecondsPrecision;
141
- private buildTimeSlotOffsetsMs;
142
- private findFirstMatchingDailyStep;
143
- private allUtcFastPath;
144
- private _allUtcFixedStepSimple;
145
- private _allUtcDailySimple;
146
- private _allUtcWeeklySimple;
147
- private hasSingleExpandedTimeSlot;
148
- private buildMonthlyOccurrenceOnDay;
149
- private applyBySetPosToSortedList;
150
- private generateMonthlyOccurrenceDays;
151
- private generateMonthlyOccurrencesOptimizedBySetPos;
152
- private isGregorianLeapYear;
153
- private daysInGregorianMonth;
154
- private gregorianIsoDayOfWeek;
155
- private monthIndexToYearMonth;
156
- private generateMonthlyOccurrenceDaysUtc;
157
- private generateMonthlyOccurrenceEpochsUtc;
158
- private _allUtcMonthlyByDayOrMonthDay;
159
- private processOccurrences;
160
- /**
161
- * Returns all occurrences of the rule.
162
- * @param iterator - An optional callback iterator function that can be used to filter or modify the occurrences.
163
- * @returns An array of Temporal.ZonedDateTime objects representing all occurrences of the rule.
164
- */
165
- private _allMonthlyByDayOrMonthDay;
166
- private _allWeekly;
167
- private _allMonthlyByMonth;
168
- private _allYearlyByMonth;
169
- private _allYearlyComplex;
170
- private _allMinutelySecondlyComplex;
171
- private _allMonthlyByWeekNo;
172
- private _allMonthlyByYearDay;
173
- private _allDailyMinutelyHourlyWithBySetPos;
174
- private _allFallback;
175
- /**
176
- * Returns all occurrences of the rule.
177
- * @param iterator - An optional callback iterator function that can be used to filter or modify the occurrences.
178
- * @returns An array of Temporal.ZonedDateTime objects representing all occurrences of the rule.
179
- */
180
- all(iterator?: RRuleTemporalIterator): Temporal.ZonedDateTime[];
181
- /**
182
- * RFC 7529: RSCALE present, simple monthly iteration with SKIP behavior.
183
- * Handles month-to-month stepping from DTSTART's year/month aiming for DTSTART's day-of-month.
184
- * Applies SKIP=OMIT (skip invalid months), BACKWARD (clamp to last day), FORWARD (first day of next month).
185
- */
186
- private _allMonthlyRscaleSimple;
187
- /**
188
- * Converts rDate entries to ZonedDateTime and merges with existing dates.
189
- * @param dates - Array of dates to merge with
190
- * @returns Merged and deduplicated array of dates
191
- */
192
- private mergeAndDeduplicateRDates;
193
- /**
194
- * Checks if a date is in the exDate list.
195
- * @param date - Date to check
196
- * @returns True if the date is excluded
197
- */
198
- private isExcluded;
199
- /**
200
- * Excludes exDate entries from the given array of dates.
201
- * @param dates - Array of dates to filter
202
- * @returns Filtered array with exDate entries removed
203
- */
204
- private excludeExDates;
205
- /**
206
- * Applies count limit and merges rDates with the rule-generated dates.
207
- * @param dates - Array of dates generated by the rule
208
- * @param iterator - Optional iterator function
209
- * @returns Final array of dates after merging and applying count limit
210
- */
211
- private applyCountLimitAndMergeRDates;
212
- /**
213
- * Checks if the count limit should break the loop based on rDate presence.
214
- * @param matchCount - Current number of matches
215
- * @returns true if the loop should break
216
- */
217
- private shouldBreakForCountLimit;
218
- private hasTimeOfDayBetween;
219
- /**
220
- * Returns all occurrences of the rule within a specified time window.
221
- * @param after - The start date or Temporal.ZonedDateTime object.
222
- * @param before - The end date or Temporal.ZonedDateTime object.
223
- * @param inc - Optional boolean flag to include the end date in the results.
224
- * @returns An array of Temporal.ZonedDateTime objects representing all occurrences of the rule within the specified time window.
225
- */
226
- between(after: DateFilter, before: DateFilter, inc?: boolean): Temporal.ZonedDateTime[];
227
- /**
228
- * Convenience helper: true if the exact instant is an occurrence of the rule.
229
- * This checks full date-time equality (including time and time zone).
230
- */
231
- matches(date: DateFilter): boolean;
232
- /**
233
- * Convenience helper: true if any occurrence falls on the given calendar day
234
- * in the rule's time zone. This ignores time-of-day granularity.
235
- */
236
- occursOn(date: Temporal.PlainDate): boolean;
237
- /**
238
- * Returns the next occurrence of the rule after a specified date.
239
- * @param after - The start date or Temporal.ZonedDateTime object.
240
- * @param inc - Optional boolean flag to include occurrences on the start date.
241
- * @returns The next occurrence of the rule after the specified date or null if no occurrences are found.
242
- */
243
- next(after?: DateFilter, inc?: boolean): Temporal.ZonedDateTime | null;
244
- /**
245
- * Returns the previous occurrence of the rule before a specified date.
246
- * @param before - The end date or Temporal.ZonedDateTime object.
247
- * @param inc - Optional boolean flag to include occurrences on the end date.
248
- * @returns The previous occurrence of the rule before the specified date or null if no occurrences are found.
249
- */
250
- previous(before?: DateFilter, inc?: boolean): Temporal.ZonedDateTime | null;
251
- toString(): string;
252
- private formatIcsDateTime;
253
- private joinDates;
254
- /**
255
- * Given any date in a month, return all the ZonedDateTimes in that month
256
- * matching your opts.byDay and opts.byMonth (or the single "same day" if no BYDAY).
257
- */
258
- private generateMonthlyOccurrences;
259
- /**
260
- * Given any date in a year, return all ZonedDateTimes in that year matching
261
- * the BYDAY/BYMONTHDAY/BYMONTH constraints. Months default to DTSTART's month
262
- * if BYMONTH is not specified.
263
- */
264
- private generateYearlyOccurrences;
265
- private addByDay;
266
- /**
267
- * Helper to find the next valid value from a sorted array
268
- */
269
- private findNextValidValue;
270
- /**
271
- * Efficiently find the next valid date for MINUTELY and SECONDLY frequency by jumping over
272
- * large gaps when BYXXX constraints don't match.
273
- */
274
- private findNextValidDate;
275
- private applyBySetPos;
276
- private isoWeekByDay;
277
- /**
278
- * Generate occurrences for a specific week number in a given year
279
- */
280
- private generateOccurrencesForWeekInYear;
281
- private getRscaleCalendarId;
282
- private assertRscaleCalendarSupported;
283
- private pad2;
284
- private monthMatchesToken;
285
- private monthsOfYear;
286
- private startOfYear;
287
- private endOfYear;
288
- private rscaleFirstWeekStart;
289
- private rscaleLastWeekCount;
290
- private lastDayOfMonth;
291
- private buildZdtFromPlainDate;
292
- private rscaleMatchesByYearDay;
293
- private rscaleMatchesByWeekNo;
294
- private rscaleMatchesByMonth;
295
- private rscaleMatchesByMonthDay;
296
- private rscaleMatchesByDayBasic;
297
- private rscaleDateMatches;
298
- private applySkipForDay;
299
- private generateMonthlyOccurrencesRscale;
300
- private _allRscaleNonGregorian;
78
+ private readonly tzid;
79
+ private readonly originalDtstart;
80
+ private readonly opts;
81
+ private readonly maxIterations;
82
+ private readonly includeDtstart;
83
+ private readonly parsedByDayTokens?;
84
+ private readonly simpleByDayIsoDays?;
85
+ private readonly allByDayIsoDays?;
86
+ private readonly hasOrdinalByDay;
87
+ private readonly canUseEpochMillisecondsPrecisionFlag;
88
+ private readonly timeSlotOffsetsMs?;
89
+ private readonly numericByMonths?;
90
+ private static readonly rscaleCalendarSupport;
91
+ /**
92
+ * Normalize a ZonedDateTime to the polyfill implementation.
93
+ * This prevents type mismatches when mixing native and polyfill Temporal objects.
94
+ */
95
+ private static normalizeToPolyfill;
96
+ constructor(params: RRuleOptions);
97
+ private buildParsedByDayTokens;
98
+ private buildByDayIsoDays;
99
+ private sanitizeNumericArray;
100
+ private sanitizeByDay;
101
+ private enforceStrictRfc;
102
+ private sanitizeOpts;
103
+ private rawAdvance;
104
+ /** Expand one base ZonedDateTime into all BYHOUR × BYMINUTE × BYSECOND
105
+ * combinations, keeping chronological order. If the options are not
106
+ * present the original date is returned unchanged.
107
+ */
108
+ private expandByTime;
109
+ private nextCandidateSameDate;
110
+ private applyTimeOverride;
111
+ private computeFirst;
112
+ private matchesByDay;
113
+ private matchesByMonth;
114
+ private matchesNumericConstraint;
115
+ private matchesByMonthDay;
116
+ private matchesByHour;
117
+ private matchesByMinute;
118
+ private matchesBySecond;
119
+ private matchesAll;
120
+ private matchesByYearDay;
121
+ private getIsoWeekInfo;
122
+ private matchesByWeekNo;
123
+ options(): ManualOpts;
124
+ private cloneOptions;
125
+ private cloneUpdateOptions;
126
+ /**
127
+ * Create a new {@link RRuleTemporal} instance with modified options while keeping the current one unchanged.
128
+ *
129
+ * @example
130
+ * ```ts
131
+ * const updated = rule.with({byMonthDay: [3]});
132
+ * ```
133
+ */
134
+ with(updates: Partial<ManualOpts>): RRuleTemporal;
135
+ private addDtstartIfNeeded;
136
+ private canUseUtcLinearFastPath;
137
+ private canUseUtcWeeklyFastPath;
138
+ private canUseUtcMonthlyFastPath;
139
+ private utcZdtFromEpochNanoseconds;
140
+ private utcZdtFromEpochMilliseconds;
141
+ private canUseUtcEpochMillisecondsPrecision;
142
+ private buildTimeSlotOffsetsMs;
143
+ private findFirstMatchingDailyStep;
144
+ private allUtcFastPath;
145
+ private _allUtcFixedStepSimple;
146
+ private _allUtcDailySimple;
147
+ private _allUtcWeeklySimple;
148
+ private hasSingleExpandedTimeSlot;
149
+ private buildMonthlyOccurrenceOnDay;
150
+ private applyBySetPosToSortedList;
151
+ private generateMonthlyOccurrenceDays;
152
+ private generateMonthlyOccurrencesOptimizedBySetPos;
153
+ private isGregorianLeapYear;
154
+ private daysInGregorianMonth;
155
+ private gregorianIsoDayOfWeek;
156
+ private monthIndexToYearMonth;
157
+ private generateMonthlyOccurrenceDaysUtc;
158
+ private generateMonthlyOccurrenceEpochsUtc;
159
+ private _allUtcMonthlyByDayOrMonthDay;
160
+ private processOccurrences;
161
+ /**
162
+ * Returns all occurrences of the rule.
163
+ * @param iterator - An optional callback iterator function that can be used to filter or modify the occurrences.
164
+ * @returns An array of Temporal.ZonedDateTime objects representing all occurrences of the rule.
165
+ */
166
+ private _allMonthlyByDayOrMonthDay;
167
+ private _allWeekly;
168
+ private _allMonthlyByMonth;
169
+ private _allYearlyByMonth;
170
+ private _allYearlyComplex;
171
+ private _allMinutelySecondlyComplex;
172
+ private _allMonthlyByWeekNo;
173
+ private _allMonthlyByYearDay;
174
+ private _allDailyMinutelyHourlyWithBySetPos;
175
+ private _allFallback;
176
+ /**
177
+ * Returns all occurrences of the rule.
178
+ * @param iterator - An optional callback iterator function that can be used to filter or modify the occurrences.
179
+ * @returns An array of Temporal.ZonedDateTime objects representing all occurrences of the rule.
180
+ */
181
+ all(iterator?: RRuleTemporalIterator): Temporal.ZonedDateTime[];
182
+ /**
183
+ * RFC 7529: RSCALE present, simple monthly iteration with SKIP behavior.
184
+ * Handles month-to-month stepping from DTSTART's year/month aiming for DTSTART's day-of-month.
185
+ * Applies SKIP=OMIT (skip invalid months), BACKWARD (clamp to last day), FORWARD (first day of next month).
186
+ */
187
+ private _allMonthlyRscaleSimple;
188
+ /**
189
+ * Converts rDate entries to ZonedDateTime and merges with existing dates.
190
+ * @param dates - Array of dates to merge with
191
+ * @returns Merged and deduplicated array of dates
192
+ */
193
+ private mergeAndDeduplicateRDates;
194
+ /**
195
+ * Checks if a date is in the exDate list.
196
+ * @param date - Date to check
197
+ * @returns True if the date is excluded
198
+ */
199
+ private isExcluded;
200
+ /**
201
+ * Excludes exDate entries from the given array of dates.
202
+ * @param dates - Array of dates to filter
203
+ * @returns Filtered array with exDate entries removed
204
+ */
205
+ private excludeExDates;
206
+ /**
207
+ * Applies count limit and merges rDates with the rule-generated dates.
208
+ * @param dates - Array of dates generated by the rule
209
+ * @param iterator - Optional iterator function
210
+ * @returns Final array of dates after merging and applying count limit
211
+ */
212
+ private applyCountLimitAndMergeRDates;
213
+ /**
214
+ * Checks if the count limit should break the loop based on rDate presence.
215
+ * @param matchCount - Current number of matches
216
+ * @returns true if the loop should break
217
+ */
218
+ private shouldBreakForCountLimit;
219
+ private hasTimeOfDayBetween;
220
+ /**
221
+ * Returns all occurrences of the rule within a specified time window.
222
+ * @param after - The start date or Temporal.ZonedDateTime object.
223
+ * @param before - The end date or Temporal.ZonedDateTime object.
224
+ * @param inc - Optional boolean flag to include the end date in the results.
225
+ * @returns An array of Temporal.ZonedDateTime objects representing all occurrences of the rule within the specified time window.
226
+ */
227
+ between(after: DateFilter, before: DateFilter, inc?: boolean): Temporal.ZonedDateTime[];
228
+ /**
229
+ * Convenience helper: true if the exact instant is an occurrence of the rule.
230
+ * This checks full date-time equality (including time and time zone).
231
+ */
232
+ matches(date: DateFilter): boolean;
233
+ /**
234
+ * Convenience helper: true if any occurrence falls on the given calendar day
235
+ * in the rule's time zone. This ignores time-of-day granularity.
236
+ */
237
+ occursOn(date: Temporal.PlainDate): boolean;
238
+ /**
239
+ * Returns the next occurrence of the rule after a specified date.
240
+ * @param after - The start date or Temporal.ZonedDateTime object.
241
+ * @param inc - Optional boolean flag to include occurrences on the start date.
242
+ * @returns The next occurrence of the rule after the specified date or null if no occurrences are found.
243
+ */
244
+ next(after?: DateFilter, inc?: boolean): Temporal.ZonedDateTime | null;
245
+ /**
246
+ * Returns the previous occurrence of the rule before a specified date.
247
+ * @param before - The end date or Temporal.ZonedDateTime object.
248
+ * @param inc - Optional boolean flag to include occurrences on the end date.
249
+ * @returns The previous occurrence of the rule before the specified date or null if no occurrences are found.
250
+ */
251
+ previous(before?: DateFilter, inc?: boolean): Temporal.ZonedDateTime | null;
252
+ toString(): string;
253
+ private formatIcsDateTime;
254
+ private joinDates;
255
+ /**
256
+ * Given any date in a month, return all the ZonedDateTimes in that month
257
+ * matching your opts.byDay and opts.byMonth (or the single "same day" if no BYDAY).
258
+ */
259
+ private generateMonthlyOccurrences;
260
+ /**
261
+ * Given any date in a year, return all ZonedDateTimes in that year matching
262
+ * the BYDAY/BYMONTHDAY/BYMONTH constraints. Months default to DTSTART's month
263
+ * if BYMONTH is not specified.
264
+ */
265
+ private generateYearlyOccurrences;
266
+ private addByDay;
267
+ /**
268
+ * Helper to find the next valid value from a sorted array
269
+ */
270
+ private findNextValidValue;
271
+ /**
272
+ * Efficiently find the next valid date for MINUTELY and SECONDLY frequency by jumping over
273
+ * large gaps when BYXXX constraints don't match.
274
+ */
275
+ private findNextValidDate;
276
+ private applyBySetPos;
277
+ private isoWeekByDay;
278
+ /**
279
+ * Generate occurrences for a specific week number in a given year
280
+ */
281
+ private generateOccurrencesForWeekInYear;
282
+ private getRscaleCalendarId;
283
+ private assertRscaleCalendarSupported;
284
+ private pad2;
285
+ private monthMatchesToken;
286
+ private monthsOfYear;
287
+ private startOfYear;
288
+ private endOfYear;
289
+ private rscaleFirstWeekStart;
290
+ private rscaleLastWeekCount;
291
+ private lastDayOfMonth;
292
+ private buildZdtFromPlainDate;
293
+ private rscaleMatchesByYearDay;
294
+ private rscaleMatchesByWeekNo;
295
+ private rscaleMatchesByMonth;
296
+ private rscaleMatchesByMonthDay;
297
+ private rscaleMatchesByDayBasic;
298
+ private rscaleDateMatches;
299
+ private applySkipForDay;
300
+ private generateMonthlyOccurrencesRscale;
301
+ private _allRscaleNonGregorian;
301
302
  }
302
-
303
- export { type Freq, type RRuleOptions, RRuleTemporal, type Weekday, allowedFreq, allowedWeekdays, weekdayToIsoDay };
303
+ //#endregion
304
+ export { Freq, RRuleOptions, RRuleTemporal, Weekday, allowedFreq, allowedWeekdays, weekdayToIsoDay };