calendaryjs 0.2.2 → 0.2.3

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.
@@ -0,0 +1,338 @@
1
+ 'use strict';
2
+
3
+ // src/builder/builder.ts
4
+ function date(month, day) {
5
+ return { type: "const", fields: { month, day } };
6
+ }
7
+ var WEEKDAYS = {
8
+ sunday: 0,
9
+ monday: 1,
10
+ tuesday: 2,
11
+ wednesday: 3,
12
+ thursday: 4,
13
+ friday: 5,
14
+ saturday: 6
15
+ };
16
+ var MONTHS = {
17
+ jan: 1,
18
+ feb: 2,
19
+ mar: 3,
20
+ apr: 4,
21
+ may: 5,
22
+ jun: 6,
23
+ jul: 7,
24
+ aug: 8,
25
+ sep: 9,
26
+ oct: 10,
27
+ nov: 11,
28
+ dec: 12
29
+ };
30
+ function nth(n, weekday, month) {
31
+ const m = typeof month === "number" ? month : MONTHS[month];
32
+ if (!m) throw new Error(`unknown month "${month}"`);
33
+ return { type: "nth-weekday", fields: { nth: n, dayOfWeek: WEEKDAYS[weekday], month: m } };
34
+ }
35
+ var PLURAL = {
36
+ days: "day",
37
+ weeks: "week",
38
+ months: "month",
39
+ years: "year"
40
+ };
41
+ var BaseBuilder = class {
42
+ payload = {};
43
+ explicitId;
44
+ title(value) {
45
+ this.payload.title = value;
46
+ return this;
47
+ }
48
+ id(value) {
49
+ this.explicitId = value;
50
+ return this;
51
+ }
52
+ priority(value) {
53
+ this.payload.priority = value;
54
+ return this;
55
+ }
56
+ description(value) {
57
+ this.payload.description = value;
58
+ return this;
59
+ }
60
+ location(value) {
61
+ this.payload.location = value;
62
+ return this;
63
+ }
64
+ url(value) {
65
+ this.payload.url = value;
66
+ return this;
67
+ }
68
+ color(value) {
69
+ this.payload.color = value;
70
+ return this;
71
+ }
72
+ icon(value) {
73
+ this.payload.icon = value;
74
+ return this;
75
+ }
76
+ source(value) {
77
+ this.payload.source = value;
78
+ return this;
79
+ }
80
+ status(value) {
81
+ this.payload.status = value;
82
+ return this;
83
+ }
84
+ allDay(value = true) {
85
+ this.payload.allDay = value;
86
+ return this;
87
+ }
88
+ /** Clock time(s): `.at("09:00")` or `.at("09:00", "10:30")`. */
89
+ at(start, end) {
90
+ this.payload.startTime = start;
91
+ if (end) this.payload.endTime = end;
92
+ return this;
93
+ }
94
+ /** Duration in minutes. */
95
+ duration(minutes) {
96
+ this.payload.duration = minutes;
97
+ return this;
98
+ }
99
+ keywords(...values) {
100
+ this.payload.keywords = values;
101
+ return this;
102
+ }
103
+ categories(...values) {
104
+ this.payload.categories = values;
105
+ return this;
106
+ }
107
+ /** Merge arbitrary metadata (later calls override earlier keys). */
108
+ metadata(data) {
109
+ const prev = this.payload.metadata ?? {};
110
+ this.payload.metadata = { ...prev, ...data };
111
+ return this;
112
+ }
113
+ /** A lead-time reminder before the occurrence. Accumulates. */
114
+ remind(before, opts) {
115
+ const trigger = (before.minutes ?? 0) + (before.hours ?? 0) * 60 + (before.days ?? 0) * 1440;
116
+ const reminders = this.payload.reminders ?? [];
117
+ reminders.push({
118
+ type: opts?.type ?? "notification",
119
+ trigger,
120
+ ...opts?.message ? { message: opts.message } : {}
121
+ });
122
+ this.payload.reminders = reminders;
123
+ return this;
124
+ }
125
+ /** Drop one occurrence (by its original date) → ICS EXDATE. */
126
+ skip(date2) {
127
+ this.exceptions()[date2] = { skip: true };
128
+ return this;
129
+ }
130
+ /** Replace properties for one occurrence → ICS RECURRENCE-ID. */
131
+ override(date2, props) {
132
+ this.exceptions()[date2] = { override: props };
133
+ return this;
134
+ }
135
+ /** Force-move one occurrence to another date. */
136
+ reschedule(fromDate, toDate) {
137
+ const map = this.payload.overrideDates ?? {};
138
+ map[fromDate] = toDate;
139
+ this.payload.overrideDates = map;
140
+ return this;
141
+ }
142
+ exceptions() {
143
+ const map = this.payload.exceptions ?? {};
144
+ this.payload.exceptions = map;
145
+ return map;
146
+ }
147
+ /** Explicit id, else a slug of the title, else throw. */
148
+ resolveId() {
149
+ const title = this.payload.title;
150
+ const id = this.explicitId ?? (title ? slug(title) : void 0);
151
+ if (!id) {
152
+ throw new Error("an event needs an .id(...), or a .title(...) to derive its id from");
153
+ }
154
+ return id;
155
+ }
156
+ };
157
+ var EventBuilder = class extends BaseBuilder {
158
+ constructor(unit, interval) {
159
+ super();
160
+ this.unit = unit;
161
+ this.interval = interval;
162
+ }
163
+ unit;
164
+ interval;
165
+ selectorType;
166
+ fields = {};
167
+ on(...selectors) {
168
+ if (selectors.length > 1 || typeof selectors[0] === "string") {
169
+ if (!selectors.every((s) => typeof s === "string")) {
170
+ throw new Error(`.on(...) lists weekdays together with non-weekday selectors`);
171
+ }
172
+ if (this.unit !== "week") {
173
+ throw new Error(`.on("${selectors[0]}") (a weekday) needs every("week")`);
174
+ }
175
+ const indices = selectors.map((w) => {
176
+ if (!(w in WEEKDAYS)) throw new Error(`unknown weekday "${w}"`);
177
+ return WEEKDAYS[w];
178
+ });
179
+ const unique = [...new Set(indices)].sort((a, b) => a - b);
180
+ this.selectorType = "weekly";
181
+ this.fields.dayOfWeek = unique.length === 1 ? unique[0] : unique;
182
+ return this;
183
+ }
184
+ const selector = selectors[0];
185
+ if (typeof selector === "number") {
186
+ if (this.unit !== "month") {
187
+ throw new Error(`.on(${selector}) (a day of month) needs every("month")`);
188
+ }
189
+ this.selectorType = "monthly";
190
+ this.fields.day = selector;
191
+ return this;
192
+ }
193
+ const sel = selector;
194
+ if (this.unit !== "year") throw new Error(`.on(<selector>) needs every("year")`);
195
+ this.selectorType = sel.type;
196
+ Object.assign(this.fields, sel.fields);
197
+ return this;
198
+ }
199
+ /** Bound the recurrence: numbers → year range, date strings → date range. */
200
+ between(start, end) {
201
+ if (typeof start === "number") {
202
+ this.fields.startYear = start;
203
+ this.fields.endYear = end;
204
+ } else {
205
+ this.fields.startDate = start;
206
+ this.fields.endDate = end;
207
+ }
208
+ return this;
209
+ }
210
+ /** Upper bound only: a number → endYear, a date string → endDate. */
211
+ until(end) {
212
+ if (typeof end === "number") this.fields.endYear = end;
213
+ else this.fields.endDate = end;
214
+ return this;
215
+ }
216
+ exceptYears(...years) {
217
+ this.fields.excludeYears = years;
218
+ return this;
219
+ }
220
+ exceptMonths(...months) {
221
+ this.fields.excludeMonths = months;
222
+ return this;
223
+ }
224
+ exceptDates(...dates) {
225
+ this.fields.excludeDates = dates;
226
+ return this;
227
+ }
228
+ build() {
229
+ if (!this.selectorType) {
230
+ throw new Error(`every("${this.unit}") needs a position \u2014 call .on(...)`);
231
+ }
232
+ const config = {
233
+ type: this.selectorType,
234
+ id: this.resolveId(),
235
+ ...this.fields,
236
+ ...this.payload
237
+ };
238
+ if (this.interval > 1) {
239
+ if (this.selectorType !== "weekly" && this.selectorType !== "monthly") {
240
+ throw new Error(
241
+ `every(${this.interval}, \u2026) is not supported for "${this.selectorType}" yet`
242
+ );
243
+ }
244
+ config.interval = this.interval;
245
+ }
246
+ return config;
247
+ }
248
+ };
249
+ var RelativeBuilder = class extends BaseBuilder {
250
+ constructor(anchor) {
251
+ super();
252
+ this.anchor = anchor;
253
+ }
254
+ anchor;
255
+ days = 0;
256
+ weeks = 0;
257
+ plus(offset) {
258
+ this.days += offset.days ?? 0;
259
+ this.weeks += offset.weeks ?? 0;
260
+ return this;
261
+ }
262
+ minus(offset) {
263
+ this.days -= offset.days ?? 0;
264
+ this.weeks -= offset.weeks ?? 0;
265
+ return this;
266
+ }
267
+ build() {
268
+ const offset = {};
269
+ if (this.days) offset.days = this.days;
270
+ if (this.weeks) offset.weeks = this.weeks;
271
+ return {
272
+ type: "relative",
273
+ id: this.resolveId(),
274
+ anchor: this.anchor,
275
+ offset,
276
+ ...this.payload
277
+ };
278
+ }
279
+ };
280
+ var FixedBuilder = class extends BaseBuilder {
281
+ constructor(dateStr) {
282
+ super();
283
+ this.dateStr = dateStr;
284
+ }
285
+ dateStr;
286
+ build() {
287
+ const [year, month, day] = this.dateStr.split("-").map(Number);
288
+ if (!year || !month || !day) {
289
+ throw new Error(`once("${this.dateStr}") needs a YYYY-MM-DD date`);
290
+ }
291
+ return {
292
+ type: "fixed",
293
+ id: this.resolveId(),
294
+ year,
295
+ month,
296
+ day,
297
+ ...this.payload
298
+ };
299
+ }
300
+ };
301
+ function every(a, b) {
302
+ if (typeof a === "number") {
303
+ const unit = PLURAL[b];
304
+ if (!unit) throw new Error(`unknown unit "${b}"`);
305
+ return new EventBuilder(unit, a);
306
+ }
307
+ return new EventBuilder(a, 1);
308
+ }
309
+ function from(anchor) {
310
+ return new RelativeBuilder(anchor);
311
+ }
312
+ function once(dateStr) {
313
+ return new FixedBuilder(dateStr);
314
+ }
315
+ function weekly(weekday, ...moreWeekdays) {
316
+ return every("week").on(weekday, ...moreWeekdays);
317
+ }
318
+ function monthly(day) {
319
+ return every("month").on(day);
320
+ }
321
+ function yearly(month, day) {
322
+ return every("year").on(date(month, day));
323
+ }
324
+ function slug(value) {
325
+ return value.toLowerCase().replace(/đ/g, "d").normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "event";
326
+ }
327
+
328
+ exports.EventBuilder = EventBuilder;
329
+ exports.FixedBuilder = FixedBuilder;
330
+ exports.RelativeBuilder = RelativeBuilder;
331
+ exports.date = date;
332
+ exports.every = every;
333
+ exports.from = from;
334
+ exports.monthly = monthly;
335
+ exports.nth = nth;
336
+ exports.once = once;
337
+ exports.weekly = weekly;
338
+ exports.yearly = yearly;
@@ -0,0 +1,153 @@
1
+ import { E as EventConfig } from '../events-Bm7R9XFB.cjs';
2
+
3
+ /**
4
+ * A position selector — passed to {@link EventBuilder.on}. It contributes the
5
+ * event `type` and its position fields. A plugin extends the `.on()` vocabulary
6
+ * simply by exporting a function that returns one (e.g. `pluginThing(a, b)` →
7
+ * `{ type: "plugin-type", fields: { ... } }`), so the builder hard-codes no
8
+ * calendar system.
9
+ */
10
+ interface Selector {
11
+ type: string;
12
+ fields: Record<string, unknown>;
13
+ }
14
+ /** Annual position → a `const` event. `date(12, 25)` = December 25th. */
15
+ declare function date(month: number, day: number): Selector;
16
+ declare const WEEKDAYS: {
17
+ readonly sunday: 0;
18
+ readonly monday: 1;
19
+ readonly tuesday: 2;
20
+ readonly wednesday: 3;
21
+ readonly thursday: 4;
22
+ readonly friday: 5;
23
+ readonly saturday: 6;
24
+ };
25
+ type Weekday = keyof typeof WEEKDAYS;
26
+ declare const MONTHS: {
27
+ readonly jan: 1;
28
+ readonly feb: 2;
29
+ readonly mar: 3;
30
+ readonly apr: 4;
31
+ readonly may: 5;
32
+ readonly jun: 6;
33
+ readonly jul: 7;
34
+ readonly aug: 8;
35
+ readonly sep: 9;
36
+ readonly oct: 10;
37
+ readonly nov: 11;
38
+ readonly dec: 12;
39
+ };
40
+ type MonthName = keyof typeof MONTHS;
41
+ /** Annual position → an `nth-weekday` event: `nth(2, "sunday", "may")`. */
42
+ declare function nth(n: 1 | 2 | 3 | 4 | -1, weekday: Weekday, month: MonthName | number): Selector;
43
+ type Unit = "day" | "week" | "month" | "year";
44
+ declare const PLURAL: Record<string, Unit>;
45
+ /** Shared payload + id tail for every builder. */
46
+ declare abstract class BaseBuilder {
47
+ protected readonly payload: Record<string, unknown>;
48
+ protected explicitId?: string;
49
+ title(value: string): this;
50
+ id(value: string): this;
51
+ priority(value: number): this;
52
+ description(value: string): this;
53
+ location(value: string): this;
54
+ url(value: string): this;
55
+ color(value: string): this;
56
+ icon(value: string): this;
57
+ source(value: string): this;
58
+ status(value: "confirmed" | "tentative" | "cancelled"): this;
59
+ allDay(value?: boolean): this;
60
+ /** Clock time(s): `.at("09:00")` or `.at("09:00", "10:30")`. */
61
+ at(start: string, end?: string): this;
62
+ /** Duration in minutes. */
63
+ duration(minutes: number): this;
64
+ keywords(...values: string[]): this;
65
+ categories(...values: string[]): this;
66
+ /** Merge arbitrary metadata (later calls override earlier keys). */
67
+ metadata(data: Record<string, unknown>): this;
68
+ /** A lead-time reminder before the occurrence. Accumulates. */
69
+ remind(before: {
70
+ minutes?: number;
71
+ hours?: number;
72
+ days?: number;
73
+ }, opts?: {
74
+ type?: "notification" | "email";
75
+ message?: string;
76
+ }): this;
77
+ /** Drop one occurrence (by its original date) → ICS EXDATE. */
78
+ skip(date: string): this;
79
+ /** Replace properties for one occurrence → ICS RECURRENCE-ID. */
80
+ override(date: string, props: Record<string, unknown>): this;
81
+ /** Force-move one occurrence to another date. */
82
+ reschedule(fromDate: string, toDate: string): this;
83
+ private exceptions;
84
+ /** Explicit id, else a slug of the title, else throw. */
85
+ protected resolveId(): string;
86
+ abstract build(): EventConfig;
87
+ }
88
+ /**
89
+ * Recurring/positional builder. The clause order mirrors the engine pipeline:
90
+ * cadence (`every`) → position (`.on`) → payload (`.title`/`.id`/…) → `build()`.
91
+ */
92
+ declare class EventBuilder extends BaseBuilder {
93
+ private readonly unit;
94
+ private readonly interval;
95
+ private selectorType?;
96
+ private readonly fields;
97
+ constructor(unit: Unit, interval: number);
98
+ /**
99
+ * Position within the cadence: a weekday name (or several), a day-of-month, or
100
+ * a selector. Several weekdays make a multi-day weekly — `every("week").on(
101
+ * "monday","wednesday","friday")` — fired on each, like an alarm's "Repeat".
102
+ */
103
+ on(weekday: Weekday, ...moreWeekdays: Weekday[]): this;
104
+ on(selector: Selector | number): this;
105
+ /** Bound the recurrence: numbers → year range, date strings → date range. */
106
+ between(start: number | string, end: number | string): this;
107
+ /** Upper bound only: a number → endYear, a date string → endDate. */
108
+ until(end: number | string): this;
109
+ exceptYears(...years: number[]): this;
110
+ exceptMonths(...months: number[]): this;
111
+ exceptDates(...dates: string[]): this;
112
+ build(): EventConfig;
113
+ }
114
+ /** Anchored builder: a date computed as an offset from a named anchor. */
115
+ declare class RelativeBuilder extends BaseBuilder {
116
+ private readonly anchor;
117
+ private days;
118
+ private weeks;
119
+ constructor(anchor: string);
120
+ plus(offset: {
121
+ days?: number;
122
+ weeks?: number;
123
+ }): this;
124
+ minus(offset: {
125
+ days?: number;
126
+ weeks?: number;
127
+ }): this;
128
+ build(): EventConfig;
129
+ }
130
+ /** One-time builder: a single fixed date. */
131
+ declare class FixedBuilder extends BaseBuilder {
132
+ private readonly dateStr;
133
+ constructor(dateStr: string);
134
+ build(): EventConfig;
135
+ }
136
+ /** Start a recurring event: `every("year")` or `every(2, "weeks")`. */
137
+ declare function every(unit: Unit): EventBuilder;
138
+ declare function every(interval: number, unit: keyof typeof PLURAL): EventBuilder;
139
+ /** Start a date relative to a registered anchor: `from("anchor").plus({ days: 49 })`. */
140
+ declare function from(anchor: string): RelativeBuilder;
141
+ /** A single fixed date: `once("2025-06-15")`. */
142
+ declare function once(dateStr: string): FixedBuilder;
143
+ /**
144
+ * `weekly("tuesday")` = `every("week").on("tuesday")`. Pass several weekdays for
145
+ * a multi-day weekly: `weekly("monday","wednesday","friday")`.
146
+ */
147
+ declare function weekly(weekday: Weekday, ...moreWeekdays: Weekday[]): EventBuilder;
148
+ /** `monthly(15)` = `every("month").on(15)`. */
149
+ declare function monthly(day: number): EventBuilder;
150
+ /** `yearly(12, 25)` = `every("year").on(date(12, 25))`. */
151
+ declare function yearly(month: number, day: number): EventBuilder;
152
+
153
+ export { EventBuilder, FixedBuilder, type MonthName, RelativeBuilder, type Selector, type Weekday, date, every, from, monthly, nth, once, weekly, yearly };
@@ -0,0 +1,153 @@
1
+ import { E as EventConfig } from '../events-Bm7R9XFB.js';
2
+
3
+ /**
4
+ * A position selector — passed to {@link EventBuilder.on}. It contributes the
5
+ * event `type` and its position fields. A plugin extends the `.on()` vocabulary
6
+ * simply by exporting a function that returns one (e.g. `pluginThing(a, b)` →
7
+ * `{ type: "plugin-type", fields: { ... } }`), so the builder hard-codes no
8
+ * calendar system.
9
+ */
10
+ interface Selector {
11
+ type: string;
12
+ fields: Record<string, unknown>;
13
+ }
14
+ /** Annual position → a `const` event. `date(12, 25)` = December 25th. */
15
+ declare function date(month: number, day: number): Selector;
16
+ declare const WEEKDAYS: {
17
+ readonly sunday: 0;
18
+ readonly monday: 1;
19
+ readonly tuesday: 2;
20
+ readonly wednesday: 3;
21
+ readonly thursday: 4;
22
+ readonly friday: 5;
23
+ readonly saturday: 6;
24
+ };
25
+ type Weekday = keyof typeof WEEKDAYS;
26
+ declare const MONTHS: {
27
+ readonly jan: 1;
28
+ readonly feb: 2;
29
+ readonly mar: 3;
30
+ readonly apr: 4;
31
+ readonly may: 5;
32
+ readonly jun: 6;
33
+ readonly jul: 7;
34
+ readonly aug: 8;
35
+ readonly sep: 9;
36
+ readonly oct: 10;
37
+ readonly nov: 11;
38
+ readonly dec: 12;
39
+ };
40
+ type MonthName = keyof typeof MONTHS;
41
+ /** Annual position → an `nth-weekday` event: `nth(2, "sunday", "may")`. */
42
+ declare function nth(n: 1 | 2 | 3 | 4 | -1, weekday: Weekday, month: MonthName | number): Selector;
43
+ type Unit = "day" | "week" | "month" | "year";
44
+ declare const PLURAL: Record<string, Unit>;
45
+ /** Shared payload + id tail for every builder. */
46
+ declare abstract class BaseBuilder {
47
+ protected readonly payload: Record<string, unknown>;
48
+ protected explicitId?: string;
49
+ title(value: string): this;
50
+ id(value: string): this;
51
+ priority(value: number): this;
52
+ description(value: string): this;
53
+ location(value: string): this;
54
+ url(value: string): this;
55
+ color(value: string): this;
56
+ icon(value: string): this;
57
+ source(value: string): this;
58
+ status(value: "confirmed" | "tentative" | "cancelled"): this;
59
+ allDay(value?: boolean): this;
60
+ /** Clock time(s): `.at("09:00")` or `.at("09:00", "10:30")`. */
61
+ at(start: string, end?: string): this;
62
+ /** Duration in minutes. */
63
+ duration(minutes: number): this;
64
+ keywords(...values: string[]): this;
65
+ categories(...values: string[]): this;
66
+ /** Merge arbitrary metadata (later calls override earlier keys). */
67
+ metadata(data: Record<string, unknown>): this;
68
+ /** A lead-time reminder before the occurrence. Accumulates. */
69
+ remind(before: {
70
+ minutes?: number;
71
+ hours?: number;
72
+ days?: number;
73
+ }, opts?: {
74
+ type?: "notification" | "email";
75
+ message?: string;
76
+ }): this;
77
+ /** Drop one occurrence (by its original date) → ICS EXDATE. */
78
+ skip(date: string): this;
79
+ /** Replace properties for one occurrence → ICS RECURRENCE-ID. */
80
+ override(date: string, props: Record<string, unknown>): this;
81
+ /** Force-move one occurrence to another date. */
82
+ reschedule(fromDate: string, toDate: string): this;
83
+ private exceptions;
84
+ /** Explicit id, else a slug of the title, else throw. */
85
+ protected resolveId(): string;
86
+ abstract build(): EventConfig;
87
+ }
88
+ /**
89
+ * Recurring/positional builder. The clause order mirrors the engine pipeline:
90
+ * cadence (`every`) → position (`.on`) → payload (`.title`/`.id`/…) → `build()`.
91
+ */
92
+ declare class EventBuilder extends BaseBuilder {
93
+ private readonly unit;
94
+ private readonly interval;
95
+ private selectorType?;
96
+ private readonly fields;
97
+ constructor(unit: Unit, interval: number);
98
+ /**
99
+ * Position within the cadence: a weekday name (or several), a day-of-month, or
100
+ * a selector. Several weekdays make a multi-day weekly — `every("week").on(
101
+ * "monday","wednesday","friday")` — fired on each, like an alarm's "Repeat".
102
+ */
103
+ on(weekday: Weekday, ...moreWeekdays: Weekday[]): this;
104
+ on(selector: Selector | number): this;
105
+ /** Bound the recurrence: numbers → year range, date strings → date range. */
106
+ between(start: number | string, end: number | string): this;
107
+ /** Upper bound only: a number → endYear, a date string → endDate. */
108
+ until(end: number | string): this;
109
+ exceptYears(...years: number[]): this;
110
+ exceptMonths(...months: number[]): this;
111
+ exceptDates(...dates: string[]): this;
112
+ build(): EventConfig;
113
+ }
114
+ /** Anchored builder: a date computed as an offset from a named anchor. */
115
+ declare class RelativeBuilder extends BaseBuilder {
116
+ private readonly anchor;
117
+ private days;
118
+ private weeks;
119
+ constructor(anchor: string);
120
+ plus(offset: {
121
+ days?: number;
122
+ weeks?: number;
123
+ }): this;
124
+ minus(offset: {
125
+ days?: number;
126
+ weeks?: number;
127
+ }): this;
128
+ build(): EventConfig;
129
+ }
130
+ /** One-time builder: a single fixed date. */
131
+ declare class FixedBuilder extends BaseBuilder {
132
+ private readonly dateStr;
133
+ constructor(dateStr: string);
134
+ build(): EventConfig;
135
+ }
136
+ /** Start a recurring event: `every("year")` or `every(2, "weeks")`. */
137
+ declare function every(unit: Unit): EventBuilder;
138
+ declare function every(interval: number, unit: keyof typeof PLURAL): EventBuilder;
139
+ /** Start a date relative to a registered anchor: `from("anchor").plus({ days: 49 })`. */
140
+ declare function from(anchor: string): RelativeBuilder;
141
+ /** A single fixed date: `once("2025-06-15")`. */
142
+ declare function once(dateStr: string): FixedBuilder;
143
+ /**
144
+ * `weekly("tuesday")` = `every("week").on("tuesday")`. Pass several weekdays for
145
+ * a multi-day weekly: `weekly("monday","wednesday","friday")`.
146
+ */
147
+ declare function weekly(weekday: Weekday, ...moreWeekdays: Weekday[]): EventBuilder;
148
+ /** `monthly(15)` = `every("month").on(15)`. */
149
+ declare function monthly(day: number): EventBuilder;
150
+ /** `yearly(12, 25)` = `every("year").on(date(12, 25))`. */
151
+ declare function yearly(month: number, day: number): EventBuilder;
152
+
153
+ export { EventBuilder, FixedBuilder, type MonthName, RelativeBuilder, type Selector, type Weekday, date, every, from, monthly, nth, once, weekly, yearly };