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