ical-generator 10.2.0-develop.2 → 10.2.0-develop.4

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 DELETED
@@ -1,2446 +0,0 @@
1
- declare enum ICalAttendeeRole {
2
- CHAIR = "CHAIR",
3
- NON = "NON-PARTICIPANT",
4
- OPT = "OPT-PARTICIPANT",
5
- REQ = "REQ-PARTICIPANT"
6
- }
7
- declare enum ICalAttendeeScheduleAgent {
8
- CLIENT = "CLIENT",
9
- NONE = "NONE",
10
- SERVER = "SERVER"
11
- }
12
- declare enum ICalAttendeeStatus {
13
- ACCEPTED = "ACCEPTED",
14
- DECLINED = "DECLINED",
15
- DELEGATED = "DELEGATED",
16
- NEEDSACTION = "NEEDS-ACTION",
17
- TENTATIVE = "TENTATIVE"
18
- }
19
- declare enum ICalAttendeeType {
20
- GROUP = "GROUP",
21
- INDIVIDUAL = "INDIVIDUAL",
22
- RESOURCE = "RESOURCE",
23
- ROOM = "ROOM",
24
- UNKNOWN = "UNKNOWN"
25
- }
26
- interface ICalAttendeeData {
27
- delegatedFrom?: ICalAttendee | ICalAttendeeData | null | string;
28
- delegatedTo?: ICalAttendee | ICalAttendeeData | null | string;
29
- delegatesFrom?: ICalAttendee | ICalAttendeeData | null | string;
30
- delegatesTo?: ICalAttendee | ICalAttendeeData | null | string;
31
- email: string;
32
- mailto?: null | string;
33
- name?: null | string;
34
- role?: ICalAttendeeRole;
35
- rsvp?: boolean | null;
36
- scheduleAgent?: ICalAttendeeScheduleAgent | ICalXName | null;
37
- sentBy?: null | string;
38
- status?: ICalAttendeeStatus | null;
39
- type?: ICalAttendeeType | null;
40
- x?: [string, string][] | Record<string, string> | {
41
- key: string;
42
- value: string;
43
- }[];
44
- }
45
- interface ICalAttendeeJSONData {
46
- delegatedFrom: null | string;
47
- delegatedTo: null | string;
48
- email: string;
49
- mailto: null | string;
50
- name: null | string;
51
- role: ICalAttendeeRole;
52
- rsvp: boolean | null;
53
- sentBy: null | string;
54
- status: ICalAttendeeStatus | null;
55
- type: ICalAttendeeType | null;
56
- x: {
57
- key: string;
58
- value: string;
59
- }[];
60
- }
61
- type ICalXName = `X-${string}`;
62
- /**
63
- * Usually you get an {@link ICalAttendee} object like this:
64
- *
65
- * ```javascript
66
- * import ical from 'ical-generator';
67
- * const calendar = ical();
68
- * const event = calendar.createEvent();
69
- * const attendee = event.createAttendee({ email: 'mail@example.com' });
70
- * ```
71
- *
72
- * You can also use the {@link ICalAttendee} object directly:
73
- *
74
- * ```javascript
75
- * import ical, {ICalAttendee} from 'ical-generator';
76
- * const attendee = new ICalAttendee({ email: 'mail@example.com' });
77
- * event.attendees([attendee]);
78
- * ```
79
- */
80
- declare class ICalAttendee {
81
- private readonly data;
82
- private readonly parent;
83
- /**
84
- * Constructor of {@link ICalAttendee}. The event reference is
85
- * required to query the calendar's timezone when required.
86
- *
87
- * @param data Attendee Data
88
- * @param parent Reference to ICalEvent object
89
- */
90
- constructor(data: ICalAttendeeData, parent: ICalAlarm | ICalEvent);
91
- /**
92
- * Get the attendee's delegated-from field
93
- * @since 0.2.0
94
- */
95
- delegatedFrom(): ICalAttendee | null;
96
- /**
97
- * Set the attendee's delegated-from field
98
- *
99
- * Creates a new Attendee if the passed object is not already a
100
- * {@link ICalAttendee} object. Will set the `delegatedTo` and
101
- * `delegatedFrom` attributes.
102
- *
103
- * @param delegatedFrom
104
- */
105
- delegatedFrom(delegatedFrom: ICalAttendee | ICalAttendeeData | null | string): this;
106
- /**
107
- * Get the attendee's delegated-to value.
108
- * @since 0.2.0
109
- */
110
- delegatedTo(): ICalAttendee | null;
111
- /**
112
- * Set the attendee's delegated-to field.
113
- *
114
- * Creates a new Attendee if the passed object is not already a
115
- * {@link ICalAttendee} object. Will set the `delegatedTo` and
116
- * `delegatedFrom` attributes.
117
- *
118
- * Will also set the `status` to `DELEGATED`, if attribute is set.
119
- *
120
- * ```javascript
121
- * const cal = ical();
122
- * const event = cal.createEvent();
123
- * const attendee = cal.createAttendee();
124
- *
125
- * attendee.delegatesTo({email: 'foo@bar.com', name: 'Foo'});
126
- ```
127
- *
128
- * @since 0.2.0
129
- */
130
- delegatedTo(delegatedTo: ICalAttendee | ICalAttendeeData | null | string): this;
131
- /**
132
- * Create a new attendee this attendee delegates from and returns
133
- * this new attendee. Creates a new attendee if the passed object
134
- * is not already an {@link ICalAttendee}.
135
- *
136
- * ```javascript
137
- * const cal = ical();
138
- * const event = cal.createEvent();
139
- * const attendee = cal.createAttendee();
140
- *
141
- * attendee.delegatesFrom({email: 'foo@bar.com', name: 'Foo'});
142
- * ```
143
- *
144
- * @since 0.2.0
145
- */
146
- delegatesFrom(options: ICalAttendee | ICalAttendeeData | string): ICalAttendee;
147
- /**
148
- * Create a new attendee this attendee delegates to and returns
149
- * this new attendee. Creates a new attendee if the passed object
150
- * is not already an {@link ICalAttendee}.
151
- *
152
- * ```javascript
153
- * const cal = ical();
154
- * const event = cal.createEvent();
155
- * const attendee = cal.createAttendee();
156
- *
157
- * attendee.delegatesTo({email: 'foo@bar.com', name: 'Foo'});
158
- * ```
159
- *
160
- * @since 0.2.0
161
- */
162
- delegatesTo(options: ICalAttendee | ICalAttendeeData | string): ICalAttendee;
163
- /**
164
- * Get the attendee's email address
165
- * @since 0.2.0
166
- */
167
- email(): string;
168
- /**
169
- * Set the attendee's email address
170
- * @since 0.2.0
171
- */
172
- email(email: string): this;
173
- /**
174
- * Get the attendee's email address
175
- * @since 1.3.0
176
- */
177
- mailto(): null | string;
178
- /**
179
- * Set the attendee's email address
180
- * @since 1.3.0
181
- */
182
- mailto(mailto: null | string): this;
183
- /**
184
- * Get the attendee's name
185
- * @since 0.2.0
186
- */
187
- name(): null | string;
188
- /**
189
- * Set the attendee's name
190
- * @since 0.2.0
191
- */
192
- name(name: null | string): this;
193
- /**
194
- * Get attendee's role
195
- * @since 0.2.0
196
- */
197
- role(): ICalAttendeeRole;
198
- /**
199
- * Set the attendee's role, defaults to `REQ` / `REQ-PARTICIPANT`.
200
- * Checkout {@link ICalAttendeeRole} for available roles.
201
- *
202
- * @since 0.2.0
203
- */
204
- role(role: ICalAttendeeRole): this;
205
- /**
206
- * Get attendee's RSVP expectation
207
- * @since 0.2.1
208
- */
209
- rsvp(): boolean | null;
210
- /**
211
- * Set the attendee's RSVP expectation
212
- * @since 0.2.1
213
- */
214
- rsvp(rsvp: boolean | null): this;
215
- /**
216
- * Get attendee's schedule agent
217
- * @since 9.0.0
218
- */
219
- scheduleAgent(): ICalAttendeeScheduleAgent | ICalXName;
220
- /**
221
- * Set attendee's schedule agent
222
- * See {@link ICalAttendeeScheduleAgent} for available values.
223
- * You can also use custom X-* values.
224
- *
225
- * @since 9.0.0
226
- */
227
- scheduleAgent(scheduleAgent: ICalAttendeeScheduleAgent | ICalXName | null): this;
228
- /**
229
- * Get the acting user's email adress
230
- * @since 3.3.0
231
- */
232
- sentBy(): null | string;
233
- /**
234
- * Set the acting user's email adress
235
- * @since 3.3.0
236
- */
237
- sentBy(email: null | string): this;
238
- /**
239
- * Get attendee's status
240
- * @since 0.2.0
241
- */
242
- status(): ICalAttendeeStatus | null;
243
- /**
244
- * Set the attendee's status. See {@link ICalAttendeeStatus}
245
- * for available status options.
246
- *
247
- * @since 0.2.0
248
- */
249
- status(status: ICalAttendeeStatus | null): this;
250
- /**
251
- * Return a shallow copy of the attendee's options for JSON stringification.
252
- * Can be used for persistence.
253
- *
254
- * @since 0.2.4
255
- */
256
- toJSON(): ICalAttendeeJSONData;
257
- /**
258
- * Return generated attendee as a string.
259
- *
260
- * ```javascript
261
- * console.log(attendee.toString()); // → ATTENDEE;ROLE=…
262
- * ```
263
- */
264
- toString(): string;
265
- /**
266
- * Get attendee's type (a.k.a. CUTYPE)
267
- * @since 0.2.3
268
- */
269
- type(): ICalAttendeeType;
270
- /**
271
- * Set attendee's type (a.k.a. CUTYPE).
272
- * See {@link ICalAttendeeType} for available status options.
273
- *
274
- * @since 0.2.3
275
- */
276
- type(type: ICalAttendeeType | null): this;
277
- /**
278
- * Set X-* attributes. Woun't filter double attributes,
279
- * which are also added by another method (e.g. status),
280
- * so these attributes may be inserted twice.
281
- *
282
- * ```javascript
283
- * attendee.x([
284
- * {
285
- * key: "X-MY-CUSTOM-ATTR",
286
- * value: "1337!"
287
- * }
288
- * ]);
289
- *
290
- * attendee.x([
291
- * ["X-MY-CUSTOM-ATTR", "1337!"]
292
- * ]);
293
- *
294
- * attendee.x({
295
- * "X-MY-CUSTOM-ATTR": "1337!"
296
- * });
297
- * ```
298
- *
299
- * @since 1.9.0
300
- */
301
- x(keyOrArray: [string, string][] | Record<string, string> | {
302
- key: string;
303
- value: string;
304
- }[]): this;
305
- /**
306
- * Set a X-* attribute. Woun't filter double attributes,
307
- * which are also added by another method (e.g. status),
308
- * so these attributes may be inserted twice.
309
- *
310
- * ```javascript
311
- * attendee.x("X-MY-CUSTOM-ATTR", "1337!");
312
- * ```
313
- *
314
- * @since 1.9.0
315
- */
316
- x(keyOrArray: string, value: string): this;
317
- /**
318
- * Get all custom X-* attributes.
319
- * @since 1.9.0
320
- */
321
- x(): {
322
- key: string;
323
- value: string;
324
- }[];
325
- }
326
-
327
- declare enum ICalEventRepeatingFreq {
328
- DAILY = "DAILY",
329
- HOURLY = "HOURLY",
330
- MINUTELY = "MINUTELY",
331
- MONTHLY = "MONTHLY",
332
- SECONDLY = "SECONDLY",
333
- WEEKLY = "WEEKLY",
334
- YEARLY = "YEARLY"
335
- }
336
- declare enum ICalWeekday {
337
- FR = "FR",
338
- MO = "MO",
339
- SA = "SA",
340
- SU = "SU",
341
- TH = "TH",
342
- TU = "TU",
343
- WE = "WE"
344
- }
345
- /**
346
- * ical-generator supports [native Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date),
347
- * [moment.js](https://momentjs.com/) (and [moment-timezone](https://momentjs.com/timezone/), [Day.js](https://day.js.org/en/),
348
- * [Luxon](https://moment.github.io/luxon/)'s [DateTime](https://moment.github.io/luxon/docs/class/src/datetime.js~DateTime.html)
349
- * and [Temporal](https://tc39.es/proposal-temporal/docs/) objects. You can also pass a string which is then passed to javascript's Date internally.
350
- */
351
- type ICalDateTimeValue = Date | ICalDayJsStub | ICalLuxonDateTimeStub | ICalMomentStub | ICalMomentTimezoneStub | ICalTemporalInstantStub | ICalTemporalPlainDateStub | ICalTemporalPlainDateTimeStub | ICalTemporalZonedDateTimeStub | string;
352
- interface ICalDayJsStub {
353
- format(format?: string): string;
354
- isValid(): boolean;
355
- toDate(): Date;
356
- toJSON(): string;
357
- tz?(zone?: string): ICalDayJsStub;
358
- utc?(): ICalDayJsStub;
359
- }
360
- interface ICalDescription {
361
- html?: string;
362
- plain: string;
363
- }
364
- interface ICalGeo {
365
- lat: number;
366
- lon: number;
367
- }
368
- type ICalLocation = ICalLocationWithoutTitle | ICalLocationWithTitle;
369
- interface ICalLocationWithoutTitle {
370
- geo: ICalGeo;
371
- }
372
- interface ICalLocationWithTitle {
373
- address?: string;
374
- geo?: ICalGeo;
375
- radius?: number;
376
- title: string;
377
- }
378
- interface ICalLuxonDateTimeStub {
379
- get isValid(): boolean;
380
- setZone(zone?: string): ICalLuxonDateTimeStub;
381
- toFormat(fmt: string): string;
382
- toJSDate(): Date;
383
- toJSON(): null | string;
384
- zone: {
385
- type: string;
386
- };
387
- }
388
- interface ICalMomentDurationStub {
389
- asSeconds(): number;
390
- }
391
- interface ICalMomentStub {
392
- clone(): ICalMomentStub;
393
- format(format?: string): string;
394
- isValid(): boolean;
395
- toDate(): Date;
396
- toJSON(): string;
397
- utc(): ICalMomentStub;
398
- }
399
- interface ICalMomentTimezoneStub extends ICalMomentStub {
400
- clone(): ICalMomentTimezoneStub;
401
- tz(): string | undefined;
402
- tz(timezone: string): ICalMomentTimezoneStub;
403
- utc(): ICalMomentTimezoneStub;
404
- }
405
- interface ICalOrganizer {
406
- email: string;
407
- mailto?: string;
408
- name: string;
409
- sentBy?: string;
410
- }
411
- interface ICalRepeatingOptions {
412
- byDay?: ICalWeekday | ICalWeekday[];
413
- byMonth?: number | number[];
414
- byMonthDay?: number | number[];
415
- bySetPos?: number | number[];
416
- count?: number;
417
- exclude?: ICalDateTimeValue | ICalDateTimeValue[];
418
- freq: ICalEventRepeatingFreq;
419
- interval?: number;
420
- startOfWeek?: ICalWeekday;
421
- until?: ICalDateTimeValue;
422
- }
423
- interface ICalRRuleStub {
424
- between(after: Date, before: Date, inc?: boolean, iterator?: (d: Date, len: number) => boolean): Date[];
425
- toString(): string;
426
- }
427
- interface ICalTemporalInstantStub {
428
- epochMilliseconds: number;
429
- epochSeconds?: number;
430
- toJSON(): string;
431
- toString(): string;
432
- toZonedDateTimeISO(timeZone: string): ICalTemporalZonedDateTimeStub;
433
- }
434
- interface ICalTemporalPlainDateStub {
435
- day: number;
436
- month: number;
437
- toJSON(): string;
438
- toString(): string;
439
- year: number;
440
- }
441
- interface ICalTemporalPlainDateTimeStub {
442
- day: number;
443
- hour: number;
444
- minute: number;
445
- month: number;
446
- second: number;
447
- toJSON(): string;
448
- toPlainDate(): ICalTemporalPlainDateStub;
449
- toString(): string;
450
- toZonedDateTime(timeZone: string): ICalTemporalZonedDateTimeStub;
451
- year: number;
452
- }
453
- interface ICalTemporalZonedDateTimeStub {
454
- day: number;
455
- hour: number;
456
- minute: number;
457
- month: number;
458
- second: number;
459
- timeZoneId: string;
460
- toInstant(): ICalTemporalInstantStub;
461
- toJSON(): string;
462
- toPlainDateTime(): ICalTemporalPlainDateTimeStub;
463
- toString(): string;
464
- withTimeZone(timeZone: string): ICalTemporalZonedDateTimeStub;
465
- year: number;
466
- }
467
- interface ICalTimezone {
468
- generator?: (timezone: string) => null | string;
469
- name: null | string;
470
- }
471
- interface ICalTZDateStub extends Date {
472
- timeZone?: string;
473
- withTimeZone(timezone?: null | string): ICalTZDateStub;
474
- }
475
-
476
- declare enum ICalAlarmType {
477
- audio = "audio",
478
- display = "display",
479
- email = "email"
480
- }
481
- interface ICalAlarmBaseData {
482
- attach?: ICalAttachment | null | string;
483
- attendees?: ICalAttendee[] | ICalAttendeeData[];
484
- description?: null | string;
485
- relatesTo?: ICalAlarmRelatesTo | null;
486
- repeat?: ICalAlarmRepeatData | null;
487
- summary?: null | string;
488
- type?: ICalAlarmType;
489
- x?: [string, string][] | Record<string, string> | {
490
- key: string;
491
- value: string;
492
- }[];
493
- }
494
- type ICalAlarmData = ICalAlarmBaseData | ICalAlarmTriggerAfterData | ICalAlarmTriggerBeforeData | ICalAlarmTriggerData;
495
- interface ICalAlarmJSONData {
496
- attach: ICalAttachment | null;
497
- attendees: ICalAttendee[];
498
- description: null | string;
499
- interval: null | number;
500
- relatesTo: ICalAlarmRelatesTo | null;
501
- repeat: ICalAlarmRepeatData | null;
502
- summary: null | string;
503
- trigger: number | string;
504
- type: ICalAlarmType;
505
- x: {
506
- key: string;
507
- value: string;
508
- }[];
509
- }
510
- declare const ICalAlarmRelatesTo: {
511
- readonly end: "END";
512
- readonly start: "START";
513
- };
514
- type ICalAlarmRelatesTo = (typeof ICalAlarmRelatesTo)[keyof typeof ICalAlarmRelatesTo];
515
- interface ICalAlarmRepeatData {
516
- interval: number;
517
- times: number;
518
- }
519
- type ICalAlarmTriggerAfterData = ICalAlarmBaseData & {
520
- triggerAfter: ICalDateTimeValue | number;
521
- };
522
- type ICalAlarmTriggerBeforeData = ICalAlarmBaseData & {
523
- triggerBefore: ICalDateTimeValue | number;
524
- };
525
- type ICalAlarmTriggerData = ICalAlarmBaseData & {
526
- trigger: ICalDateTimeValue | number;
527
- };
528
- type ICalAlarmTypeValue = keyof ICalAlarmType;
529
- interface ICalAttachment {
530
- mime: null | string;
531
- uri: string;
532
- }
533
- /**
534
- * Usually you get an {@link ICalAlarm} object like this:
535
- *
536
- * ```javascript
537
- * import ical from 'ical-generator';
538
- * const calendar = ical();
539
- * const event = calendar.createEvent();
540
- * const alarm = event.createAlarm();
541
- * ```
542
- *
543
- * You can also use the {@link ICalAlarm} object directly:
544
- *
545
- * ```javascript
546
- * import ical, {ICalAlarm} from 'ical-generator';
547
- * const alarm = new ICalAlarm();
548
- * event.alarms([alarm]);
549
- * ```
550
- */
551
- declare class ICalAlarm {
552
- private readonly data;
553
- private readonly event;
554
- /**
555
- * Constructor of {@link ICalAttendee}. The event reference is required
556
- * to query the calendar's timezone and summary when required.
557
- *
558
- * @param data Alarm Data
559
- * @param event Reference to ICalEvent object
560
- */
561
- constructor(data: ICalAlarmData, event: ICalEvent);
562
- /**
563
- * Get Attachment
564
- * @since 0.2.1
565
- */
566
- attach(): null | {
567
- mime: null | string;
568
- uri: string;
569
- };
570
- /**
571
- * Set Alarm attachment. Used to set the alarm sound
572
- * if alarm type is audio. Defaults to "Basso".
573
- *
574
- * ```javascript
575
- * const cal = ical();
576
- * const event = cal.createEvent();
577
- *
578
- * event.createAlarm({
579
- * attach: 'https://example.com/notification.aud'
580
- * });
581
- *
582
- * // OR
583
- *
584
- * event.createAlarm({
585
- * attach: {
586
- * uri: 'https://example.com/notification.aud',
587
- * mime: 'audio/basic'
588
- * }
589
- * });
590
- * ```
591
- *
592
- * @since 0.2.1
593
- */
594
- attach(attachment: null | string | {
595
- mime?: null | string;
596
- uri: string;
597
- }): this;
598
- /**
599
- * Get all attendees
600
- * @since 7.0.0
601
- */
602
- attendees(): ICalAttendee[];
603
- /**
604
- * Add multiple attendees to your event
605
- *
606
- * @since 7.0.0
607
- */
608
- attendees(attendees: (ICalAttendee | ICalAttendeeData | string)[]): this;
609
- /**
610
- * Creates a new {@link ICalAttendee} and returns it. Use options to prefill
611
- * the attendee's attributes. Calling this method without options will create
612
- * an empty attendee.
613
- *
614
- * @since 7.0.0
615
- */
616
- createAttendee(data: ICalAttendee | ICalAttendeeData | string): ICalAttendee;
617
- /**
618
- * Get the alarm description. Used to set the alarm message
619
- * if alarm type is `display`. If the alarm type is `email`, it's
620
- * used to set the email body. Defaults to the event's summary.
621
- *
622
- * @since 0.2.1
623
- */
624
- description(): null | string;
625
- /**
626
- * Set the alarm description. Used to set the alarm message
627
- * if alarm type is `display`. If the alarm type is `email`, it's
628
- * used to set the email body. Defaults to the event's summary.
629
- *
630
- * @since 0.2.1
631
- */
632
- description(description: null | string): this;
633
- /**
634
- * Get to which time alarm trigger relates to.
635
- * Can be either `START` or `END`. If the value is
636
- * `START` the alarm is triggerd relative to the event start time.
637
- * If the value is `END` the alarm is triggerd relative to the event end time
638
- *
639
- * @since 4.0.1
640
- */
641
- relatesTo(): ICalAlarmRelatesTo | null;
642
- /**
643
- * Use this method to set to which time alarm trigger relates to.
644
- * Works only if trigger is a `number`
645
- *
646
- * ```javascript
647
- * const cal = ical();
648
- * const event = cal.createEvent();
649
- * const alarm = cal.createAlarm();
650
- *
651
- * alarm.trigger(600); // -> 10 minutes before event starts
652
- *
653
- * alarm.relatesTo('START'); // -> 10 minutes before event starts
654
- * alarm.relatesTo('END'); // -> 10 minutes before event ends
655
- *
656
- * alarm.trigger(-600); // -> 10 minutes after event starts
657
- *
658
- * alarm.relatesTo('START'); // -> 10 minutes after event starts
659
- * alarm.relatesTo('END'); // -> 10 minutes after event ends
660
- * ```
661
- * @since 4.0.1
662
- */
663
- relatesTo(relatesTo: ICalAlarmRelatesTo | null): this;
664
- /**
665
- * Get Alarm Repetitions
666
- * @since 0.2.1
667
- */
668
- repeat(): ICalAlarmRepeatData | null;
669
- /**
670
- * Set Alarm Repetitions. Use this to repeat the alarm.
671
- *
672
- * ```javascript
673
- * const cal = ical();
674
- * const event = cal.createEvent();
675
- *
676
- * // repeat the alarm 4 times every 5 minutes…
677
- * cal.createAlarm({
678
- * repeat: {
679
- * times: 4,
680
- * interval: 300
681
- * }
682
- * });
683
- * ```
684
- *
685
- * @since 0.2.1
686
- */
687
- repeat(repeat: ICalAlarmRepeatData | null): this;
688
- /**
689
- * Get the alarm summary. Used to set the email subject
690
- * if alarm type is `email`. Defaults to the event's summary.
691
- *
692
- * @since 7.0.0
693
- */
694
- summary(): null | string;
695
- /**
696
- * Set the alarm summary. Used to set the email subject
697
- * if alarm type is display. Defaults to the event's summary.
698
- *
699
- * @since 0.2.1
700
- */
701
- summary(summary: null | string): this;
702
- /**
703
- * Return a shallow copy of the alarm's options for JSON stringification.
704
- * Third party objects like moment.js values are stringified as well. Can
705
- * be used for persistence.
706
- *
707
- * @since 0.2.4
708
- */
709
- toJSON(): ICalAlarmJSONData;
710
- /**
711
- * Return generated event as a string.
712
- *
713
- * ```javascript
714
- * const alarm = event.createAlarm();
715
- * console.log(alarm.toString()); // → BEGIN:VALARM…
716
- * ```
717
- */
718
- toString(): string;
719
- /**
720
- * Get the trigger time for the alarm. Can either
721
- * be a date and time value ({@link ICalDateTimeValue}) or
722
- * a number, which will represent the seconds between
723
- * alarm and event start. The number is negative, if the
724
- * alarm is triggered after the event started.
725
- *
726
- * @since 0.2.1
727
- */
728
- trigger(): ICalDateTimeValue | number;
729
- /**
730
- * Use this method to set the alarm time.
731
- *
732
- * ```javascript
733
- * const cal = ical();
734
- * const event = cal.createEvent();
735
- * const alarm = cal.createAlarm();
736
- *
737
- * alarm.trigger(600); // -> 10 minutes before event starts
738
- * alarm.trigger(new Date()); // -> now
739
- * ```
740
- *
741
- * You can use any supported date object, see
742
- * [readme](https://github.com/sebbo2002/ical-generator#-date-time--timezones)
743
- * for details about supported values and timezone handling.
744
- *
745
- * @since 0.2.1
746
- */
747
- trigger(trigger: Date | ICalDateTimeValue | number): this;
748
- /**
749
- * Get the trigger time for the alarm. Can either
750
- * be a date and time value ({@link ICalDateTimeValue}) or
751
- * a number, which will represent the seconds between
752
- * alarm and event start. The number is negative, if the
753
- * alarm is triggered before the event started.
754
- *
755
- * @since 0.2.1
756
- */
757
- triggerAfter(): ICalDateTimeValue | number;
758
- /**
759
- * Use this method to set the alarm time. Unlike `trigger`, this time
760
- * the alarm takes place after the event has started.
761
- *
762
- * ```javascript
763
- * const cal = ical();
764
- * const event = cal.createEvent();
765
- * const alarm = cal.createAlarm();
766
- *
767
- * alarm.trigger(600); // -> 10 minutes after event starts
768
- * ```
769
- *
770
- * You can use any supported date object, see
771
- * [readme](https://github.com/sebbo2002/ical-generator#-date-time--timezones)
772
- * for details about supported values and timezone handling.
773
- *
774
- * @since 0.2.1
775
- */
776
- triggerAfter(trigger: ICalDateTimeValue | number): this;
777
- /**
778
- * Get the trigger time for the alarm. Can either
779
- * be a date and time value ({@link ICalDateTimeValue}) or
780
- * a number, which will represent the seconds between
781
- * alarm and event start. The number is negative, if the
782
- * alarm is triggered after the event started.
783
- *
784
- * @since 0.2.1
785
- * @see {@link trigger}
786
- * @see {@link triggerAfter}
787
- */
788
- triggerBefore(trigger: ICalDateTimeValue | number): this;
789
- /**
790
- * Use this method to set the alarm time.
791
- *
792
- * ```javascript
793
- * const cal = ical();
794
- * const event = cal.createEvent();
795
- * const alarm = cal.createAlarm();
796
- *
797
- * alarm.trigger(600); // -> 10 minutes before event starts
798
- * alarm.trigger(new Date()); // -> now
799
- * ```
800
- *
801
- * You can use any supported date object, see
802
- * [readme](https://github.com/sebbo2002/ical-generator#-date-time--timezones)
803
- * for details about supported values and timezone handling.
804
- *
805
- * @since 0.2.1
806
- * @see {@link trigger}
807
- * @see {@link triggerAfter}
808
- */
809
- triggerBefore(): ICalDateTimeValue | number;
810
- /**
811
- * Get the alarm type
812
- * @since 0.2.1
813
- */
814
- type(type: ICalAlarmType): this;
815
- /**
816
- * Set the alarm type. See {@link ICalAlarmType}
817
- * for available status options.
818
- * @since 0.2.1
819
- */
820
- type(): ICalAlarmType;
821
- /**
822
- * Set X-* attributes. Woun't filter double attributes,
823
- * which are also added by another method (e.g. type),
824
- * so these attributes may be inserted twice.
825
- *
826
- * ```javascript
827
- * alarm.x([
828
- * {
829
- * key: "X-MY-CUSTOM-ATTR",
830
- * value: "1337!"
831
- * }
832
- * ]);
833
- *
834
- * alarm.x([
835
- * ["X-MY-CUSTOM-ATTR", "1337!"]
836
- * ]);
837
- *
838
- * alarm.x({
839
- * "X-MY-CUSTOM-ATTR": "1337!"
840
- * });
841
- * ```
842
- *
843
- * @since 1.9.0
844
- */
845
- x(keyOrArray: [string, string][] | Record<string, string> | {
846
- key: string;
847
- value: string;
848
- }[]): this;
849
- /**
850
- * Set a X-* attribute. Woun't filter double attributes,
851
- * which are also added by another method (e.g. type),
852
- * so these attributes may be inserted twice.
853
- *
854
- * ```javascript
855
- * alarm.x("X-MY-CUSTOM-ATTR", "1337!");
856
- * ```
857
- *
858
- * @since 1.9.0
859
- */
860
- x(keyOrArray: string, value: string): this;
861
- /**
862
- * Get all custom X-* attributes.
863
- * @since 1.9.0
864
- */
865
- x(): {
866
- key: string;
867
- value: string;
868
- }[];
869
- }
870
-
871
- interface ICalCategoryData {
872
- name: string;
873
- }
874
- type ICalCategoryInternalData = ICalCategoryJSONData;
875
- interface ICalCategoryJSONData {
876
- name: string;
877
- }
878
- /**
879
- * Usually you get an {@link ICalCategory} object like this:
880
- *
881
- * ```javascript
882
- * import ical from 'ical-generator';
883
- * const calendar = ical();
884
- * const event = calendar.createEvent();
885
- * const category = event.createCategory();
886
- * ```
887
- *
888
- * You can also use the {@link ICalCategory} object directly:
889
- *
890
- * ```javascript
891
- * import ical, {ICalCategory} from 'ical-generator';
892
- * const category = new ICalCategory();
893
- * event.categories([category]);
894
- * ```
895
- */
896
- declare class ICalCategory {
897
- private readonly data;
898
- /**
899
- * Constructor of {@link ICalCategory}.
900
- * @param data Category Data
901
- */
902
- constructor(data: ICalCategoryData);
903
- /**
904
- * Get the category name
905
- * @since 0.3.0
906
- */
907
- name(): string;
908
- /**
909
- * Set the category name
910
- * @since 0.3.0
911
- */
912
- name(name: string): this;
913
- /**
914
- * Return a shallow copy of the category's options for JSON stringification.
915
- * Can be used for persistence.
916
- *
917
- * @since 0.2.4
918
- */
919
- toJSON(): ICalCategoryInternalData;
920
- /**
921
- * Return generated category name as a string.
922
- *
923
- * ```javascript
924
- * console.log(category.toString());
925
- * ```
926
- */
927
- toString(): string;
928
- }
929
-
930
- declare enum ICalEventBusyStatus {
931
- BUSY = "BUSY",
932
- FREE = "FREE",
933
- OOF = "OOF",
934
- TENTATIVE = "TENTATIVE"
935
- }
936
- declare enum ICalEventClass {
937
- CONFIDENTIAL = "CONFIDENTIAL",
938
- PRIVATE = "PRIVATE",
939
- PUBLIC = "PUBLIC"
940
- }
941
- declare enum ICalEventStatus {
942
- CANCELLED = "CANCELLED",
943
- CONFIRMED = "CONFIRMED",
944
- TENTATIVE = "TENTATIVE"
945
- }
946
- declare enum ICalEventTransparency {
947
- OPAQUE = "OPAQUE",
948
- TRANSPARENT = "TRANSPARENT"
949
- }
950
- interface ICalEventData {
951
- alarms?: ICalAlarm[] | ICalAlarmData[];
952
- allDay?: boolean;
953
- attachments?: string[];
954
- attendees?: ICalAttendee[] | ICalAttendeeData[];
955
- busystatus?: ICalEventBusyStatus | null;
956
- categories?: ICalCategory[] | ICalCategoryData[];
957
- class?: ICalEventClass | null;
958
- created?: ICalDateTimeValue | null;
959
- description?: ICalDescription | null | string;
960
- end?: ICalDateTimeValue | null;
961
- floating?: boolean;
962
- id?: null | number | string;
963
- lastModified?: ICalDateTimeValue | null;
964
- location?: ICalLocation | null | string;
965
- organizer?: ICalOrganizer | null | string;
966
- priority?: null | number;
967
- recurrenceId?: ICalDateTimeValue | null;
968
- repeating?: ICalRepeatingOptions | ICalRRuleStub | null | string;
969
- sequence?: number;
970
- stamp?: ICalDateTimeValue;
971
- start: ICalDateTimeValue;
972
- status?: ICalEventStatus | null;
973
- summary?: string;
974
- timezone?: null | string;
975
- transparency?: ICalEventTransparency | null;
976
- url?: null | string;
977
- x?: [string, string][] | Record<string, string> | {
978
- key: string;
979
- value: string;
980
- }[];
981
- }
982
- interface ICalEventJSONData {
983
- alarms: ICalAlarm[];
984
- allDay: boolean;
985
- attachments: string[];
986
- attendees: ICalAttendee[];
987
- busystatus: ICalEventBusyStatus | null;
988
- categories: ICalCategory[];
989
- created: null | string;
990
- description: ICalDescription | null;
991
- end: null | string;
992
- floating: boolean;
993
- id: string;
994
- lastModified: null | string;
995
- location: ICalLocation | null;
996
- organizer: ICalOrganizer | null;
997
- priority?: null | number;
998
- recurrenceId: null | string;
999
- repeating: ICalEventJSONRepeatingData | null | string;
1000
- sequence: number;
1001
- stamp: string;
1002
- start: string;
1003
- status: ICalEventStatus | null;
1004
- summary: string;
1005
- timezone: null | string;
1006
- transparency: ICalEventTransparency | null;
1007
- url: null | string;
1008
- x: {
1009
- key: string;
1010
- value: string;
1011
- }[];
1012
- }
1013
- interface ICalEventJSONRepeatingData {
1014
- byDay?: ICalWeekday[];
1015
- byMonth?: number[];
1016
- byMonthDay?: number[];
1017
- bySetPos?: number[];
1018
- count?: number;
1019
- exclude?: ICalDateTimeValue[];
1020
- freq: ICalEventRepeatingFreq;
1021
- interval?: number;
1022
- startOfWeek?: ICalWeekday;
1023
- until?: ICalDateTimeValue;
1024
- }
1025
- /**
1026
- * Usually you get an {@link ICalEvent} object like this:
1027
- * ```javascript
1028
- * import ical from 'ical-generator';
1029
- * const calendar = ical();
1030
- * const event = calendar.createEvent();
1031
- * ```
1032
- */
1033
- declare class ICalEvent {
1034
- private readonly calendar;
1035
- private readonly data;
1036
- /**
1037
- * Constructor of [[`ICalEvent`]. The calendar reference is
1038
- * required to query the calendar's timezone when required.
1039
- *
1040
- * @param data Calendar Event Data
1041
- * @param calendar Reference to ICalCalendar object
1042
- */
1043
- constructor(data: ICalEventData, calendar: ICalCalendar);
1044
- /**
1045
- * Get all alarms
1046
- * @since 0.2.0
1047
- */
1048
- alarms(): ICalAlarm[];
1049
- /**
1050
- * Add one or multiple alarms
1051
- *
1052
- * ```javascript
1053
- * const event = ical().createEvent();
1054
- *
1055
- * cal.alarms([
1056
- * {type: ICalAlarmType.display, trigger: 600},
1057
- * {type: ICalAlarmType.audio, trigger: 300}
1058
- * ]);
1059
- *
1060
- * cal.alarms(); // --> [ICalAlarm, ICalAlarm]
1061
- ```
1062
- *
1063
- * @since 0.2.0
1064
- */
1065
- alarms(alarms: ICalAlarm[] | ICalAlarmData[]): this;
1066
- /**
1067
- * Get the event's allDay flag
1068
- * @since 0.2.0
1069
- */
1070
- allDay(): boolean;
1071
- /**
1072
- * Set the event's allDay flag.
1073
- *
1074
- * ```javascript
1075
- * event.allDay(true); // → appointment is for the whole day
1076
- * ```
1077
- *
1078
- * ```typescript
1079
- * import ical from 'ical-generator';
1080
- *
1081
- * const cal = ical();
1082
- *
1083
- * cal.createEvent({
1084
- * start: new Date('2020-01-01'),
1085
- * summary: 'Very Important Day',
1086
- * allDay: true
1087
- * });
1088
- *
1089
- * cal.toString();
1090
- * ```
1091
- *
1092
- * ```text
1093
- * BEGIN:VCALENDAR
1094
- * VERSION:2.0
1095
- * PRODID:-//sebbo.net//ical-generator//EN
1096
- * BEGIN:VEVENT
1097
- * UID:1964fe8d-32c5-4f2a-bd62-7d9d7de5992b
1098
- * SEQUENCE:0
1099
- * DTSTAMP:20240212T191956Z
1100
- * DTSTART;VALUE=DATE:20200101
1101
- * X-MICROSOFT-CDO-ALLDAYEVENT:TRUE
1102
- * X-MICROSOFT-MSNCALENDAR-ALLDAYEVENT:TRUE
1103
- * SUMMARY:Very Important Day
1104
- * END:VEVENT
1105
- * END:VCALENDAR
1106
- * ```
1107
- *
1108
- * @since 0.2.0
1109
- */
1110
- allDay(allDay: boolean): this;
1111
- /**
1112
- * Get all attachment urls
1113
- * @since 3.2.0-develop.1
1114
- */
1115
- attachments(): string[];
1116
- /**
1117
- * Add one or multiple alarms
1118
- *
1119
- * ```javascript
1120
- * const event = ical().createEvent();
1121
- *
1122
- * cal.attachments([
1123
- * 'https://files.sebbo.net/calendar/attachments/foo',
1124
- * 'https://files.sebbo.net/calendar/attachments/bar'
1125
- * ]);
1126
- *
1127
- * cal.attachments(); // --> [string, string]
1128
- ```
1129
- *
1130
- * 3.2.0-develop.1
1131
- */
1132
- attachments(attachments: string[]): this;
1133
- /**
1134
- * Get all attendees
1135
- * @since 0.2.0
1136
- */
1137
- attendees(): ICalAttendee[];
1138
- /**
1139
- * Add multiple attendees to your event
1140
- *
1141
- * ```javascript
1142
- * const event = ical().createEvent();
1143
- *
1144
- * cal.attendees([
1145
- * {email: 'a@example.com', name: 'Person A'},
1146
- * {email: 'b@example.com', name: 'Person B'}
1147
- * ]);
1148
- *
1149
- * cal.attendees(); // --> [ICalAttendee, ICalAttendee]
1150
- * ```
1151
- *
1152
- * @since 0.2.0
1153
- */
1154
- attendees(attendees: (ICalAttendee | ICalAttendeeData | string)[]): this;
1155
- /**
1156
- * Get the event's busy status
1157
- * @since 1.0.2
1158
- */
1159
- busystatus(): ICalEventBusyStatus | null;
1160
- /**
1161
- * Set the event's busy status. Will add the
1162
- * [`X-MICROSOFT-CDO-BUSYSTATUS`](https://docs.microsoft.com/en-us/openspecs/exchange_server_protocols/ms-oxcical/cd68eae7-ed65-4dd3-8ea7-ad585c76c736)
1163
- * attribute to your event.
1164
- *
1165
- * ```javascript
1166
- * import ical, {ICalEventBusyStatus} from 'ical-generator';
1167
- * event.busystatus(ICalEventBusyStatus.BUSY);
1168
- * ```
1169
- *
1170
- * @since 1.0.2
1171
- */
1172
- busystatus(busystatus: ICalEventBusyStatus | null): this;
1173
- /**
1174
- * Get all categories
1175
- * @since 0.3.0
1176
- */
1177
- categories(): ICalCategory[];
1178
- /**
1179
- * Add categories to the event or return all selected categories.
1180
- *
1181
- * ```javascript
1182
- * const event = ical().createEvent();
1183
- *
1184
- * cal.categories([
1185
- * {name: 'APPOINTMENT'},
1186
- * {name: 'MEETING'}
1187
- * ]);
1188
- *
1189
- * cal.categories(); // --> [ICalCategory, ICalCategory]
1190
- * ```
1191
- *
1192
- * @since 0.3.0
1193
- */
1194
- categories(categories: (ICalCategory | ICalCategoryData)[]): this;
1195
- /**
1196
- * Get the event's class
1197
- * @since 2.0.0
1198
- */
1199
- class(): ICalEventClass | null;
1200
- /**
1201
- * Set the event's class
1202
- *
1203
- * ```javascript
1204
- * import ical, { ICalEventClass } from 'ical-generator';
1205
- * event.class(ICalEventClass.PRIVATE);
1206
- * ```
1207
- *
1208
- * @since 2.0.0
1209
- */
1210
- class(class_: ICalEventClass | null): this;
1211
- /**
1212
- * Creates a new {@link ICalAlarm} and returns it. Use options to prefill
1213
- * the alarm's attributes. Calling this method without options will create
1214
- * an empty alarm.
1215
- *
1216
- * ```javascript
1217
- * const cal = ical();
1218
- * const event = cal.createEvent();
1219
- * const alarm = event.createAlarm({type: ICalAlarmType.display, trigger: 300});
1220
- *
1221
- * // add another alarm
1222
- * event.createAlarm({
1223
- * type: ICalAlarmType.audio,
1224
- * trigger: 300, // 5min before event
1225
- * });
1226
- * ```
1227
- *
1228
- * @since 0.2.1
1229
- */
1230
- createAlarm(data: ICalAlarm | ICalAlarmData): ICalAlarm;
1231
- /**
1232
- * Adds an attachment to the event by adding the file URL to the calendar.
1233
- *
1234
- * `ical-generator` only supports external attachments. File attachments that
1235
- * are directly included in the file are not supported, because otherwise the
1236
- * calendar file could easily become unfavourably large.
1237
- *
1238
- * ```javascript
1239
- * const cal = ical();
1240
- * const event = cal.createEvent();
1241
- * event.createAttachment('https://files.sebbo.net/calendar/attachments/foo');
1242
- * ```
1243
- *
1244
- * @since 3.2.0-develop.1
1245
- */
1246
- createAttachment(url: string): this;
1247
- /**
1248
- * Creates a new {@link ICalAttendee} and returns it. Use options to prefill
1249
- * the attendee's attributes. Calling this method without options will create
1250
- * an empty attendee.
1251
- *
1252
- * ```javascript
1253
- * import ical from 'ical-generator';
1254
- *
1255
- * const cal = ical();
1256
- * const event = cal.createEvent({
1257
- * start: new Date()
1258
- * });
1259
- *
1260
- * event.createAttendee({email: 'hui@example.com', name: 'Hui'});
1261
- *
1262
- * // add another attendee
1263
- * event.createAttendee('Buh <buh@example.net>');
1264
- * ```
1265
- *
1266
- * ```text
1267
- * BEGIN:VCALENDAR
1268
- * VERSION:2.0
1269
- * PRODID:-//sebbo.net//ical-generator//EN
1270
- * BEGIN:VEVENT
1271
- * UID:b4944f07-98e4-4581-ac80-2589bb20273d
1272
- * SEQUENCE:0
1273
- * DTSTAMP:20240212T194232Z
1274
- * DTSTART:20240212T194232Z
1275
- * SUMMARY:
1276
- * ATTENDEE;ROLE=REQ-PARTICIPANT;CN="Hui":MAILTO:hui@example.com
1277
- * ATTENDEE;ROLE=REQ-PARTICIPANT;CN="Buh":MAILTO:buh@example.net
1278
- * END:VEVENT
1279
- * END:VCALENDAR
1280
- * ```
1281
- *
1282
- * As with the organizer, you can also add an explicit `mailto` address.
1283
- *
1284
- * ```javascript
1285
- * event.createAttendee({email: 'hui@example.com', name: 'Hui', mailto: 'another@mailto.com'});
1286
- *
1287
- * // overwrite an attendee's mailto address
1288
- * attendee.mailto('another@mailto.net');
1289
- * ```
1290
- *
1291
- * @since 0.2.0
1292
- */
1293
- createAttendee(data: ICalAttendee | ICalAttendeeData | string): ICalAttendee;
1294
- /**
1295
- * Creates a new {@link ICalCategory} and returns it. Use options to prefill the category's attributes.
1296
- * Calling this method without options will create an empty category.
1297
- *
1298
- * ```javascript
1299
- * const cal = ical();
1300
- * const event = cal.createEvent();
1301
- * const category = event.createCategory({name: 'APPOINTMENT'});
1302
- *
1303
- * // add another category
1304
- * event.createCategory({
1305
- * name: 'MEETING'
1306
- * });
1307
- * ```
1308
- *
1309
- * @since 0.3.0
1310
- */
1311
- createCategory(data: ICalCategory | ICalCategoryData): ICalCategory;
1312
- /**
1313
- * Get the event's creation date
1314
- * @since 0.3.0
1315
- */
1316
- created(): ICalDateTimeValue | null;
1317
- /**
1318
- * Set the event's creation date
1319
- * @since 0.3.0
1320
- */
1321
- created(created: ICalDateTimeValue | null): this;
1322
- /**
1323
- * Get the event's description as an {@link ICalDescription} object.
1324
- * @since 0.2.0
1325
- */
1326
- description(): ICalDescription | null;
1327
- /**
1328
- * Set the events description by passing a plaintext string or
1329
- * an object containing both a plaintext and a html description.
1330
- * Only a few calendar apps support html descriptions and like in
1331
- * emails, supported HTML tags and styling is limited.
1332
- *
1333
- * ```javascript
1334
- * event.description({
1335
- * plain: 'Hello World!',
1336
- * html: '<p>Hello World!</p>'
1337
- * });
1338
- * ```
1339
- *
1340
- * ```text
1341
- * DESCRIPTION:Hello World!
1342
- * X-ALT-DESC;FMTTYPE=text/html:<p>Hello World!</p>
1343
- * ```
1344
- *
1345
- * @since 0.2.0
1346
- */
1347
- description(description: ICalDescription | null | string): this;
1348
- /**
1349
- * Get the event end time which is currently
1350
- * set. Can be any supported date object.
1351
- *
1352
- * @since 0.2.0
1353
- */
1354
- end(): ICalDateTimeValue | null;
1355
- /**
1356
- * Set the appointment date of end. You can use any supported date object, see
1357
- * [readme](https://github.com/sebbo2002/ical-generator#-date-time--timezones)
1358
- * for details about supported values and timezone handling.
1359
- *
1360
- * @since 0.2.0
1361
- */
1362
- end(end: ICalDateTimeValue | null): this;
1363
- /**
1364
- * Get the event's floating flag.
1365
- * @since 0.2.0
1366
- */
1367
- floating(): boolean;
1368
- floating(floating: boolean): this;
1369
- /**
1370
- * Get the event's ID
1371
- * @since 0.2.0
1372
- */
1373
- id(): string;
1374
- /**
1375
- * Use this method to set the event's ID.
1376
- * If not set, a UUID will be generated randomly.
1377
- *
1378
- * @param id Event ID you want to set
1379
- */
1380
- id(id: number | string): this;
1381
- /**
1382
- * Get the event's last modification date
1383
- * @since 0.3.0
1384
- */
1385
- lastModified(): ICalDateTimeValue | null;
1386
- /**
1387
- * Set the event's last modification date
1388
- * @since 0.3.0
1389
- */
1390
- lastModified(lastModified: ICalDateTimeValue | null): this;
1391
- /**
1392
- * Get the event's location
1393
- * @since 0.2.0
1394
- */
1395
- location(): ICalLocation | null;
1396
- /**
1397
- * Set the event's location by passing a string (minimum) or
1398
- * an {@link ICalLocationWithTitle} object which will also fill the iCal
1399
- * `GEO` attribute and Apple's `X-APPLE-STRUCTURED-LOCATION`.
1400
- *
1401
- * ```javascript
1402
- * event.location({
1403
- * title: 'Apple Store Kurfürstendamm',
1404
- * address: 'Kurfürstendamm 26, 10719 Berlin, Deutschland',
1405
- * radius: 141.1751386318387,
1406
- * geo: {
1407
- * lat: 52.503630,
1408
- * lon: 13.328650
1409
- * }
1410
- * });
1411
- * ```
1412
- *
1413
- * ```text
1414
- * LOCATION:Apple Store Kurfürstendamm\nKurfürstendamm 26\, 10719 Berlin\,
1415
- * Deutschland
1416
- * X-APPLE-STRUCTURED-LOCATION;VALUE=URI;X-ADDRESS=Kurfürstendamm 26\, 10719
1417
- * Berlin\, Deutschland;X-APPLE-RADIUS=141.1751386318387;X-TITLE=Apple Store
1418
- * Kurfürstendamm:geo:52.50363,13.32865
1419
- * GEO:52.50363;13.32865
1420
- * ```
1421
- *
1422
- * Since v6.1.0 you can also pass a {@link ICalLocationWithoutTitle} object to pass
1423
- * the geolocation only. This will only fill the iCal `GEO` attribute.
1424
- *
1425
- * ```javascript
1426
- * event.location({
1427
- * geo: {
1428
- * lat: 52.503630,
1429
- * lon: 13.328650
1430
- * }
1431
- * });
1432
- * ```
1433
- *
1434
- * ```text
1435
- * GEO:52.50363;13.32865
1436
- * ```
1437
- *
1438
- * @since 0.2.0
1439
- */
1440
- location(location: ICalLocation | null | string): this;
1441
- /**
1442
- * Get the event's organizer
1443
- * @since 0.2.0
1444
- */
1445
- organizer(): ICalOrganizer | null;
1446
- /**
1447
- * Set the event's organizer
1448
- *
1449
- * ```javascript
1450
- * event.organizer({
1451
- * name: 'Organizer\'s Name',
1452
- * email: 'organizer@example.com'
1453
- * });
1454
- *
1455
- * // OR
1456
- *
1457
- * event.organizer('Organizer\'s Name <organizer@example.com>');
1458
- * ```
1459
- *
1460
- * You can also add an explicit `mailto` email address or or the sentBy address.
1461
- *
1462
- * ```javascript
1463
- * event.organizer({
1464
- * name: 'Organizer\'s Name',
1465
- * email: 'organizer@example.com',
1466
- * mailto: 'explicit@mailto.com',
1467
- * sentBy: 'substitute@example.com'
1468
- * })
1469
- * ```
1470
- *
1471
- * @since 0.2.0
1472
- */
1473
- organizer(organizer: ICalOrganizer | null | string): this;
1474
- /**
1475
- * Get the event's priority. A value of 1 represents
1476
- * the highest priority, 9 the lowest. 0 specifies an undefined
1477
- * priority.
1478
- *
1479
- * @since v2.0.0-develop.7
1480
- */
1481
- priority(): null | number;
1482
- /**
1483
- * Set the event's priority. A value of 1 represents
1484
- * the highest priority, 9 the lowest. 0 specifies an undefined
1485
- * priority.
1486
- *
1487
- * @since v2.0.0-develop.7
1488
- */
1489
- priority(priority: null | number): this;
1490
- /**
1491
- * Get the event's recurrence id
1492
- * @since 0.2.0
1493
- */
1494
- recurrenceId(): ICalDateTimeValue | null;
1495
- /**
1496
- * Set the event's recurrence id. You can use any supported date object, see
1497
- * [readme](https://github.com/sebbo2002/ical-generator#-date-time--timezones)
1498
- * for details about supported values and timezone handling.
1499
- *
1500
- * @since 0.2.0
1501
- */
1502
- recurrenceId(recurrenceId: ICalDateTimeValue | null): this;
1503
- /**
1504
- * Get the event's repeating options
1505
- * @since 0.2.0
1506
- */
1507
- repeating(): ICalEventJSONRepeatingData | ICalRRuleStub | null | string;
1508
- /**
1509
- * Set the event's repeating options by passing an {@link ICalRepeatingOptions} object.
1510
- *
1511
- * ```javascript
1512
- * event.repeating({
1513
- * freq: 'MONTHLY', // required
1514
- * count: 5,
1515
- * interval: 2,
1516
- * until: new Date('Jan 01 2014 00:00:00 UTC'),
1517
- * byDay: ['su', 'mo'], // repeat only sunday and monday
1518
- * byMonth: [1, 2], // repeat only in january and february,
1519
- * byMonthDay: [1, 15], // repeat only on the 1st and 15th
1520
- * bySetPos: 3, // repeat every 3rd sunday (will take the first element of the byDay array)
1521
- * exclude: [new Date('Dec 25 2013 00:00:00 UTC')], // exclude these dates
1522
- * excludeTimezone: 'Europe/Berlin', // timezone of exclude
1523
- * wkst: 'SU' // Start the week on Sunday, default is Monday
1524
- * });
1525
- * ```
1526
- *
1527
- * **Example:**
1528
- *
1529
- *```typescript
1530
- * import ical, { ICalEventRepeatingFreq } from 'ical-generator';
1531
- *
1532
- * const cal = ical();
1533
- *
1534
- * const event = cal.createEvent({
1535
- * start: new Date('2020-01-01T20:00:00Z'),
1536
- * summary: 'Repeating Event'
1537
- * });
1538
- * event.repeating({
1539
- * freq: ICalEventRepeatingFreq.WEEKLY,
1540
- * count: 4
1541
- * });
1542
- *
1543
- * cal.toString();
1544
- * ```
1545
- *
1546
- * ```text
1547
- * BEGIN:VCALENDAR
1548
- * VERSION:2.0
1549
- * PRODID:-//sebbo.net//ical-generator//EN
1550
- * BEGIN:VEVENT
1551
- * UID:b80e6a68-c2cd-48f5-b94d-cecc7ce83871
1552
- * SEQUENCE:0
1553
- * DTSTAMP:20240212T193646Z
1554
- * DTSTART:20200101T200000Z
1555
- * RRULE:FREQ=WEEKLY;COUNT=4
1556
- * SUMMARY:Repeating Event
1557
- * END:VEVENT
1558
- * END:VCALENDAR
1559
- * ```
1560
- *
1561
- * @since 0.2.0
1562
- */
1563
- repeating(repeating: ICalRepeatingOptions | null): this;
1564
- /**
1565
- * Set the event's repeating options by passing an [RRule object](https://github.com/jakubroztocil/rrule).
1566
- * @since 2.0.0-develop.5
1567
- *
1568
- * ```typescript
1569
- * import ical from 'ical-generator';
1570
- * import { datetime, RRule } from 'rrule';
1571
- *
1572
- * const cal = ical();
1573
- *
1574
- * const event = cal.createEvent({
1575
- * start: new Date('2020-01-01T20:00:00Z'),
1576
- * summary: 'Repeating Event'
1577
- * });
1578
- *
1579
- * const rule = new RRule({
1580
- * freq: RRule.WEEKLY,
1581
- * interval: 5,
1582
- * byweekday: [RRule.MO, RRule.FR],
1583
- * dtstart: datetime(2012, 2, 1, 10, 30),
1584
- * until: datetime(2012, 12, 31)
1585
- * })
1586
- * event.repeating(rule);
1587
- *
1588
- * cal.toString();
1589
- * ```
1590
- *
1591
- * ```text
1592
- * BEGIN:VCALENDAR
1593
- * VERSION:2.0
1594
- * PRODID:-//sebbo.net//ical-generator//EN
1595
- * BEGIN:VEVENT
1596
- * UID:36585e40-8fa8-460d-af0c-88b6f434030b
1597
- * SEQUENCE:0
1598
- * DTSTAMP:20240212T193827Z
1599
- * DTSTART:20200101T200000Z
1600
- * RRULE:FREQ=WEEKLY;INTERVAL=5;BYDAY=MO,FR;UNTIL=20121231T000000Z
1601
- * SUMMARY:Repeating Event
1602
- * END:VEVENT
1603
- * END:VCALENDAR
1604
- * ```
1605
- */
1606
- repeating(repeating: ICalRRuleStub | null): this;
1607
- /**
1608
- * Set the events repeating options by passing a string which is inserted in the ical file.
1609
- * @since 2.0.0-develop.5
1610
- */
1611
- repeating(repeating: null | string): this;
1612
- /**
1613
- * @internal
1614
- */
1615
- repeating(repeating: ICalRepeatingOptions | ICalRRuleStub | null | string): this;
1616
- /**
1617
- * Get the event's SEQUENCE number. Use this method to get the event's
1618
- * revision sequence number of the calendar component within a sequence of revisions.
1619
- *
1620
- * @since 0.2.6
1621
- */
1622
- sequence(): number;
1623
- /**
1624
- * Set the event's SEQUENCE number. For a new event, this should be zero.
1625
- * Each time the organizer makes a significant revision, the sequence
1626
- * number should be incremented.
1627
- *
1628
- * @param sequence Sequence number or null to unset it
1629
- */
1630
- sequence(sequence: number): this;
1631
- /**
1632
- * Get the event's timestamp
1633
- * @since 0.2.0
1634
- * @see {@link timestamp}
1635
- */
1636
- stamp(): ICalDateTimeValue;
1637
- /**
1638
- * Set the appointment date of creation. Defaults to the current time and date (`new Date()`). You can use
1639
- * any supported date object, see [readme](https://github.com/sebbo2002/ical-generator#-date-time--timezones)
1640
- * for details about supported values and timezone handling.
1641
- *
1642
- * @since 0.2.0
1643
- * @see {@link timestamp}
1644
- */
1645
- stamp(stamp: ICalDateTimeValue): this;
1646
- /**
1647
- * Get the event start time which is currently
1648
- * set. Can be any supported date object.
1649
- *
1650
- * @since 0.2.0
1651
- */
1652
- start(): ICalDateTimeValue;
1653
- /**
1654
- * Set the appointment date of beginning, which is required for all events.
1655
- * You can use any supported date object, see
1656
- * [Readme](https://github.com/sebbo2002/ical-generator#-date-time--timezones)
1657
- * for details about supported values and timezone handling.
1658
- *
1659
- * ```typescript
1660
- * import ical from 'ical-generator';
1661
- *
1662
- * const cal = ical();
1663
- *
1664
- * const event = cal.createEvent({
1665
- * start: new Date('2020-01-01')
1666
- * });
1667
- *
1668
- * // overwrites old start date
1669
- * event.start(new Date('2024-02-01'));
1670
- *
1671
- * cal.toString();
1672
- * ```
1673
- *
1674
- * ```text
1675
- * BEGIN:VCALENDAR
1676
- * VERSION:2.0
1677
- * PRODID:-//sebbo.net//ical-generator//EN
1678
- * BEGIN:VEVENT
1679
- * UID:7e2aee64-b07a-4256-9b3e-e9eaa452bac8
1680
- * SEQUENCE:0
1681
- * DTSTAMP:20240212T190915Z
1682
- * DTSTART:20240201T000000Z
1683
- * SUMMARY:
1684
- * END:VEVENT
1685
- * END:VCALENDAR
1686
- * ```
1687
- *
1688
- * @since 0.2.0
1689
- */
1690
- start(start: ICalDateTimeValue): this;
1691
- /**
1692
- * Get the event's status
1693
- * @since 0.2.0
1694
- */
1695
- status(): ICalEventStatus | null;
1696
- /**
1697
- * Set the event's status
1698
- *
1699
- * ```javascript
1700
- * import ical, {ICalEventStatus} from 'ical-generator';
1701
- * event.status(ICalEventStatus.CONFIRMED);
1702
- * ```
1703
- *
1704
- * @since 0.2.0
1705
- */
1706
- status(status: ICalEventStatus | null): this;
1707
- /**
1708
- * Get the event's summary
1709
- * @since 0.2.0
1710
- */
1711
- summary(): string;
1712
- /**
1713
- * Set the event's summary.
1714
- * Defaults to an empty string if nothing is set.
1715
- *
1716
- * @since 0.2.0
1717
- */
1718
- summary(summary: string): this;
1719
- /**
1720
- * Get the event's timestamp
1721
- * @since 0.2.0
1722
- * @see {@link stamp}
1723
- */
1724
- timestamp(): ICalDateTimeValue;
1725
- /**
1726
- * Set the appointment date of creation. Defaults to the current time and date (`new Date()`). You can use
1727
- * any supported date object, see [readme](https://github.com/sebbo2002/ical-generator#-date-time--timezones)
1728
- * for details about supported values and timezone handling.
1729
- *
1730
- * @since 0.2.0
1731
- * @see {@link stamp}
1732
- */
1733
- timestamp(stamp: ICalDateTimeValue): this;
1734
- /**
1735
- * Get the event's timezone.
1736
- * @since 0.2.6
1737
- */
1738
- timezone(): null | string;
1739
- /**
1740
- * Sets the time zone to be used for this event. If a time zone has been
1741
- * defined in both the event and the calendar, the time zone of the event
1742
- * is used.
1743
- *
1744
- * Please note that if the time zone is set, ical-generator assumes
1745
- * that all times are already in the correct time zone. Alternatively,
1746
- * a `moment-timezone` or a Luxon object can be passed with `setZone`,
1747
- * ical-generator will then set the time zone itself.
1748
- *
1749
- * This and the 'floating' flag (see below) are mutually exclusive, and setting a timezone will unset the
1750
- * 'floating' flag. If neither 'timezone' nor 'floating' are set, the date will be output with in UTC format
1751
- * (see [date-time form #2 in section 3.3.5 of RFC 554](https://tools.ietf.org/html/rfc5545#section-3.3.5)).
1752
- *
1753
- * See [Readme](https://github.com/sebbo2002/ical-generator#-date-time--timezones) for details about
1754
- * supported values and timezone handling.
1755
- *
1756
- * ```javascript
1757
- * event.timezone('America/New_York');
1758
- * ```
1759
- *
1760
- * @see https://github.com/sebbo2002/ical-generator#-date-time--timezones
1761
- * @since 0.2.6
1762
- */
1763
- timezone(timezone: null | string): this;
1764
- /**
1765
- * Return a shallow copy of the events's options for JSON stringification.
1766
- * Third party objects like moment.js values or RRule objects are stringified
1767
- * as well. Can be used for persistence.
1768
- *
1769
- * ```javascript
1770
- * const event = ical().createEvent();
1771
- * const json = JSON.stringify(event);
1772
- *
1773
- * // later: restore event data
1774
- * const calendar = ical().createEvent(JSON.parse(json));
1775
- * ```
1776
- *
1777
- * @since 0.2.4
1778
- */
1779
- toJSON(): ICalEventJSONData;
1780
- /**
1781
- * Return generated event as a string.
1782
- *
1783
- * ```javascript
1784
- * const event = ical().createEvent();
1785
- * console.log(event.toString()); // → BEGIN:VEVENT…
1786
- * ```
1787
- */
1788
- toString(): string;
1789
- /**
1790
- * Get the event's transparency
1791
- * @since 1.7.3
1792
- */
1793
- transparency(): ICalEventTransparency | null;
1794
- /**
1795
- * Set the event's transparency
1796
- *
1797
- * Set the field to `OPAQUE` if the person or resource is no longer
1798
- * available due to this event. If the calendar entry has no influence
1799
- * on availability, you can set the field to `TRANSPARENT`. This value
1800
- * is mostly used to find out if a person has time on a certain date or
1801
- * not (see `TRANSP` in iCal specification).
1802
- *
1803
- * ```javascript
1804
- * import ical, {ICalEventTransparency} from 'ical-generator';
1805
- * event.transparency(ICalEventTransparency.OPAQUE);
1806
- * ```
1807
- *
1808
- * @since 1.7.3
1809
- */
1810
- transparency(transparency: ICalEventTransparency | null): this;
1811
- /**
1812
- * Get the event's ID
1813
- * @since 0.2.0
1814
- * @see {@link id}
1815
- */
1816
- uid(): string;
1817
- /**
1818
- * Use this method to set the event's ID.
1819
- * If not set, a UUID will be generated randomly.
1820
- *
1821
- * @param id Event ID you want to set
1822
- */
1823
- uid(id: number | string): this;
1824
- /**
1825
- * Get the event's URL
1826
- * @since 0.2.0
1827
- */
1828
- url(): null | string;
1829
- /**
1830
- * Set the event's URL
1831
- * @since 0.2.0
1832
- */
1833
- url(url: null | string): this;
1834
- /**
1835
- * Set X-* attributes. Woun't filter double attributes,
1836
- * which are also added by another method (e.g. summary),
1837
- * so these attributes may be inserted twice.
1838
- *
1839
- * ```javascript
1840
- * event.x([
1841
- * {
1842
- * key: "X-MY-CUSTOM-ATTR",
1843
- * value: "1337!"
1844
- * }
1845
- * ]);
1846
- *
1847
- * event.x([
1848
- * ["X-MY-CUSTOM-ATTR", "1337!"]
1849
- * ]);
1850
- *
1851
- * event.x({
1852
- * "X-MY-CUSTOM-ATTR": "1337!"
1853
- * });
1854
- * ```
1855
- *
1856
- * @since 1.9.0
1857
- */
1858
- x(keyOrArray: [string, string][] | Record<string, string> | {
1859
- key: string;
1860
- value: string;
1861
- }[]): this;
1862
- /**
1863
- * Set a X-* attribute. Woun't filter double attributes,
1864
- * which are also added by another method (e.g. summary),
1865
- * so these attributes may be inserted twice.
1866
- *
1867
- * ```javascript
1868
- * event.x("X-MY-CUSTOM-ATTR", "1337!");
1869
- * ```
1870
- *
1871
- * @since 1.9.0
1872
- */
1873
- x(keyOrArray: string, value: string): this;
1874
- /**
1875
- * Get all custom X-* attributes.
1876
- * @since 1.9.0
1877
- */
1878
- x(): {
1879
- key: string;
1880
- value: string;
1881
- }[];
1882
- /**
1883
- * Checks if the start date is after the end date and swaps them if necessary.
1884
- * @private
1885
- */
1886
- private swapStartAndEndIfRequired;
1887
- }
1888
-
1889
- declare enum ICalCalendarMethod {
1890
- ADD = "ADD",
1891
- CANCEL = "CANCEL",
1892
- COUNTER = "COUNTER",
1893
- DECLINECOUNTER = "DECLINECOUNTER",
1894
- PUBLISH = "PUBLISH",
1895
- REFRESH = "REFRESH",
1896
- REPLY = "REPLY",
1897
- REQUEST = "REQUEST"
1898
- }
1899
- interface ICalCalendarData {
1900
- color?: null | string;
1901
- description?: null | string;
1902
- events?: (ICalEvent | ICalEventData)[];
1903
- method?: ICalCalendarMethod | null;
1904
- name?: null | string;
1905
- prodId?: ICalCalendarProdIdData | string;
1906
- scale?: null | string;
1907
- source?: null | string;
1908
- timezone?: ICalTimezone | null | string;
1909
- ttl?: ICalMomentDurationStub | null | number;
1910
- url?: null | string;
1911
- x?: [string, string][] | Record<string, string> | {
1912
- key: string;
1913
- value: string;
1914
- }[];
1915
- }
1916
- interface ICalCalendarJSONData {
1917
- color: null | string;
1918
- description: null | string;
1919
- events: ICalEventJSONData[];
1920
- method: ICalCalendarMethod | null;
1921
- name: null | string;
1922
- prodId: string;
1923
- scale: null | string;
1924
- source: null | string;
1925
- timezone: null | string;
1926
- ttl: null | number;
1927
- url: null | string;
1928
- x: {
1929
- key: string;
1930
- value: string;
1931
- }[];
1932
- }
1933
- interface ICalCalendarProdIdData {
1934
- company: string;
1935
- language?: string;
1936
- product: string;
1937
- }
1938
- /**
1939
- * Usually you get an {@link ICalCalendar} object like this:
1940
- * ```javascript
1941
- * import ical from 'ical-generator';
1942
- * const calendar = ical();
1943
- * ```
1944
- *
1945
- * But you can also use the constructor directly like this:
1946
- * ```javascript
1947
- * import {ICalCalendar} from 'ical-generator';
1948
- * const calendar = new ICalCalendar();
1949
- * ```
1950
- */
1951
- declare class ICalCalendar {
1952
- private readonly data;
1953
- /**
1954
- * You can pass options to set up your calendar or use setters to do this.
1955
- *
1956
- * ```javascript
1957
- * * import ical from 'ical-generator';
1958
- *
1959
- * // or use require:
1960
- * // const { default: ical } = require('ical-generator');
1961
- *
1962
- *
1963
- * const cal = ical({name: 'my first iCal'});
1964
- *
1965
- * // is the same as
1966
- *
1967
- * const cal = ical().name('my first iCal');
1968
- *
1969
- * // is the same as
1970
- *
1971
- * const cal = ical();
1972
- * cal.name('sebbo.net');
1973
- * ```
1974
- *
1975
- * `cal.toString()` would then produce the following string:
1976
- * ```text
1977
- * BEGIN:VCALENDAR
1978
- * VERSION:2.0
1979
- * PRODID:-//sebbo.net//ical-generator//EN
1980
- * NAME:sebbo.net
1981
- * X-WR-CALNAME:sebbo.net
1982
- * END:VCALENDAR
1983
- * ```
1984
- *
1985
- * @param data Calendar data
1986
- */
1987
- constructor(data?: ICalCalendarData);
1988
- /**
1989
- * Remove all events from the calendar without
1990
- * touching any other data like name or prodId.
1991
- *
1992
- * @since 2.0.0-develop.1
1993
- */
1994
- clear(): this;
1995
- /**
1996
- * Get your feed's color
1997
- * @returns {null|string}
1998
- */
1999
- color(): null | string;
2000
- /**
2001
- * Set your feed's color
2002
- * (Only supported on Apple calendar clients)
2003
- * @param {null|string} color \# followed by six character hex color code
2004
- */
2005
- color(color: null | string): this;
2006
- /**
2007
- * Creates a new {@link ICalEvent} and returns it. Use options to prefill the event's attributes.
2008
- * Calling this method without options will create an empty event.
2009
- *
2010
- * ```javascript
2011
- * import ical from 'ical-generator';
2012
- *
2013
- * // or use require:
2014
- * // const { default: ical } = require('ical-generator');
2015
- *
2016
- * const cal = ical();
2017
- * const event = cal.createEvent({summary: 'My Event'});
2018
- *
2019
- * // overwrite event summary
2020
- * event.summary('Your Event');
2021
- * ```
2022
- *
2023
- * @since 0.2.0
2024
- */
2025
- createEvent(data: ICalEvent | ICalEventData): ICalEvent;
2026
- /**
2027
- * Get your feed's description
2028
- * @since 0.2.7
2029
- */
2030
- description(): null | string;
2031
- /**
2032
- * Set your feed's description
2033
- * @since 0.2.7
2034
- */
2035
- description(description: null | string): this;
2036
- /**
2037
- * Returns all events of this calendar.
2038
- *
2039
- * ```javascript
2040
- * const cal = ical();
2041
- *
2042
- * cal.events([
2043
- * {
2044
- * start: new Date(),
2045
- * end: new Date(new Date().getTime() + 3600000),
2046
- * summary: 'Example Event',
2047
- * description: 'It works ;)',
2048
- * url: 'http://sebbo.net/'
2049
- * }
2050
- * ]);
2051
- *
2052
- * cal.events(); // --> [ICalEvent]
2053
- * ```
2054
- *
2055
- * @since 0.2.0
2056
- */
2057
- events(): ICalEvent[];
2058
- /**
2059
- * Add multiple events to your calendar.
2060
- *
2061
- * ```javascript
2062
- * const cal = ical();
2063
- *
2064
- * cal.events([
2065
- * {
2066
- * start: new Date(),
2067
- * end: new Date(new Date().getTime() + 3600000),
2068
- * summary: 'Example Event',
2069
- * description: 'It works ;)',
2070
- * url: 'http://sebbo.net/'
2071
- * }
2072
- * ]);
2073
- *
2074
- * cal.events(); // --> [ICalEvent]
2075
- * ```
2076
- *
2077
- * @since 0.2.0
2078
- */
2079
- events(events: (ICalEvent | ICalEventData)[]): this;
2080
- /**
2081
- * Get the number of events added to your calendar
2082
- */
2083
- length(): number;
2084
- /**
2085
- * Get the feed method attribute.
2086
- * See {@link ICalCalendarMethod} for possible results.
2087
- *
2088
- * @since 0.2.8
2089
- */
2090
- method(): ICalCalendarMethod | null;
2091
- /**
2092
- * Set the feed method attribute.
2093
- * See {@link ICalCalendarMethod} for available options.
2094
- *
2095
- * #### Typescript Example
2096
- * ```typescript
2097
- * import {ICalCalendarMethod} from 'ical-generator';
2098
- *
2099
- * // METHOD:PUBLISH
2100
- * calendar.method(ICalCalendarMethod.PUBLISH);
2101
- * ```
2102
- *
2103
- * @since 0.2.8
2104
- */
2105
- method(method: ICalCalendarMethod | null): this;
2106
- /**
2107
- * Get your feed's name
2108
- * @since 0.2.0
2109
- */
2110
- name(): null | string;
2111
- /**
2112
- * Set your feed's name. Is used to fill `NAME`
2113
- * and `X-WR-CALNAME` in your iCal file.
2114
- *
2115
- * ```typescript
2116
- * import ical from 'ical-generator';
2117
- *
2118
- * const cal = ical();
2119
- * cal.name('Next Arrivals');
2120
- *
2121
- * cal.toString();
2122
- * ```
2123
- *
2124
- * ```text
2125
- * BEGIN:VCALENDAR
2126
- * VERSION:2.0
2127
- * PRODID:-//sebbo.net//ical-generator//EN
2128
- * NAME:Next Arrivals
2129
- * X-WR-CALNAME:Next Arrivals
2130
- * END:VCALENDAR
2131
- * ```
2132
- *
2133
- * @since 0.2.0
2134
- */
2135
- name(name: null | string): this;
2136
- /**
2137
- * Get your feed's prodid. Will always return a string.
2138
- * @since 0.2.0
2139
- */
2140
- prodId(): string;
2141
- /**
2142
- * Set your feed's prodid. `prodid` can be either a
2143
- * string like `//sebbo.net//ical-generator//EN` or a
2144
- * valid {@link ICalCalendarProdIdData} object. `language`
2145
- * is optional and defaults to `EN`.
2146
- *
2147
- * ```javascript
2148
- * cal.prodId({
2149
- * company: 'My Company',
2150
- * product: 'My Product',
2151
- * language: 'EN' // optional, defaults to EN
2152
- * });
2153
- * ```
2154
- *
2155
- * `cal.toString()` would then produce the following string:
2156
- * ```text
2157
- * PRODID:-//My Company//My Product//EN
2158
- * ```
2159
- *
2160
- * @since 0.2.0
2161
- */
2162
- prodId(prodId: ICalCalendarProdIdData | string): this;
2163
- /**
2164
- * Get current value of the `CALSCALE` attribute. It will
2165
- * return `null` if no value was set. The iCal standard
2166
- * specifies this as `GREGORIAN` if no value is present.
2167
- *
2168
- * @since 1.8.0
2169
- */
2170
- scale(): null | string;
2171
- /**
2172
- * Use this method to set your feed's `CALSCALE` attribute. There is no
2173
- * default value for this property and it will not appear in your iCal
2174
- * file unless set. The iCal standard specifies this as `GREGORIAN` if
2175
- * no value is present.
2176
- *
2177
- * ```javascript
2178
- * cal.scale('gregorian');
2179
- * ```
2180
- *
2181
- * @since 1.8.0
2182
- */
2183
- scale(scale: null | string): this;
2184
- /**
2185
- * Get current value of the `SOURCE` attribute.
2186
- * @since 2.2.0-develop.1
2187
- */
2188
- source(): null | string;
2189
- /**
2190
- * Use this method to set your feed's `SOURCE` attribute.
2191
- * This tells the client where to refresh your feed.
2192
- *
2193
- * ```javascript
2194
- * cal.source('http://example.com/my/original_source.ical');
2195
- * ```
2196
- *
2197
- * ```text
2198
- * SOURCE;VALUE=URI:http://example.com/my/original_source.ical
2199
- * ```
2200
- *
2201
- * @since 2.2.0-develop.1
2202
- */
2203
- source(source: null | string): this;
2204
- /**
2205
- * Get the current calendar timezone
2206
- * @since 0.2.0
2207
- */
2208
- timezone(): null | string;
2209
- /**
2210
- * Use this method to set your feed's timezone. Is used
2211
- * to fill `TIMEZONE-ID` and `X-WR-TIMEZONE` in your iCal export.
2212
- * Please not that all date values are treaded differently, if
2213
- * a timezone was set. See {@link formatDate} for details. If no
2214
- * time zone is specified, all information is output as UTC.
2215
- *
2216
- * ```javascript
2217
- * cal.timezone('America/New_York');
2218
- * ```
2219
- *
2220
- * @see https://github.com/sebbo2002/ical-generator#-date-time--timezones
2221
- * @since 0.2.0
2222
- */
2223
- timezone(timezone: null | string): this;
2224
- /**
2225
- * Sets the time zone to be used in this calendar file for all times of all
2226
- * events. Please note that if the time zone is set, ical-generator assumes
2227
- * that all times are already in the correct time zone. Alternatively, a
2228
- * `moment-timezone` or a Luxon object can be passed with `setZone`,
2229
- * ical-generator will then set the time zone itself.
2230
- *
2231
- * For the best support of time zones, a VTimezone entry in the calendar is
2232
- * recommended, which informs the client about the corresponding time zones
2233
- * (daylight saving time, deviation from UTC, etc.). `ical-generator` itself
2234
- * does not have a time zone database, so an external generator is needed here.
2235
- *
2236
- * A VTimezone generator is a function that takes a time zone as a string and
2237
- * returns a VTimezone component according to the ical standard. For example,
2238
- * ical-timezones can be used for this:
2239
- *
2240
- * ```typescript
2241
- * import ical from 'ical-generator';
2242
- * import {getVtimezoneComponent} from '@touch4it/ical-timezones';
2243
- *
2244
- * const cal = ical();
2245
- * cal.timezone({
2246
- * name: 'FOO',
2247
- * generator: getVtimezoneComponent
2248
- * });
2249
- * cal.createEvent({
2250
- * start: new Date(),
2251
- * timezone: 'Europe/London'
2252
- * });
2253
- * ```
2254
- *
2255
- * @see https://github.com/sebbo2002/ical-generator#-date-time--timezones
2256
- * @since 2.0.0
2257
- */
2258
- timezone(timezone: ICalTimezone | null | string): this;
2259
- /**
2260
- * Return a shallow copy of the calendar's options for JSON stringification.
2261
- * Third party objects like moment.js values or RRule objects are stringified
2262
- * as well. Can be used for persistence.
2263
- *
2264
- * ```javascript
2265
- * const cal = ical();
2266
- * const json = JSON.stringify(cal);
2267
- *
2268
- * // later: restore calendar data
2269
- * cal = ical(JSON.parse(json));
2270
- * ```
2271
- *
2272
- * @since 0.2.4
2273
- */
2274
- toJSON(): ICalCalendarJSONData;
2275
- /**
2276
- * Return generated calendar as a string.
2277
- *
2278
- * ```javascript
2279
- * const cal = ical();
2280
- * console.log(cal.toString()); // → BEGIN:VCALENDAR…
2281
- * ```
2282
- */
2283
- toString(): string;
2284
- /**
2285
- * Get the current ttl duration in seconds
2286
- * @since 0.2.5
2287
- */
2288
- ttl(): null | number;
2289
- /**
2290
- * Use this method to set your feed's time to live
2291
- * (in seconds). Is used to fill `REFRESH-INTERVAL` and
2292
- * `X-PUBLISHED-TTL` in your iCal.
2293
- *
2294
- * ```javascript
2295
- * const cal = ical().ttl(60 * 60 * 24); // 1 day
2296
- * ```
2297
- *
2298
- * You can also pass a moment.js duration object. Zero, null
2299
- * or negative numbers will reset the `ttl` attribute.
2300
- *
2301
- * @since 0.2.5
2302
- */
2303
- ttl(ttl: ICalMomentDurationStub | null | number): this;
2304
- /**
2305
- * Get your feed's URL
2306
- * @since 0.2.5
2307
- */
2308
- url(): null | string;
2309
- /**
2310
- * Set your feed's URL
2311
- *
2312
- * ```javascript
2313
- * calendar.url('http://example.com/my/feed.ical');
2314
- * ```
2315
- *
2316
- * @since 0.2.5
2317
- */
2318
- url(url: null | string): this;
2319
- /**
2320
- * Set X-* attributes. Woun't filter double attributes,
2321
- * which are also added by another method (e.g. busystatus),
2322
- * so these attributes may be inserted twice.
2323
- *
2324
- * ```javascript
2325
- * calendar.x([
2326
- * {
2327
- * key: "X-MY-CUSTOM-ATTR",
2328
- * value: "1337!"
2329
- * }
2330
- * ]);
2331
- *
2332
- * calendar.x([
2333
- * ["X-MY-CUSTOM-ATTR", "1337!"]
2334
- * ]);
2335
- *
2336
- * calendar.x({
2337
- * "X-MY-CUSTOM-ATTR": "1337!"
2338
- * });
2339
- * ```
2340
- *
2341
- * ```text
2342
- * BEGIN:VCALENDAR
2343
- * VERSION:2.0
2344
- * PRODID:-//sebbo.net//ical-generator//EN
2345
- * X-MY-CUSTOM-ATTR:1337!
2346
- * END:VCALENDAR
2347
- * ```
2348
- *
2349
- * @since 1.9.0
2350
- */
2351
- x(keyOrArray: [string, string][] | Record<string, string> | {
2352
- key: string;
2353
- value: string;
2354
- }[]): this;
2355
- /**
2356
- * Set a X-* attribute. Woun't filter double attributes,
2357
- * which are also added by another method (e.g. busystatus),
2358
- * so these attributes may be inserted twice.
2359
- *
2360
- * ```javascript
2361
- * calendar.x("X-MY-CUSTOM-ATTR", "1337!");
2362
- * ```
2363
- *
2364
- * ```text
2365
- * BEGIN:VCALENDAR
2366
- * VERSION:2.0
2367
- * PRODID:-//sebbo.net//ical-generator//EN
2368
- * X-MY-CUSTOM-ATTR:1337!
2369
- * END:VCALENDAR
2370
- * ```
2371
- *
2372
- * @since 1.9.0
2373
- */
2374
- x(keyOrArray: string, value: string): this;
2375
- /**
2376
- * Get all custom X-* attributes.
2377
- * @since 1.9.0
2378
- */
2379
- x(): {
2380
- key: string;
2381
- value: string;
2382
- }[];
2383
- }
2384
-
2385
- /**
2386
- * Escapes special characters in the given string
2387
- */
2388
- declare function escape(str: string | unknown, inQuotes: boolean): string;
2389
- /**
2390
- * Trim line length of given string
2391
- */
2392
- declare function foldLines(input: string): string;
2393
- /**
2394
- * Converts a valid date/time object supported by this library to a string.
2395
- */
2396
- declare function formatDate(timezone: null | string, d: ICalDateTimeValue, dateonly?: boolean, floating?: boolean): string;
2397
- /**
2398
- * Converts a valid date/time object supported by this library to a string.
2399
- * For information about this format, see RFC 5545, section 3.3.5
2400
- * https://tools.ietf.org/html/rfc5545#section-3.3.5
2401
- */
2402
- declare function formatDateTZ(timezone: null | string, property: string, date: Date | ICalDateTimeValue | string, eventData?: {
2403
- floating?: boolean | null;
2404
- timezone?: null | string;
2405
- }): string;
2406
-
2407
- /**
2408
- * ical-generator entrypoint
2409
- */
2410
-
2411
- /**
2412
- * Create a new, empty calendar and returns it.
2413
- *
2414
- * ```javascript
2415
- * import ical from 'ical-generator';
2416
- *
2417
- * // or use require:
2418
- * // const { default: ical } = require('ical-generator');
2419
- *
2420
- * const cal = ical();
2421
- * ```
2422
- *
2423
- * You can pass options to setup your calendar or use setters to do this.
2424
- *
2425
- * ```javascript
2426
- * import ical from 'ical-generator';
2427
- *
2428
- * // or use require:
2429
- * // const { default: ical } = require('ical-generator');
2430
- * const cal = ical({domain: 'sebbo.net'});
2431
- *
2432
- * // is the same as
2433
- *
2434
- * const cal = ical().domain('sebbo.net');
2435
- *
2436
- * // is the same as
2437
- *
2438
- * const cal = ical();
2439
- * cal.domain('sebbo.net');
2440
- * ```
2441
- *
2442
- * @param data Calendar data
2443
- */
2444
- declare function ical(data?: ICalCalendarData): ICalCalendar;
2445
-
2446
- export { ICalAlarm, type ICalAlarmBaseData, type ICalAlarmData, type ICalAlarmJSONData, ICalAlarmRelatesTo, type ICalAlarmRepeatData, type ICalAlarmTriggerAfterData, type ICalAlarmTriggerBeforeData, type ICalAlarmTriggerData, ICalAlarmType, type ICalAlarmTypeValue, type ICalAttachment, ICalAttendee, type ICalAttendeeData, type ICalAttendeeJSONData, ICalAttendeeRole, ICalAttendeeScheduleAgent, ICalAttendeeStatus, ICalAttendeeType, ICalCalendar, type ICalCalendarData, type ICalCalendarJSONData, ICalCalendarMethod, type ICalCalendarProdIdData, ICalCategory, type ICalCategoryData, type ICalCategoryJSONData, type ICalDateTimeValue, type ICalDayJsStub, type ICalDescription, ICalEvent, ICalEventBusyStatus, ICalEventClass, type ICalEventData, type ICalEventJSONData, type ICalEventJSONRepeatingData, ICalEventRepeatingFreq, ICalEventStatus, ICalEventTransparency, type ICalGeo, type ICalLocation, type ICalLocationWithTitle, type ICalLocationWithoutTitle, type ICalLuxonDateTimeStub, type ICalMomentDurationStub, type ICalMomentStub, type ICalMomentTimezoneStub, type ICalOrganizer, type ICalRRuleStub, type ICalRepeatingOptions, type ICalTZDateStub, type ICalTemporalInstantStub, type ICalTemporalPlainDateStub, type ICalTemporalPlainDateTimeStub, type ICalTemporalZonedDateTimeStub, type ICalTimezone, ICalWeekday, ical as default, escape, foldLines, formatDate, formatDateTZ };