ical-generator 3.6.2-develop.3 → 4.0.0-develop.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/index.d.mts +2108 -0
- package/dist/index.d.ts +2073 -11
- package/dist/index.js +76 -78
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +77 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +19 -12
- package/src/calendar.ts +2 -2
- package/src/event.ts +1 -1
- package/src/index.ts +2 -7
- package/src/tools.ts +1 -1
- package/dist/alarm.d.ts +0 -326
- package/dist/alarm.js +0 -279
- package/dist/alarm.js.map +0 -1
- package/dist/attendee.d.ts +0 -306
- package/dist/attendee.js +0 -324
- package/dist/attendee.js.map +0 -1
- package/dist/calendar.d.ts +0 -490
- package/dist/calendar.js +0 -417
- package/dist/calendar.js.map +0 -1
- package/dist/category.d.ts +0 -57
- package/dist/category.js +0 -65
- package/dist/category.js.map +0 -1
- package/dist/event.d.ts +0 -776
- package/dist/event.js +0 -820
- package/dist/event.js.map +0 -1
- package/dist/tools.d.ts +0 -67
- package/dist/tools.js +0 -341
- package/dist/tools.js.map +0 -1
- package/dist/types.d.ts +0 -97
- package/dist/types.js +0 -24
- package/dist/types.js.map +0 -1
package/dist/event.d.ts
DELETED
|
@@ -1,776 +0,0 @@
|
|
|
1
|
-
import ICalAttendee, { ICalAttendeeData } from './attendee';
|
|
2
|
-
import ICalAlarm, { ICalAlarmData } from './alarm';
|
|
3
|
-
import ICalCategory, { ICalCategoryData } from './category';
|
|
4
|
-
import ICalCalendar from './calendar';
|
|
5
|
-
import { ICalDateTimeValue, ICalDescription, ICalEventRepeatingFreq, ICalLocation, ICalOrganizer, ICalRepeatingOptions, ICalRRuleStub, ICalWeekday } from './types';
|
|
6
|
-
export declare enum ICalEventStatus {
|
|
7
|
-
CONFIRMED = "CONFIRMED",
|
|
8
|
-
TENTATIVE = "TENTATIVE",
|
|
9
|
-
CANCELLED = "CANCELLED"
|
|
10
|
-
}
|
|
11
|
-
export declare enum ICalEventBusyStatus {
|
|
12
|
-
FREE = "FREE",
|
|
13
|
-
TENTATIVE = "TENTATIVE",
|
|
14
|
-
BUSY = "BUSY",
|
|
15
|
-
OOF = "OOF"
|
|
16
|
-
}
|
|
17
|
-
export declare enum ICalEventTransparency {
|
|
18
|
-
TRANSPARENT = "TRANSPARENT",
|
|
19
|
-
OPAQUE = "OPAQUE"
|
|
20
|
-
}
|
|
21
|
-
export declare enum ICalEventClass {
|
|
22
|
-
PUBLIC = "PUBLIC",
|
|
23
|
-
PRIVATE = "PRIVATE",
|
|
24
|
-
CONFIDENTIAL = "CONFIDENTIAL"
|
|
25
|
-
}
|
|
26
|
-
export interface ICalEventData {
|
|
27
|
-
id?: string | number | null;
|
|
28
|
-
sequence?: number;
|
|
29
|
-
start?: ICalDateTimeValue | null;
|
|
30
|
-
end?: ICalDateTimeValue | null;
|
|
31
|
-
recurrenceId?: ICalDateTimeValue | null;
|
|
32
|
-
timezone?: string | null;
|
|
33
|
-
stamp?: ICalDateTimeValue;
|
|
34
|
-
allDay?: boolean;
|
|
35
|
-
floating?: boolean;
|
|
36
|
-
repeating?: ICalRepeatingOptions | ICalRRuleStub | string | null;
|
|
37
|
-
summary?: string;
|
|
38
|
-
location?: ICalLocation | string | null;
|
|
39
|
-
description?: ICalDescription | string | null;
|
|
40
|
-
organizer?: ICalOrganizer | string | null;
|
|
41
|
-
attendees?: ICalAttendee[] | ICalAttendeeData[];
|
|
42
|
-
alarms?: ICalAlarm[] | ICalAlarmData[];
|
|
43
|
-
categories?: ICalCategory[] | ICalCategoryData[];
|
|
44
|
-
status?: ICalEventStatus | null;
|
|
45
|
-
busystatus?: ICalEventBusyStatus | null;
|
|
46
|
-
priority?: number | null;
|
|
47
|
-
url?: string | null;
|
|
48
|
-
attachments?: string[];
|
|
49
|
-
transparency?: ICalEventTransparency | null;
|
|
50
|
-
created?: ICalDateTimeValue | null;
|
|
51
|
-
lastModified?: ICalDateTimeValue | null;
|
|
52
|
-
class?: ICalEventClass | null;
|
|
53
|
-
x?: {
|
|
54
|
-
key: string;
|
|
55
|
-
value: string;
|
|
56
|
-
}[] | [string, string][] | Record<string, string>;
|
|
57
|
-
}
|
|
58
|
-
export interface ICalEventJSONData {
|
|
59
|
-
id: string;
|
|
60
|
-
sequence: number;
|
|
61
|
-
start: string | null;
|
|
62
|
-
end: string | null;
|
|
63
|
-
recurrenceId: string | null;
|
|
64
|
-
timezone: string | null;
|
|
65
|
-
stamp: string;
|
|
66
|
-
allDay: boolean;
|
|
67
|
-
floating: boolean;
|
|
68
|
-
repeating: ICalEventInternalRepeatingData | string | null;
|
|
69
|
-
summary: string;
|
|
70
|
-
location: ICalLocation | null;
|
|
71
|
-
description: ICalDescription | null;
|
|
72
|
-
organizer: ICalOrganizer | null;
|
|
73
|
-
attendees: ICalAttendee[];
|
|
74
|
-
alarms: ICalAlarm[];
|
|
75
|
-
categories: ICalCategory[];
|
|
76
|
-
status: ICalEventStatus | null;
|
|
77
|
-
busystatus: ICalEventBusyStatus | null;
|
|
78
|
-
priority?: number | null;
|
|
79
|
-
url: string | null;
|
|
80
|
-
attachments: string[];
|
|
81
|
-
transparency: ICalEventTransparency | null;
|
|
82
|
-
created: string | null;
|
|
83
|
-
lastModified: string | null;
|
|
84
|
-
x: {
|
|
85
|
-
key: string;
|
|
86
|
-
value: string;
|
|
87
|
-
}[];
|
|
88
|
-
}
|
|
89
|
-
interface ICalEventInternalRepeatingData {
|
|
90
|
-
freq: ICalEventRepeatingFreq;
|
|
91
|
-
count?: number;
|
|
92
|
-
interval?: number;
|
|
93
|
-
until?: ICalDateTimeValue;
|
|
94
|
-
byDay?: ICalWeekday[];
|
|
95
|
-
byMonth?: number[];
|
|
96
|
-
byMonthDay?: number[];
|
|
97
|
-
bySetPos?: number[];
|
|
98
|
-
exclude?: ICalDateTimeValue[];
|
|
99
|
-
startOfWeek?: ICalWeekday;
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* Usually you get an `ICalCalendar` object like this:
|
|
103
|
-
* ```javascript
|
|
104
|
-
* import ical from 'ical-generator';
|
|
105
|
-
* const calendar = ical();
|
|
106
|
-
* const event = calendar.createEvent();
|
|
107
|
-
* ```
|
|
108
|
-
*/
|
|
109
|
-
export default class ICalEvent {
|
|
110
|
-
private readonly data;
|
|
111
|
-
private readonly calendar;
|
|
112
|
-
/**
|
|
113
|
-
* Constructor of [[`ICalEvent`]. The calendar reference is
|
|
114
|
-
* required to query the calendar's timezone when required.
|
|
115
|
-
*
|
|
116
|
-
* @param data Calendar Event Data
|
|
117
|
-
* @param calendar Reference to ICalCalendar object
|
|
118
|
-
*/
|
|
119
|
-
constructor(data: ICalEventData, calendar: ICalCalendar);
|
|
120
|
-
/**
|
|
121
|
-
* Get the event's ID
|
|
122
|
-
* @since 0.2.0
|
|
123
|
-
*/
|
|
124
|
-
id(): string;
|
|
125
|
-
/**
|
|
126
|
-
* Use this method to set the event's ID.
|
|
127
|
-
* If not set, a UUID will be generated randomly.
|
|
128
|
-
*
|
|
129
|
-
* @param id Event ID you want to set
|
|
130
|
-
*/
|
|
131
|
-
id(id: string | number): this;
|
|
132
|
-
/**
|
|
133
|
-
* Get the event's ID
|
|
134
|
-
* @since 0.2.0
|
|
135
|
-
* @alias id
|
|
136
|
-
*/
|
|
137
|
-
uid(): string;
|
|
138
|
-
/**
|
|
139
|
-
* Use this method to set the event's ID.
|
|
140
|
-
* If not set, a UUID will be generated randomly.
|
|
141
|
-
*
|
|
142
|
-
* @param id Event ID you want to set
|
|
143
|
-
* @alias id
|
|
144
|
-
*/
|
|
145
|
-
uid(id: string | number): this;
|
|
146
|
-
/**
|
|
147
|
-
* Get the event's SEQUENCE number. Use this method to get the event's
|
|
148
|
-
* revision sequence number of the calendar component within a sequence of revisions.
|
|
149
|
-
*
|
|
150
|
-
* @since 0.2.6
|
|
151
|
-
*/
|
|
152
|
-
sequence(): number;
|
|
153
|
-
/**
|
|
154
|
-
* Set the event's SEQUENCE number. For a new event, this should be zero.
|
|
155
|
-
* Each time the organizer makes a significant revision, the sequence
|
|
156
|
-
* number should be incremented.
|
|
157
|
-
*
|
|
158
|
-
* @param sequence Sequence number or null to unset it
|
|
159
|
-
*/
|
|
160
|
-
sequence(sequence: number): this;
|
|
161
|
-
/**
|
|
162
|
-
* Get the event start time which is currently
|
|
163
|
-
* set. Can be any supported date object.
|
|
164
|
-
*
|
|
165
|
-
* @since 0.2.0
|
|
166
|
-
*/
|
|
167
|
-
start(): ICalDateTimeValue | null;
|
|
168
|
-
/**
|
|
169
|
-
* Set the appointment date of beginning, which is required for all events.
|
|
170
|
-
* You can use any supported date object, see
|
|
171
|
-
* [Readme](https://github.com/sebbo2002/ical-generator#-date-time--timezones)
|
|
172
|
-
* for details about supported values and timezone handling.
|
|
173
|
-
*
|
|
174
|
-
* @since 0.2.0
|
|
175
|
-
*/
|
|
176
|
-
start(start: ICalDateTimeValue): this;
|
|
177
|
-
/**
|
|
178
|
-
* Get the event end time which is currently
|
|
179
|
-
* set. Can be any supported date object.
|
|
180
|
-
*
|
|
181
|
-
* @since 0.2.0
|
|
182
|
-
*/
|
|
183
|
-
end(): ICalDateTimeValue | null;
|
|
184
|
-
/**
|
|
185
|
-
* Set the appointment date of end. You can use any supported date object, see
|
|
186
|
-
* [readme](https://github.com/sebbo2002/ical-generator#-date-time--timezones)
|
|
187
|
-
* for details about supported values and timezone handling.
|
|
188
|
-
*
|
|
189
|
-
* @since 0.2.0
|
|
190
|
-
*/
|
|
191
|
-
end(end: ICalDateTimeValue | null): this;
|
|
192
|
-
/**
|
|
193
|
-
* Get the event's recurrence id
|
|
194
|
-
* @since 0.2.0
|
|
195
|
-
*/
|
|
196
|
-
recurrenceId(): ICalDateTimeValue | null;
|
|
197
|
-
/**
|
|
198
|
-
* Set the event's recurrence id. You can use any supported date object, see
|
|
199
|
-
* [readme](https://github.com/sebbo2002/ical-generator#-date-time--timezones)
|
|
200
|
-
* for details about supported values and timezone handling.
|
|
201
|
-
*
|
|
202
|
-
* @since 0.2.0
|
|
203
|
-
*/
|
|
204
|
-
recurrenceId(recurrenceId: ICalDateTimeValue | null): this;
|
|
205
|
-
/**
|
|
206
|
-
* Get the event's timezone.
|
|
207
|
-
* @since 0.2.6
|
|
208
|
-
*/
|
|
209
|
-
timezone(): string | null;
|
|
210
|
-
/**
|
|
211
|
-
* Sets the time zone to be used for this event. If a time zone has been
|
|
212
|
-
* defined in both the event and the calendar, the time zone of the event
|
|
213
|
-
* is used.
|
|
214
|
-
*
|
|
215
|
-
* Please note that if the time zone is set, ical-generator assumes
|
|
216
|
-
* that all times are already in the correct time zone. Alternatively,
|
|
217
|
-
* a `moment-timezone` or a Luxon object can be passed with `setZone`,
|
|
218
|
-
* ical-generator will then set the time zone itself.
|
|
219
|
-
*
|
|
220
|
-
* This and the 'floating' flag (see below) are mutually exclusive, and setting a timezone will unset the
|
|
221
|
-
* 'floating' flag. If neither 'timezone' nor 'floating' are set, the date will be output with in UTC format
|
|
222
|
-
* (see [date-time form #2 in section 3.3.5 of RFC 554](https://tools.ietf.org/html/rfc5545#section-3.3.5)).
|
|
223
|
-
*
|
|
224
|
-
* See [Readme](https://github.com/sebbo2002/ical-generator#-date-time--timezones) for details about
|
|
225
|
-
* supported values and timezone handling.
|
|
226
|
-
*
|
|
227
|
-
* ```javascript
|
|
228
|
-
* event.timezone('America/New_York');
|
|
229
|
-
* ```
|
|
230
|
-
*
|
|
231
|
-
* @see https://github.com/sebbo2002/ical-generator#-date-time--timezones
|
|
232
|
-
* @since 0.2.6
|
|
233
|
-
*/
|
|
234
|
-
timezone(timezone: string | null): this;
|
|
235
|
-
/**
|
|
236
|
-
* Get the event's timestamp
|
|
237
|
-
* @since 0.2.0
|
|
238
|
-
*/
|
|
239
|
-
stamp(): ICalDateTimeValue;
|
|
240
|
-
/**
|
|
241
|
-
* Set the appointment date of creation. Defaults to the current time and date (`new Date()`). You can use
|
|
242
|
-
* any supported date object, see [readme](https://github.com/sebbo2002/ical-generator#-date-time--timezones)
|
|
243
|
-
* for details about supported values and timezone handling.
|
|
244
|
-
*
|
|
245
|
-
* @since 0.2.0
|
|
246
|
-
*/
|
|
247
|
-
stamp(stamp: ICalDateTimeValue): this;
|
|
248
|
-
/**
|
|
249
|
-
* Get the event's timestamp
|
|
250
|
-
* @since 0.2.0
|
|
251
|
-
* @alias stamp
|
|
252
|
-
*/
|
|
253
|
-
timestamp(): ICalDateTimeValue;
|
|
254
|
-
/**
|
|
255
|
-
* Set the appointment date of creation. Defaults to the current time and date (`new Date()`). You can use
|
|
256
|
-
* any supported date object, see [readme](https://github.com/sebbo2002/ical-generator#-date-time--timezones)
|
|
257
|
-
* for details about supported values and timezone handling.
|
|
258
|
-
*
|
|
259
|
-
* @since 0.2.0
|
|
260
|
-
* @alias stamp
|
|
261
|
-
*/
|
|
262
|
-
timestamp(stamp: ICalDateTimeValue): this;
|
|
263
|
-
/**
|
|
264
|
-
* Get the event's allDay flag
|
|
265
|
-
* @since 0.2.0
|
|
266
|
-
*/
|
|
267
|
-
allDay(): boolean;
|
|
268
|
-
/**
|
|
269
|
-
* Set the event's allDay flag.
|
|
270
|
-
*
|
|
271
|
-
* ```javascript
|
|
272
|
-
* event.allDay(true); // → appointment is for the whole day
|
|
273
|
-
* ```
|
|
274
|
-
*
|
|
275
|
-
* @since 0.2.0
|
|
276
|
-
*/
|
|
277
|
-
allDay(allDay: boolean): this;
|
|
278
|
-
/**
|
|
279
|
-
* Get the event's floating flag.
|
|
280
|
-
* @since 0.2.0
|
|
281
|
-
*/
|
|
282
|
-
floating(): boolean;
|
|
283
|
-
floating(floating: boolean): this;
|
|
284
|
-
/**
|
|
285
|
-
* Get the event's repeating options
|
|
286
|
-
* @since 0.2.0
|
|
287
|
-
*/
|
|
288
|
-
repeating(): ICalEventInternalRepeatingData | ICalRRuleStub | string | null;
|
|
289
|
-
/**
|
|
290
|
-
* Set the event's repeating options by passing an [[`ICalRepeatingOptions`]] object.
|
|
291
|
-
*
|
|
292
|
-
* ```javascript
|
|
293
|
-
* event.repeating({
|
|
294
|
-
* freq: 'MONTHLY', // required
|
|
295
|
-
* count: 5,
|
|
296
|
-
* interval: 2,
|
|
297
|
-
* until: new Date('Jan 01 2014 00:00:00 UTC'),
|
|
298
|
-
* byDay: ['su', 'mo'], // repeat only sunday and monday
|
|
299
|
-
* byMonth: [1, 2], // repeat only in january and february,
|
|
300
|
-
* byMonthDay: [1, 15], // repeat only on the 1st and 15th
|
|
301
|
-
* bySetPos: 3, // repeat every 3rd sunday (will take the first element of the byDay array)
|
|
302
|
-
* exclude: [new Date('Dec 25 2013 00:00:00 UTC')], // exclude these dates
|
|
303
|
-
* excludeTimezone: 'Europe/Berlin', // timezone of exclude
|
|
304
|
-
* wkst: 'SU' // Start the week on Sunday, default is Monday
|
|
305
|
-
* });
|
|
306
|
-
* ```
|
|
307
|
-
*
|
|
308
|
-
* @since 0.2.0
|
|
309
|
-
*/
|
|
310
|
-
repeating(repeating: ICalRepeatingOptions | null): this;
|
|
311
|
-
/**
|
|
312
|
-
* Set the event's repeating options by passing an [RRule object](https://github.com/jakubroztocil/rrule).
|
|
313
|
-
* @since 2.0.0-develop.5
|
|
314
|
-
*/
|
|
315
|
-
repeating(repeating: ICalRRuleStub | null): this;
|
|
316
|
-
/**
|
|
317
|
-
* Set the events repeating options by passing a string which is inserted in the ical file.
|
|
318
|
-
* @since 2.0.0-develop.5
|
|
319
|
-
*/
|
|
320
|
-
repeating(repeating: string | null): this;
|
|
321
|
-
/**
|
|
322
|
-
* @internal
|
|
323
|
-
*/
|
|
324
|
-
repeating(repeating: ICalRepeatingOptions | ICalRRuleStub | string | null): this;
|
|
325
|
-
/**
|
|
326
|
-
* Get the event's summary
|
|
327
|
-
* @since 0.2.0
|
|
328
|
-
*/
|
|
329
|
-
summary(): string;
|
|
330
|
-
/**
|
|
331
|
-
* Set the event's summary.
|
|
332
|
-
* Defaults to an empty string if nothing is set.
|
|
333
|
-
*
|
|
334
|
-
* @since 0.2.0
|
|
335
|
-
*/
|
|
336
|
-
summary(summary: string): this;
|
|
337
|
-
/**
|
|
338
|
-
* Get the event's location
|
|
339
|
-
* @since 0.2.0
|
|
340
|
-
*/
|
|
341
|
-
location(): ICalLocation | null;
|
|
342
|
-
/**
|
|
343
|
-
* Set the event's location by passing a string (minimum) or
|
|
344
|
-
* an [[`ICalLocation`]] object which will also fill the iCal
|
|
345
|
-
* `GEO` attribute and Apple's `X-APPLE-STRUCTURED-LOCATION`.
|
|
346
|
-
*
|
|
347
|
-
* ```javascript
|
|
348
|
-
* event.location({
|
|
349
|
-
* title: 'Apple Store Kurfürstendamm',
|
|
350
|
-
* address: 'Kurfürstendamm 26, 10719 Berlin, Deutschland',
|
|
351
|
-
* radius: 141.1751386318387,
|
|
352
|
-
* geo: {
|
|
353
|
-
* lat: 52.503630,
|
|
354
|
-
* lon: 13.328650
|
|
355
|
-
* }
|
|
356
|
-
* });
|
|
357
|
-
* ```
|
|
358
|
-
*
|
|
359
|
-
* @since 0.2.0
|
|
360
|
-
*/
|
|
361
|
-
location(location: ICalLocation | string | null): this;
|
|
362
|
-
/**
|
|
363
|
-
* Get the event's description as an [[`ICalDescription`]] object.
|
|
364
|
-
* @since 0.2.0
|
|
365
|
-
*/
|
|
366
|
-
description(): ICalDescription | null;
|
|
367
|
-
/**
|
|
368
|
-
* Set the events description by passing a plaintext string or
|
|
369
|
-
* an object containing both a plaintext and a html description.
|
|
370
|
-
* Only a few calendar apps support html descriptions and like in
|
|
371
|
-
* emails, supported HTML tags and styling is limited.
|
|
372
|
-
*
|
|
373
|
-
* ```javascript
|
|
374
|
-
* event.description({
|
|
375
|
-
* plain: 'Hello World!';
|
|
376
|
-
* html: '<p>Hello World!</p>';
|
|
377
|
-
* });
|
|
378
|
-
* ```
|
|
379
|
-
*
|
|
380
|
-
* @since 0.2.0
|
|
381
|
-
*/
|
|
382
|
-
description(description: ICalDescription | string | null): this;
|
|
383
|
-
/**
|
|
384
|
-
* Get the event's organizer
|
|
385
|
-
* @since 0.2.0
|
|
386
|
-
*/
|
|
387
|
-
organizer(): ICalOrganizer | null;
|
|
388
|
-
/**
|
|
389
|
-
* Set the event's organizer
|
|
390
|
-
*
|
|
391
|
-
* ```javascript
|
|
392
|
-
* event.organizer({
|
|
393
|
-
* name: 'Organizer\'s Name',
|
|
394
|
-
* email: 'organizer@example.com'
|
|
395
|
-
* });
|
|
396
|
-
*
|
|
397
|
-
* // OR
|
|
398
|
-
*
|
|
399
|
-
* event.organizer('Organizer\'s Name <organizer@example.com>');
|
|
400
|
-
* ```
|
|
401
|
-
*
|
|
402
|
-
* You can also add an explicit `mailto` email address or or the sentBy address.
|
|
403
|
-
*
|
|
404
|
-
* ```javascript
|
|
405
|
-
* event.organizer({
|
|
406
|
-
* name: 'Organizer\'s Name',
|
|
407
|
-
* email: 'organizer@example.com',
|
|
408
|
-
* mailto: 'explicit@mailto.com',
|
|
409
|
-
* sentBy: 'substitute@example.com'
|
|
410
|
-
* })
|
|
411
|
-
* ```
|
|
412
|
-
*
|
|
413
|
-
* @since 0.2.0
|
|
414
|
-
*/
|
|
415
|
-
organizer(organizer: ICalOrganizer | string | null): this;
|
|
416
|
-
/**
|
|
417
|
-
* Creates a new [[`ICalAttendee`]] and returns it. Use options to prefill
|
|
418
|
-
* the attendee's attributes. Calling this method without options will create
|
|
419
|
-
* an empty attendee.
|
|
420
|
-
*
|
|
421
|
-
* ```javascript
|
|
422
|
-
* const cal = ical();
|
|
423
|
-
* const event = cal.createEvent();
|
|
424
|
-
* const attendee = event.createAttendee({email: 'hui@example.com', name: 'Hui'});
|
|
425
|
-
*
|
|
426
|
-
* // add another attendee
|
|
427
|
-
* event.createAttendee('Buh <buh@example.net>');
|
|
428
|
-
* ```
|
|
429
|
-
*
|
|
430
|
-
* As with the organizer, you can also add an explicit `mailto` address.
|
|
431
|
-
*
|
|
432
|
-
* ```javascript
|
|
433
|
-
* event.createAttendee({email: 'hui@example.com', name: 'Hui', mailto: 'another@mailto.com'});
|
|
434
|
-
*
|
|
435
|
-
* // overwrite an attendee's mailto address
|
|
436
|
-
* attendee.mailto('another@mailto.net');
|
|
437
|
-
* ```
|
|
438
|
-
*
|
|
439
|
-
* @since 0.2.0
|
|
440
|
-
*/
|
|
441
|
-
createAttendee(data?: ICalAttendee | ICalAttendeeData | string): ICalAttendee;
|
|
442
|
-
/**
|
|
443
|
-
* Get all attendees
|
|
444
|
-
* @since 0.2.0
|
|
445
|
-
*/
|
|
446
|
-
attendees(): ICalAttendee[];
|
|
447
|
-
/**
|
|
448
|
-
* Add multiple attendees to your event
|
|
449
|
-
*
|
|
450
|
-
* ```javascript
|
|
451
|
-
* const event = ical().createEvent();
|
|
452
|
-
*
|
|
453
|
-
* cal.attendees([
|
|
454
|
-
* {email: 'a@example.com', name: 'Person A'},
|
|
455
|
-
* {email: 'b@example.com', name: 'Person B'}
|
|
456
|
-
* ]);
|
|
457
|
-
*
|
|
458
|
-
* cal.attendees(); // --> [ICalAttendee, ICalAttendee]
|
|
459
|
-
* ```
|
|
460
|
-
*
|
|
461
|
-
* @since 0.2.0
|
|
462
|
-
*/
|
|
463
|
-
attendees(attendees: (ICalAttendee | ICalAttendeeData | string)[]): this;
|
|
464
|
-
/**
|
|
465
|
-
* Creates a new [[`ICalAlarm`]] and returns it. Use options to prefill
|
|
466
|
-
* the alarm's attributes. Calling this method without options will create
|
|
467
|
-
* an empty alarm.
|
|
468
|
-
*
|
|
469
|
-
* ```javascript
|
|
470
|
-
* const cal = ical();
|
|
471
|
-
* const event = cal.createEvent();
|
|
472
|
-
* const alarm = event.createAlarm({type: ICalAlarmType.display, trigger: 300});
|
|
473
|
-
*
|
|
474
|
-
* // add another alarm
|
|
475
|
-
* event.createAlarm({
|
|
476
|
-
* type: ICalAlarmType.audio,
|
|
477
|
-
* trigger: 300, // 5min before event
|
|
478
|
-
* });
|
|
479
|
-
* ```
|
|
480
|
-
*
|
|
481
|
-
* @since 0.2.1
|
|
482
|
-
*/
|
|
483
|
-
createAlarm(data?: ICalAlarm | ICalAlarmData): ICalAlarm;
|
|
484
|
-
/**
|
|
485
|
-
* Get all alarms
|
|
486
|
-
* @since 0.2.0
|
|
487
|
-
*/
|
|
488
|
-
alarms(): ICalAlarm[];
|
|
489
|
-
/**
|
|
490
|
-
* Add one or multiple alarms
|
|
491
|
-
*
|
|
492
|
-
* ```javascript
|
|
493
|
-
* const event = ical().createEvent();
|
|
494
|
-
*
|
|
495
|
-
* cal.alarms([
|
|
496
|
-
* {type: ICalAlarmType.display, trigger: 600},
|
|
497
|
-
* {type: ICalAlarmType.audio, trigger: 300}
|
|
498
|
-
* ]);
|
|
499
|
-
*
|
|
500
|
-
* cal.alarms(); // --> [ICalAlarm, ICalAlarm]
|
|
501
|
-
```
|
|
502
|
-
*
|
|
503
|
-
* @since 0.2.0
|
|
504
|
-
*/
|
|
505
|
-
alarms(alarms: ICalAlarm[] | ICalAlarmData[]): this;
|
|
506
|
-
/**
|
|
507
|
-
* Creates a new [[`ICalCategory`]] and returns it. Use options to prefill the categories' attributes.
|
|
508
|
-
* Calling this method without options will create an empty category.
|
|
509
|
-
*
|
|
510
|
-
* ```javascript
|
|
511
|
-
* const cal = ical();
|
|
512
|
-
* const event = cal.createEvent();
|
|
513
|
-
* const category = event.createCategory({name: 'APPOINTMENT'});
|
|
514
|
-
*
|
|
515
|
-
* // add another alarm
|
|
516
|
-
* event.createCategory({
|
|
517
|
-
* name: 'MEETING'
|
|
518
|
-
* });
|
|
519
|
-
* ```
|
|
520
|
-
*
|
|
521
|
-
* @since 0.3.0
|
|
522
|
-
*/
|
|
523
|
-
createCategory(data?: ICalCategory | ICalCategoryData): ICalCategory;
|
|
524
|
-
/**
|
|
525
|
-
* Get all categories
|
|
526
|
-
* @since 0.3.0
|
|
527
|
-
*/
|
|
528
|
-
categories(): ICalCategory[];
|
|
529
|
-
/**
|
|
530
|
-
* Add categories to the event or return all selected categories.
|
|
531
|
-
*
|
|
532
|
-
* ```javascript
|
|
533
|
-
* const event = ical().createEvent();
|
|
534
|
-
*
|
|
535
|
-
* cal.categories([
|
|
536
|
-
* {name: 'APPOINTMENT'},
|
|
537
|
-
* {name: 'MEETING'}
|
|
538
|
-
* ]);
|
|
539
|
-
*
|
|
540
|
-
* cal.categories(); // --> [ICalCategory, ICalCategory]
|
|
541
|
-
* ```
|
|
542
|
-
*
|
|
543
|
-
* @since 0.3.0
|
|
544
|
-
*/
|
|
545
|
-
categories(categories: (ICalCategory | ICalCategoryData)[]): this;
|
|
546
|
-
/**
|
|
547
|
-
* Get the event's status
|
|
548
|
-
* @since 0.2.0
|
|
549
|
-
*/
|
|
550
|
-
status(): ICalEventStatus | null;
|
|
551
|
-
/**
|
|
552
|
-
* Set the event's status
|
|
553
|
-
*
|
|
554
|
-
* ```javascript
|
|
555
|
-
* import ical, {ICalEventStatus} from 'ical-generator';
|
|
556
|
-
* event.status(ICalEventStatus.CONFIRMED);
|
|
557
|
-
* ```
|
|
558
|
-
*
|
|
559
|
-
* @since 0.2.0
|
|
560
|
-
*/
|
|
561
|
-
status(status: ICalEventStatus | null): this;
|
|
562
|
-
/**
|
|
563
|
-
* Get the event's busy status
|
|
564
|
-
* @since 1.0.2
|
|
565
|
-
*/
|
|
566
|
-
busystatus(): ICalEventBusyStatus | null;
|
|
567
|
-
/**
|
|
568
|
-
* Set the event's busy status. Will add the
|
|
569
|
-
* [`X-MICROSOFT-CDO-BUSYSTATUS`](https://docs.microsoft.com/en-us/openspecs/exchange_server_protocols/ms-oxcical/cd68eae7-ed65-4dd3-8ea7-ad585c76c736)
|
|
570
|
-
* attribute to your event.
|
|
571
|
-
*
|
|
572
|
-
* ```javascript
|
|
573
|
-
* import ical, {ICalEventBusyStatus} from 'ical-generator';
|
|
574
|
-
* event.busystatus(ICalEventStatus.BUSY);
|
|
575
|
-
* ```
|
|
576
|
-
*
|
|
577
|
-
* @since 1.0.2
|
|
578
|
-
*/
|
|
579
|
-
busystatus(busystatus: ICalEventBusyStatus | null): this;
|
|
580
|
-
/**
|
|
581
|
-
* Get the event's priority. A value of 1 represents
|
|
582
|
-
* the highest priority, 9 the lowest. 0 specifies an undefined
|
|
583
|
-
* priority.
|
|
584
|
-
*
|
|
585
|
-
* @since v2.0.0-develop.7
|
|
586
|
-
*/
|
|
587
|
-
priority(): number | null;
|
|
588
|
-
/**
|
|
589
|
-
* Set the event's priority. A value of 1 represents
|
|
590
|
-
* the highest priority, 9 the lowest. 0 specifies an undefined
|
|
591
|
-
* priority.
|
|
592
|
-
*
|
|
593
|
-
* @since v2.0.0-develop.7
|
|
594
|
-
*/
|
|
595
|
-
priority(priority: number | null): this;
|
|
596
|
-
/**
|
|
597
|
-
* Get the event's URL
|
|
598
|
-
* @since 0.2.0
|
|
599
|
-
*/
|
|
600
|
-
url(): string | null;
|
|
601
|
-
/**
|
|
602
|
-
* Set the event's URL
|
|
603
|
-
* @since 0.2.0
|
|
604
|
-
*/
|
|
605
|
-
url(url: string | null): this;
|
|
606
|
-
/**
|
|
607
|
-
* Adds an attachment to the event by adding the file URL to the calendar.
|
|
608
|
-
*
|
|
609
|
-
* `ical-generator` only supports external attachments. File attachments that
|
|
610
|
-
* are directly included in the file are not supported, because otherwise the
|
|
611
|
-
* calendar file could easily become unfavourably large.
|
|
612
|
-
*
|
|
613
|
-
* ```javascript
|
|
614
|
-
* const cal = ical();
|
|
615
|
-
* const event = cal.createEvent();
|
|
616
|
-
* event.createAttachment('https://files.sebbo.net/calendar/attachments/foo');
|
|
617
|
-
* ```
|
|
618
|
-
*
|
|
619
|
-
* @since 3.2.0-develop.1
|
|
620
|
-
*/
|
|
621
|
-
createAttachment(url: string): this;
|
|
622
|
-
/**
|
|
623
|
-
* Get all attachment urls
|
|
624
|
-
* @since 3.2.0-develop.1
|
|
625
|
-
*/
|
|
626
|
-
attachments(): string[];
|
|
627
|
-
/**
|
|
628
|
-
* Add one or multiple alarms
|
|
629
|
-
*
|
|
630
|
-
* ```javascript
|
|
631
|
-
* const event = ical().createEvent();
|
|
632
|
-
*
|
|
633
|
-
* cal.attachments([
|
|
634
|
-
* 'https://files.sebbo.net/calendar/attachments/foo',
|
|
635
|
-
* 'https://files.sebbo.net/calendar/attachments/bar'
|
|
636
|
-
* ]);
|
|
637
|
-
*
|
|
638
|
-
* cal.attachments(); // --> [string, string]
|
|
639
|
-
```
|
|
640
|
-
*
|
|
641
|
-
* 3.2.0-develop.1
|
|
642
|
-
*/
|
|
643
|
-
attachments(attachments: string[]): this;
|
|
644
|
-
/**
|
|
645
|
-
* Get the event's transparency
|
|
646
|
-
* @since 1.7.3
|
|
647
|
-
*/
|
|
648
|
-
transparency(): ICalEventTransparency | null;
|
|
649
|
-
/**
|
|
650
|
-
* Set the event's transparency
|
|
651
|
-
*
|
|
652
|
-
* Set the field to `OPAQUE` if the person or resource is no longer
|
|
653
|
-
* available due to this event. If the calendar entry has no influence
|
|
654
|
-
* on availability, you can set the field to `TRANSPARENT`. This value
|
|
655
|
-
* is mostly used to find out if a person has time on a certain date or
|
|
656
|
-
* not (see `TRANSP` in iCal specification).
|
|
657
|
-
*
|
|
658
|
-
* ```javascript
|
|
659
|
-
* import ical, {ICalEventTransparency} from 'ical-generator';
|
|
660
|
-
* event.transparency(ICalEventTransparency.OPAQUE);
|
|
661
|
-
* ```
|
|
662
|
-
*
|
|
663
|
-
* @since 1.7.3
|
|
664
|
-
*/
|
|
665
|
-
transparency(transparency: ICalEventTransparency | null): this;
|
|
666
|
-
/**
|
|
667
|
-
* Get the event's creation date
|
|
668
|
-
* @since 0.3.0
|
|
669
|
-
*/
|
|
670
|
-
created(): ICalDateTimeValue | null;
|
|
671
|
-
/**
|
|
672
|
-
* Set the event's creation date
|
|
673
|
-
* @since 0.3.0
|
|
674
|
-
*/
|
|
675
|
-
created(created: ICalDateTimeValue | null): this;
|
|
676
|
-
/**
|
|
677
|
-
* Get the event's last modification date
|
|
678
|
-
* @since 0.3.0
|
|
679
|
-
*/
|
|
680
|
-
lastModified(): ICalDateTimeValue | null;
|
|
681
|
-
/**
|
|
682
|
-
* Set the event's last modification date
|
|
683
|
-
* @since 0.3.0
|
|
684
|
-
*/
|
|
685
|
-
lastModified(lastModified: ICalDateTimeValue | null): this;
|
|
686
|
-
/**
|
|
687
|
-
* Get the event's class
|
|
688
|
-
* @since 2.0.0
|
|
689
|
-
*/
|
|
690
|
-
class(): ICalEventClass | null;
|
|
691
|
-
/**
|
|
692
|
-
* Set the event's class
|
|
693
|
-
*
|
|
694
|
-
* ```javascript
|
|
695
|
-
* import ical, { ICalEventClass } from 'ical-generator';
|
|
696
|
-
* event.class(ICalEventClass.PRIVATE);
|
|
697
|
-
* ```
|
|
698
|
-
*
|
|
699
|
-
* @since 2.0.0
|
|
700
|
-
*/
|
|
701
|
-
class(class_: ICalEventClass | null): this;
|
|
702
|
-
/**
|
|
703
|
-
* Set X-* attributes. Woun't filter double attributes,
|
|
704
|
-
* which are also added by another method (e.g. summary),
|
|
705
|
-
* so these attributes may be inserted twice.
|
|
706
|
-
*
|
|
707
|
-
* ```javascript
|
|
708
|
-
* event.x([
|
|
709
|
-
* {
|
|
710
|
-
* key: "X-MY-CUSTOM-ATTR",
|
|
711
|
-
* value: "1337!"
|
|
712
|
-
* }
|
|
713
|
-
* ]);
|
|
714
|
-
*
|
|
715
|
-
* event.x([
|
|
716
|
-
* ["X-MY-CUSTOM-ATTR", "1337!"]
|
|
717
|
-
* ]);
|
|
718
|
-
*
|
|
719
|
-
* event.x({
|
|
720
|
-
* "X-MY-CUSTOM-ATTR": "1337!"
|
|
721
|
-
* });
|
|
722
|
-
* ```
|
|
723
|
-
*
|
|
724
|
-
* @since 1.9.0
|
|
725
|
-
*/
|
|
726
|
-
x(keyOrArray: {
|
|
727
|
-
key: string;
|
|
728
|
-
value: string;
|
|
729
|
-
}[] | [string, string][] | Record<string, string>): this;
|
|
730
|
-
/**
|
|
731
|
-
* Set a X-* attribute. Woun't filter double attributes,
|
|
732
|
-
* which are also added by another method (e.g. summary),
|
|
733
|
-
* so these attributes may be inserted twice.
|
|
734
|
-
*
|
|
735
|
-
* ```javascript
|
|
736
|
-
* event.x("X-MY-CUSTOM-ATTR", "1337!");
|
|
737
|
-
* ```
|
|
738
|
-
*
|
|
739
|
-
* @since 1.9.0
|
|
740
|
-
*/
|
|
741
|
-
x(keyOrArray: string, value: string): this;
|
|
742
|
-
/**
|
|
743
|
-
* Get all custom X-* attributes.
|
|
744
|
-
* @since 1.9.0
|
|
745
|
-
*/
|
|
746
|
-
x(): {
|
|
747
|
-
key: string;
|
|
748
|
-
value: string;
|
|
749
|
-
}[];
|
|
750
|
-
/**
|
|
751
|
-
* Return a shallow copy of the events's options for JSON stringification.
|
|
752
|
-
* Third party objects like moment.js values or RRule objects are stringified
|
|
753
|
-
* as well. Can be used for persistence.
|
|
754
|
-
*
|
|
755
|
-
* ```javascript
|
|
756
|
-
* const event = ical().createEvent();
|
|
757
|
-
* const json = JSON.stringify(event);
|
|
758
|
-
*
|
|
759
|
-
* // later: restore event data
|
|
760
|
-
* const calendar = ical().createEvent(JSON.parse(json));
|
|
761
|
-
* ```
|
|
762
|
-
*
|
|
763
|
-
* @since 0.2.4
|
|
764
|
-
*/
|
|
765
|
-
toJSON(): ICalEventJSONData;
|
|
766
|
-
/**
|
|
767
|
-
* Return generated event as a string.
|
|
768
|
-
*
|
|
769
|
-
* ```javascript
|
|
770
|
-
* const event = ical().createEvent();
|
|
771
|
-
* console.log(event.toString()); // → BEGIN:VEVENT…
|
|
772
|
-
* ```
|
|
773
|
-
*/
|
|
774
|
-
toString(): string;
|
|
775
|
-
}
|
|
776
|
-
export {};
|