rrule-temporal 1.5.3 → 2.0.0
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/README.md +60 -34
- package/dist/index.cjs +5 -2703
- package/dist/index.d.cts +83 -23
- package/dist/index.d.ts +83 -23
- package/dist/index.js +1 -2699
- package/dist/src-B0RsDEOV.cjs +7577 -0
- package/dist/src-DEpYefSo.js +7554 -0
- package/dist/totext.cjs +19 -21
- package/dist/totext.js +13 -15
- package/package.json +10 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Temporal } from "
|
|
1
|
+
import { Temporal } from "temporal-spec";
|
|
2
2
|
|
|
3
3
|
//#region src/RRuleTemporal.d.ts
|
|
4
4
|
declare const allowedFreq: readonly ["YEARLY", "MONTHLY", "WEEKLY", "DAILY", "HOURLY", "MINUTELY", "SECONDLY"];
|
|
@@ -22,12 +22,25 @@ interface BaseOpts {
|
|
|
22
22
|
rscale?: string;
|
|
23
23
|
/** SKIP behavior per RFC 7529: OMIT (default), BACKWARD, FORWARD (requires RSCALE). */
|
|
24
24
|
skip?: 'OMIT' | 'BACKWARD' | 'FORWARD';
|
|
25
|
+
/** Memoize the full occurrence list computed by all() (defaults to true). */
|
|
26
|
+
cache?: boolean;
|
|
25
27
|
}
|
|
28
|
+
type TemporalZonedDateTime = Temporal.ZonedDateTime;
|
|
29
|
+
type TemporalPlainDate = Temporal.PlainDate;
|
|
30
|
+
interface TemporalZonedDateTimeInput {
|
|
31
|
+
readonly timeZoneId: string;
|
|
32
|
+
toString(): string;
|
|
33
|
+
}
|
|
34
|
+
interface TemporalPlainDateInput {
|
|
35
|
+
toString(): string;
|
|
36
|
+
}
|
|
37
|
+
type RRuleTemporalIterator = (date: TemporalZonedDateTime, i: number) => boolean;
|
|
38
|
+
type DateFilter = Date | TemporalZonedDateTimeInput;
|
|
26
39
|
/**
|
|
27
40
|
* Manual rule definition following the recurrence rule parts defined in
|
|
28
41
|
* RFC 5545 §3.3.10.
|
|
29
42
|
*/
|
|
30
|
-
interface
|
|
43
|
+
interface ManualOptions extends BaseOpts {
|
|
31
44
|
/** FREQ: recurrence frequency */
|
|
32
45
|
freq: Freq;
|
|
33
46
|
/** INTERVAL between each occurrence of {@link freq} */
|
|
@@ -35,7 +48,7 @@ interface ManualOpts extends BaseOpts {
|
|
|
35
48
|
/** COUNT: total number of occurrences */
|
|
36
49
|
count?: number;
|
|
37
50
|
/** UNTIL: last possible occurrence */
|
|
38
|
-
until?:
|
|
51
|
+
until?: TemporalZonedDateTimeInput;
|
|
39
52
|
/** BYHOUR: hours to include (0-23) */
|
|
40
53
|
byHour?: number[];
|
|
41
54
|
/** BYMINUTE: minutes to include (0-59) */
|
|
@@ -57,27 +70,31 @@ interface ManualOpts extends BaseOpts {
|
|
|
57
70
|
/** WKST: weekday on which the week starts ("MO".."SU") */
|
|
58
71
|
wkst?: string;
|
|
59
72
|
/** RDATE: additional dates to include */
|
|
60
|
-
rDate?:
|
|
73
|
+
rDate?: TemporalZonedDateTimeInput[];
|
|
61
74
|
/** EXDATE: exception dates to exclude */
|
|
62
|
-
exDate?:
|
|
75
|
+
exDate?: TemporalZonedDateTimeInput[];
|
|
63
76
|
/** DTSTART: first occurrence */
|
|
64
|
-
dtstart:
|
|
77
|
+
dtstart: TemporalZonedDateTimeInput;
|
|
65
78
|
}
|
|
66
|
-
interface
|
|
79
|
+
interface IcsOptions extends BaseOpts {
|
|
67
80
|
rruleString: string;
|
|
68
|
-
dtstart?:
|
|
81
|
+
dtstart?: TemporalZonedDateTimeInput;
|
|
69
82
|
/** COUNT: total number of occurrences, used when missing from rruleString */
|
|
70
83
|
count?: number;
|
|
71
84
|
/** UNTIL: last possible occurrence, used when missing from rruleString */
|
|
72
|
-
until?:
|
|
85
|
+
until?: TemporalZonedDateTimeInput;
|
|
73
86
|
/** RDATE: additional dates to include */
|
|
74
|
-
rDate?:
|
|
87
|
+
rDate?: TemporalZonedDateTimeInput[];
|
|
75
88
|
/** EXDATE: exception dates to exclude */
|
|
76
|
-
exDate?:
|
|
89
|
+
exDate?: TemporalZonedDateTimeInput[];
|
|
77
90
|
}
|
|
78
|
-
type RRuleOptions =
|
|
79
|
-
type
|
|
80
|
-
|
|
91
|
+
type RRuleOptions = ManualOptions | IcsOptions;
|
|
92
|
+
type RRuleResolvedOptions = Omit<ManualOptions, 'dtstart' | 'until' | 'rDate' | 'exDate'> & {
|
|
93
|
+
dtstart: TemporalZonedDateTime;
|
|
94
|
+
until?: TemporalZonedDateTime;
|
|
95
|
+
rDate?: TemporalZonedDateTime[];
|
|
96
|
+
exDate?: TemporalZonedDateTime[];
|
|
97
|
+
};
|
|
81
98
|
declare class RRuleTemporal {
|
|
82
99
|
private readonly tzid;
|
|
83
100
|
private readonly originalDtstart;
|
|
@@ -91,12 +108,19 @@ declare class RRuleTemporal {
|
|
|
91
108
|
private readonly canUseEpochMillisecondsPrecisionFlag;
|
|
92
109
|
private readonly timeSlotOffsetsMs?;
|
|
93
110
|
private readonly numericByMonths?;
|
|
111
|
+
private exDateEpochNs?;
|
|
112
|
+
private allResultCache?;
|
|
113
|
+
private zoneResolver?;
|
|
114
|
+
private emitAnchorZdt?;
|
|
94
115
|
private static readonly rscaleCalendarSupport;
|
|
95
116
|
/**
|
|
96
117
|
* Normalize a ZonedDateTime to the polyfill implementation.
|
|
97
118
|
* This prevents type mismatches when mixing native and polyfill Temporal objects.
|
|
98
119
|
*/
|
|
99
120
|
private static normalizeToPolyfill;
|
|
121
|
+
private static toInternalIterator;
|
|
122
|
+
private static toPublicDate;
|
|
123
|
+
private static toPublicDates;
|
|
100
124
|
constructor(params: RRuleOptions);
|
|
101
125
|
private buildParsedByDayTokens;
|
|
102
126
|
private buildByDayIsoDays;
|
|
@@ -124,7 +148,7 @@ declare class RRuleTemporal {
|
|
|
124
148
|
private matchesByYearDay;
|
|
125
149
|
private getIsoWeekInfo;
|
|
126
150
|
private matchesByWeekNo;
|
|
127
|
-
options():
|
|
151
|
+
options(): RRuleResolvedOptions;
|
|
128
152
|
private cloneOptions;
|
|
129
153
|
private cloneUpdateOptions;
|
|
130
154
|
/**
|
|
@@ -135,7 +159,7 @@ declare class RRuleTemporal {
|
|
|
135
159
|
* const updated = rule.with({byMonthDay: [3]});
|
|
136
160
|
* ```
|
|
137
161
|
*/
|
|
138
|
-
with(updates: Partial<
|
|
162
|
+
with(updates: Partial<ManualOptions>): RRuleTemporal;
|
|
139
163
|
private addDtstartIfNeeded;
|
|
140
164
|
private canUseUtcLinearFastPath;
|
|
141
165
|
private canUseUtcWeeklyFastPath;
|
|
@@ -161,6 +185,23 @@ declare class RRuleTemporal {
|
|
|
161
185
|
private generateMonthlyOccurrenceDaysUtc;
|
|
162
186
|
private generateMonthlyOccurrenceEpochsUtc;
|
|
163
187
|
private _allUtcMonthlyByDayOrMonthDay;
|
|
188
|
+
private getZoneResolver;
|
|
189
|
+
private zdtFromEpochMs;
|
|
190
|
+
/** Local wall-clock ms (as-if-UTC) of a ZonedDateTime with ms precision. */
|
|
191
|
+
private wallMsOf;
|
|
192
|
+
private canUseTzEpochFastPaths;
|
|
193
|
+
/**
|
|
194
|
+
* True if the rule's nominal time of day can be skipped by a DST gap
|
|
195
|
+
* anywhere in the (estimated) iteration range. The general engine chains
|
|
196
|
+
* its cursor through gap days — even filtered-out ones — permanently
|
|
197
|
+
* shifting the time of day, so affected rules must use it for parity.
|
|
198
|
+
*/
|
|
199
|
+
private tzFastPathGapHazard;
|
|
200
|
+
private allTzEpochFastPath;
|
|
201
|
+
private _allTzDailySimple;
|
|
202
|
+
private _allTzFixedStepSimple;
|
|
203
|
+
private _allTzWeeklySimple;
|
|
204
|
+
private _allTzMonthlyByDayOrMonthDay;
|
|
164
205
|
private processOccurrences;
|
|
165
206
|
/**
|
|
166
207
|
* Returns all occurrences of the rule.
|
|
@@ -182,7 +223,8 @@ declare class RRuleTemporal {
|
|
|
182
223
|
* @param iterator - An optional callback iterator function that can be used to filter or modify the occurrences.
|
|
183
224
|
* @returns An array of Temporal.ZonedDateTime objects representing all occurrences of the rule.
|
|
184
225
|
*/
|
|
185
|
-
all(iterator?: RRuleTemporalIterator):
|
|
226
|
+
all(iterator?: RRuleTemporalIterator): TemporalZonedDateTime[];
|
|
227
|
+
private allInternal;
|
|
186
228
|
/**
|
|
187
229
|
* RFC 7529: RSCALE present, simple monthly iteration with SKIP behavior.
|
|
188
230
|
* Handles month-to-month stepping from DTSTART's year/month aiming for DTSTART's day-of-month.
|
|
@@ -225,10 +267,18 @@ declare class RRuleTemporal {
|
|
|
225
267
|
* Returns all occurrences of the rule within a specified time window.
|
|
226
268
|
* @param after - The start date or Temporal.ZonedDateTime object.
|
|
227
269
|
* @param before - The end date or Temporal.ZonedDateTime object.
|
|
228
|
-
* @param inc - Optional boolean flag to include the end
|
|
270
|
+
* @param inc - Optional boolean flag to include the start and end dates in the results.
|
|
229
271
|
* @returns An array of Temporal.ZonedDateTime objects representing all occurrences of the rule within the specified time window.
|
|
230
272
|
*/
|
|
231
|
-
between(after: DateFilter, before: DateFilter, inc?: boolean):
|
|
273
|
+
between(after: DateFilter, before: DateFilter, inc?: boolean): TemporalZonedDateTime[];
|
|
274
|
+
/**
|
|
275
|
+
* Compute a rule-phase-aligned DTSTART at or just before the given window
|
|
276
|
+
* start, jumping forward from the original DTSTART in whole multiples of
|
|
277
|
+
* INTERVAL. Lets window queries skip iterating occurrences before the
|
|
278
|
+
* window without disturbing cadence. Not valid for COUNT-limited rules,
|
|
279
|
+
* where the occurrence set depends on the index from the true DTSTART.
|
|
280
|
+
*/
|
|
281
|
+
private jumpAlignedDtstart;
|
|
232
282
|
/**
|
|
233
283
|
* Convenience helper: true if the exact instant is an occurrence of the rule.
|
|
234
284
|
* This checks full date-time equality (including time and time zone).
|
|
@@ -238,21 +288,29 @@ declare class RRuleTemporal {
|
|
|
238
288
|
* Convenience helper: true if any occurrence falls on the given calendar day
|
|
239
289
|
* in the rule's time zone. This ignores time-of-day granularity.
|
|
240
290
|
*/
|
|
241
|
-
occursOn(date:
|
|
291
|
+
occursOn(date: TemporalPlainDateInput): boolean;
|
|
242
292
|
/**
|
|
243
293
|
* Returns the next occurrence of the rule after a specified date.
|
|
244
294
|
* @param after - The start date or Temporal.ZonedDateTime object.
|
|
245
295
|
* @param inc - Optional boolean flag to include occurrences on the start date.
|
|
246
296
|
* @returns The next occurrence of the rule after the specified date or null if no occurrences are found.
|
|
247
297
|
*/
|
|
248
|
-
next(after?: DateFilter, inc?: boolean):
|
|
298
|
+
next(after?: DateFilter, inc?: boolean): TemporalZonedDateTime | null;
|
|
299
|
+
/**
|
|
300
|
+
* Build a temporary rule identical to this one but starting at the
|
|
301
|
+
* phase-aligned DTSTART for the given window start. The synthetic DTSTART
|
|
302
|
+
* only keeps includeDtstart semantics when it coincides with the original.
|
|
303
|
+
*/
|
|
304
|
+
private ruleFromAlignedDtstart;
|
|
249
305
|
/**
|
|
250
306
|
* Returns the previous occurrence of the rule before a specified date.
|
|
251
307
|
* @param before - The end date or Temporal.ZonedDateTime object.
|
|
252
308
|
* @param inc - Optional boolean flag to include occurrences on the end date.
|
|
253
309
|
* @returns The previous occurrence of the rule before the specified date or null if no occurrences are found.
|
|
254
310
|
*/
|
|
255
|
-
previous(before?: DateFilter, inc?: boolean):
|
|
311
|
+
previous(before?: DateFilter, inc?: boolean): TemporalZonedDateTime | null;
|
|
312
|
+
/** A duration of `count` steps in this rule's frequency unit. */
|
|
313
|
+
private freqDuration;
|
|
256
314
|
toString(): string;
|
|
257
315
|
private formatIcsDateTime;
|
|
258
316
|
private joinDates;
|
|
@@ -293,6 +351,8 @@ declare class RRuleTemporal {
|
|
|
293
351
|
private rscaleFirstWeekStart;
|
|
294
352
|
private rscaleLastWeekCount;
|
|
295
353
|
private lastDayOfMonth;
|
|
354
|
+
/** Convert an ambient ZonedDateTime into polyfill space for RSCALE math. */
|
|
355
|
+
private toRscaleZdt;
|
|
296
356
|
private buildZdtFromPlainDate;
|
|
297
357
|
private rscaleMatchesByYearDay;
|
|
298
358
|
private rscaleMatchesByWeekNo;
|
|
@@ -305,4 +365,4 @@ declare class RRuleTemporal {
|
|
|
305
365
|
private _allRscaleNonGregorian;
|
|
306
366
|
}
|
|
307
367
|
//#endregion
|
|
308
|
-
export { Freq, RRuleOptions, RRuleTemporal, Weekday, allowedFreq, allowedWeekdays, weekdayToIsoDay };
|
|
368
|
+
export { DateFilter, Freq, RRuleOptions, RRuleResolvedOptions, RRuleTemporal, RRuleTemporalIterator, TemporalPlainDate, TemporalPlainDateInput, TemporalZonedDateTime, TemporalZonedDateTimeInput, Weekday, allowedFreq, allowedWeekdays, weekdayToIsoDay };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Temporal } from "
|
|
1
|
+
import { Temporal } from "temporal-spec";
|
|
2
2
|
|
|
3
3
|
//#region src/RRuleTemporal.d.ts
|
|
4
4
|
declare const allowedFreq: readonly ["YEARLY", "MONTHLY", "WEEKLY", "DAILY", "HOURLY", "MINUTELY", "SECONDLY"];
|
|
@@ -22,12 +22,25 @@ interface BaseOpts {
|
|
|
22
22
|
rscale?: string;
|
|
23
23
|
/** SKIP behavior per RFC 7529: OMIT (default), BACKWARD, FORWARD (requires RSCALE). */
|
|
24
24
|
skip?: 'OMIT' | 'BACKWARD' | 'FORWARD';
|
|
25
|
+
/** Memoize the full occurrence list computed by all() (defaults to true). */
|
|
26
|
+
cache?: boolean;
|
|
25
27
|
}
|
|
28
|
+
type TemporalZonedDateTime = Temporal.ZonedDateTime;
|
|
29
|
+
type TemporalPlainDate = Temporal.PlainDate;
|
|
30
|
+
interface TemporalZonedDateTimeInput {
|
|
31
|
+
readonly timeZoneId: string;
|
|
32
|
+
toString(): string;
|
|
33
|
+
}
|
|
34
|
+
interface TemporalPlainDateInput {
|
|
35
|
+
toString(): string;
|
|
36
|
+
}
|
|
37
|
+
type RRuleTemporalIterator = (date: TemporalZonedDateTime, i: number) => boolean;
|
|
38
|
+
type DateFilter = Date | TemporalZonedDateTimeInput;
|
|
26
39
|
/**
|
|
27
40
|
* Manual rule definition following the recurrence rule parts defined in
|
|
28
41
|
* RFC 5545 §3.3.10.
|
|
29
42
|
*/
|
|
30
|
-
interface
|
|
43
|
+
interface ManualOptions extends BaseOpts {
|
|
31
44
|
/** FREQ: recurrence frequency */
|
|
32
45
|
freq: Freq;
|
|
33
46
|
/** INTERVAL between each occurrence of {@link freq} */
|
|
@@ -35,7 +48,7 @@ interface ManualOpts extends BaseOpts {
|
|
|
35
48
|
/** COUNT: total number of occurrences */
|
|
36
49
|
count?: number;
|
|
37
50
|
/** UNTIL: last possible occurrence */
|
|
38
|
-
until?:
|
|
51
|
+
until?: TemporalZonedDateTimeInput;
|
|
39
52
|
/** BYHOUR: hours to include (0-23) */
|
|
40
53
|
byHour?: number[];
|
|
41
54
|
/** BYMINUTE: minutes to include (0-59) */
|
|
@@ -57,27 +70,31 @@ interface ManualOpts extends BaseOpts {
|
|
|
57
70
|
/** WKST: weekday on which the week starts ("MO".."SU") */
|
|
58
71
|
wkst?: string;
|
|
59
72
|
/** RDATE: additional dates to include */
|
|
60
|
-
rDate?:
|
|
73
|
+
rDate?: TemporalZonedDateTimeInput[];
|
|
61
74
|
/** EXDATE: exception dates to exclude */
|
|
62
|
-
exDate?:
|
|
75
|
+
exDate?: TemporalZonedDateTimeInput[];
|
|
63
76
|
/** DTSTART: first occurrence */
|
|
64
|
-
dtstart:
|
|
77
|
+
dtstart: TemporalZonedDateTimeInput;
|
|
65
78
|
}
|
|
66
|
-
interface
|
|
79
|
+
interface IcsOptions extends BaseOpts {
|
|
67
80
|
rruleString: string;
|
|
68
|
-
dtstart?:
|
|
81
|
+
dtstart?: TemporalZonedDateTimeInput;
|
|
69
82
|
/** COUNT: total number of occurrences, used when missing from rruleString */
|
|
70
83
|
count?: number;
|
|
71
84
|
/** UNTIL: last possible occurrence, used when missing from rruleString */
|
|
72
|
-
until?:
|
|
85
|
+
until?: TemporalZonedDateTimeInput;
|
|
73
86
|
/** RDATE: additional dates to include */
|
|
74
|
-
rDate?:
|
|
87
|
+
rDate?: TemporalZonedDateTimeInput[];
|
|
75
88
|
/** EXDATE: exception dates to exclude */
|
|
76
|
-
exDate?:
|
|
89
|
+
exDate?: TemporalZonedDateTimeInput[];
|
|
77
90
|
}
|
|
78
|
-
type RRuleOptions =
|
|
79
|
-
type
|
|
80
|
-
|
|
91
|
+
type RRuleOptions = ManualOptions | IcsOptions;
|
|
92
|
+
type RRuleResolvedOptions = Omit<ManualOptions, 'dtstart' | 'until' | 'rDate' | 'exDate'> & {
|
|
93
|
+
dtstart: TemporalZonedDateTime;
|
|
94
|
+
until?: TemporalZonedDateTime;
|
|
95
|
+
rDate?: TemporalZonedDateTime[];
|
|
96
|
+
exDate?: TemporalZonedDateTime[];
|
|
97
|
+
};
|
|
81
98
|
declare class RRuleTemporal {
|
|
82
99
|
private readonly tzid;
|
|
83
100
|
private readonly originalDtstart;
|
|
@@ -91,12 +108,19 @@ declare class RRuleTemporal {
|
|
|
91
108
|
private readonly canUseEpochMillisecondsPrecisionFlag;
|
|
92
109
|
private readonly timeSlotOffsetsMs?;
|
|
93
110
|
private readonly numericByMonths?;
|
|
111
|
+
private exDateEpochNs?;
|
|
112
|
+
private allResultCache?;
|
|
113
|
+
private zoneResolver?;
|
|
114
|
+
private emitAnchorZdt?;
|
|
94
115
|
private static readonly rscaleCalendarSupport;
|
|
95
116
|
/**
|
|
96
117
|
* Normalize a ZonedDateTime to the polyfill implementation.
|
|
97
118
|
* This prevents type mismatches when mixing native and polyfill Temporal objects.
|
|
98
119
|
*/
|
|
99
120
|
private static normalizeToPolyfill;
|
|
121
|
+
private static toInternalIterator;
|
|
122
|
+
private static toPublicDate;
|
|
123
|
+
private static toPublicDates;
|
|
100
124
|
constructor(params: RRuleOptions);
|
|
101
125
|
private buildParsedByDayTokens;
|
|
102
126
|
private buildByDayIsoDays;
|
|
@@ -124,7 +148,7 @@ declare class RRuleTemporal {
|
|
|
124
148
|
private matchesByYearDay;
|
|
125
149
|
private getIsoWeekInfo;
|
|
126
150
|
private matchesByWeekNo;
|
|
127
|
-
options():
|
|
151
|
+
options(): RRuleResolvedOptions;
|
|
128
152
|
private cloneOptions;
|
|
129
153
|
private cloneUpdateOptions;
|
|
130
154
|
/**
|
|
@@ -135,7 +159,7 @@ declare class RRuleTemporal {
|
|
|
135
159
|
* const updated = rule.with({byMonthDay: [3]});
|
|
136
160
|
* ```
|
|
137
161
|
*/
|
|
138
|
-
with(updates: Partial<
|
|
162
|
+
with(updates: Partial<ManualOptions>): RRuleTemporal;
|
|
139
163
|
private addDtstartIfNeeded;
|
|
140
164
|
private canUseUtcLinearFastPath;
|
|
141
165
|
private canUseUtcWeeklyFastPath;
|
|
@@ -161,6 +185,23 @@ declare class RRuleTemporal {
|
|
|
161
185
|
private generateMonthlyOccurrenceDaysUtc;
|
|
162
186
|
private generateMonthlyOccurrenceEpochsUtc;
|
|
163
187
|
private _allUtcMonthlyByDayOrMonthDay;
|
|
188
|
+
private getZoneResolver;
|
|
189
|
+
private zdtFromEpochMs;
|
|
190
|
+
/** Local wall-clock ms (as-if-UTC) of a ZonedDateTime with ms precision. */
|
|
191
|
+
private wallMsOf;
|
|
192
|
+
private canUseTzEpochFastPaths;
|
|
193
|
+
/**
|
|
194
|
+
* True if the rule's nominal time of day can be skipped by a DST gap
|
|
195
|
+
* anywhere in the (estimated) iteration range. The general engine chains
|
|
196
|
+
* its cursor through gap days — even filtered-out ones — permanently
|
|
197
|
+
* shifting the time of day, so affected rules must use it for parity.
|
|
198
|
+
*/
|
|
199
|
+
private tzFastPathGapHazard;
|
|
200
|
+
private allTzEpochFastPath;
|
|
201
|
+
private _allTzDailySimple;
|
|
202
|
+
private _allTzFixedStepSimple;
|
|
203
|
+
private _allTzWeeklySimple;
|
|
204
|
+
private _allTzMonthlyByDayOrMonthDay;
|
|
164
205
|
private processOccurrences;
|
|
165
206
|
/**
|
|
166
207
|
* Returns all occurrences of the rule.
|
|
@@ -182,7 +223,8 @@ declare class RRuleTemporal {
|
|
|
182
223
|
* @param iterator - An optional callback iterator function that can be used to filter or modify the occurrences.
|
|
183
224
|
* @returns An array of Temporal.ZonedDateTime objects representing all occurrences of the rule.
|
|
184
225
|
*/
|
|
185
|
-
all(iterator?: RRuleTemporalIterator):
|
|
226
|
+
all(iterator?: RRuleTemporalIterator): TemporalZonedDateTime[];
|
|
227
|
+
private allInternal;
|
|
186
228
|
/**
|
|
187
229
|
* RFC 7529: RSCALE present, simple monthly iteration with SKIP behavior.
|
|
188
230
|
* Handles month-to-month stepping from DTSTART's year/month aiming for DTSTART's day-of-month.
|
|
@@ -225,10 +267,18 @@ declare class RRuleTemporal {
|
|
|
225
267
|
* Returns all occurrences of the rule within a specified time window.
|
|
226
268
|
* @param after - The start date or Temporal.ZonedDateTime object.
|
|
227
269
|
* @param before - The end date or Temporal.ZonedDateTime object.
|
|
228
|
-
* @param inc - Optional boolean flag to include the end
|
|
270
|
+
* @param inc - Optional boolean flag to include the start and end dates in the results.
|
|
229
271
|
* @returns An array of Temporal.ZonedDateTime objects representing all occurrences of the rule within the specified time window.
|
|
230
272
|
*/
|
|
231
|
-
between(after: DateFilter, before: DateFilter, inc?: boolean):
|
|
273
|
+
between(after: DateFilter, before: DateFilter, inc?: boolean): TemporalZonedDateTime[];
|
|
274
|
+
/**
|
|
275
|
+
* Compute a rule-phase-aligned DTSTART at or just before the given window
|
|
276
|
+
* start, jumping forward from the original DTSTART in whole multiples of
|
|
277
|
+
* INTERVAL. Lets window queries skip iterating occurrences before the
|
|
278
|
+
* window without disturbing cadence. Not valid for COUNT-limited rules,
|
|
279
|
+
* where the occurrence set depends on the index from the true DTSTART.
|
|
280
|
+
*/
|
|
281
|
+
private jumpAlignedDtstart;
|
|
232
282
|
/**
|
|
233
283
|
* Convenience helper: true if the exact instant is an occurrence of the rule.
|
|
234
284
|
* This checks full date-time equality (including time and time zone).
|
|
@@ -238,21 +288,29 @@ declare class RRuleTemporal {
|
|
|
238
288
|
* Convenience helper: true if any occurrence falls on the given calendar day
|
|
239
289
|
* in the rule's time zone. This ignores time-of-day granularity.
|
|
240
290
|
*/
|
|
241
|
-
occursOn(date:
|
|
291
|
+
occursOn(date: TemporalPlainDateInput): boolean;
|
|
242
292
|
/**
|
|
243
293
|
* Returns the next occurrence of the rule after a specified date.
|
|
244
294
|
* @param after - The start date or Temporal.ZonedDateTime object.
|
|
245
295
|
* @param inc - Optional boolean flag to include occurrences on the start date.
|
|
246
296
|
* @returns The next occurrence of the rule after the specified date or null if no occurrences are found.
|
|
247
297
|
*/
|
|
248
|
-
next(after?: DateFilter, inc?: boolean):
|
|
298
|
+
next(after?: DateFilter, inc?: boolean): TemporalZonedDateTime | null;
|
|
299
|
+
/**
|
|
300
|
+
* Build a temporary rule identical to this one but starting at the
|
|
301
|
+
* phase-aligned DTSTART for the given window start. The synthetic DTSTART
|
|
302
|
+
* only keeps includeDtstart semantics when it coincides with the original.
|
|
303
|
+
*/
|
|
304
|
+
private ruleFromAlignedDtstart;
|
|
249
305
|
/**
|
|
250
306
|
* Returns the previous occurrence of the rule before a specified date.
|
|
251
307
|
* @param before - The end date or Temporal.ZonedDateTime object.
|
|
252
308
|
* @param inc - Optional boolean flag to include occurrences on the end date.
|
|
253
309
|
* @returns The previous occurrence of the rule before the specified date or null if no occurrences are found.
|
|
254
310
|
*/
|
|
255
|
-
previous(before?: DateFilter, inc?: boolean):
|
|
311
|
+
previous(before?: DateFilter, inc?: boolean): TemporalZonedDateTime | null;
|
|
312
|
+
/** A duration of `count` steps in this rule's frequency unit. */
|
|
313
|
+
private freqDuration;
|
|
256
314
|
toString(): string;
|
|
257
315
|
private formatIcsDateTime;
|
|
258
316
|
private joinDates;
|
|
@@ -293,6 +351,8 @@ declare class RRuleTemporal {
|
|
|
293
351
|
private rscaleFirstWeekStart;
|
|
294
352
|
private rscaleLastWeekCount;
|
|
295
353
|
private lastDayOfMonth;
|
|
354
|
+
/** Convert an ambient ZonedDateTime into polyfill space for RSCALE math. */
|
|
355
|
+
private toRscaleZdt;
|
|
296
356
|
private buildZdtFromPlainDate;
|
|
297
357
|
private rscaleMatchesByYearDay;
|
|
298
358
|
private rscaleMatchesByWeekNo;
|
|
@@ -305,4 +365,4 @@ declare class RRuleTemporal {
|
|
|
305
365
|
private _allRscaleNonGregorian;
|
|
306
366
|
}
|
|
307
367
|
//#endregion
|
|
308
|
-
export { Freq, RRuleOptions, RRuleTemporal, Weekday, allowedFreq, allowedWeekdays, weekdayToIsoDay };
|
|
368
|
+
export { DateFilter, Freq, RRuleOptions, RRuleResolvedOptions, RRuleTemporal, RRuleTemporalIterator, TemporalPlainDate, TemporalPlainDateInput, TemporalZonedDateTime, TemporalZonedDateTimeInput, Weekday, allowedFreq, allowedWeekdays, weekdayToIsoDay };
|