ical-generator 6.0.2-develop.7 → 6.0.2-develop.8
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 +6 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +41 -41
- package/dist/index.d.ts +41 -41
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/alarm.ts +12 -12
- package/src/attendee.ts +11 -11
- package/src/calendar.ts +6 -6
- package/src/category.ts +6 -5
- package/src/event.ts +13 -13
- package/src/index.ts +8 -2
package/package.json
CHANGED
package/src/alarm.ts
CHANGED
|
@@ -37,11 +37,11 @@ export type ICalAlarmData = ICalAlarmBaseData |
|
|
|
37
37
|
ICalAlarmTriggerAfterData |
|
|
38
38
|
ICalAlarmTriggerBeforeData;
|
|
39
39
|
|
|
40
|
-
type ICalAlarmTriggerData = ICalAlarmBaseData & { trigger: number | ICalDateTimeValue };
|
|
41
|
-
type ICalAlarmTriggerAfterData = ICalAlarmBaseData & { triggerAfter: number | ICalDateTimeValue };
|
|
42
|
-
type ICalAlarmTriggerBeforeData = ICalAlarmBaseData & { triggerBefore: number | ICalDateTimeValue };
|
|
40
|
+
export type ICalAlarmTriggerData = ICalAlarmBaseData & { trigger: number | ICalDateTimeValue };
|
|
41
|
+
export type ICalAlarmTriggerAfterData = ICalAlarmBaseData & { triggerAfter: number | ICalDateTimeValue };
|
|
42
|
+
export type ICalAlarmTriggerBeforeData = ICalAlarmBaseData & { triggerBefore: number | ICalDateTimeValue };
|
|
43
43
|
|
|
44
|
-
interface ICalAlarmBaseData {
|
|
44
|
+
export interface ICalAlarmBaseData {
|
|
45
45
|
type?: ICalAlarmType;
|
|
46
46
|
relatesTo?: ICalAlarmRelatesTo | null;
|
|
47
47
|
repeat?: ICalAlarmRepeatData | null;
|
|
@@ -79,7 +79,7 @@ export interface ICalAlarmJSONData {
|
|
|
79
79
|
|
|
80
80
|
|
|
81
81
|
/**
|
|
82
|
-
* Usually you get an
|
|
82
|
+
* Usually you get an {@link ICalAlarm} object like this:
|
|
83
83
|
*
|
|
84
84
|
* ```javascript
|
|
85
85
|
* import ical from 'ical-generator';
|
|
@@ -88,7 +88,7 @@ export interface ICalAlarmJSONData {
|
|
|
88
88
|
* const alarm = event.createAlarm();
|
|
89
89
|
* ```
|
|
90
90
|
*
|
|
91
|
-
* You can also use the
|
|
91
|
+
* You can also use the {@link ICalAlarm} object directly:
|
|
92
92
|
*
|
|
93
93
|
* ```javascript
|
|
94
94
|
* import ical, {ICalAlarm} from 'ical-generator';
|
|
@@ -101,11 +101,11 @@ export default class ICalAlarm {
|
|
|
101
101
|
private readonly event: ICalEvent;
|
|
102
102
|
|
|
103
103
|
/**
|
|
104
|
-
* Constructor of
|
|
104
|
+
* Constructor of {@link ICalAttendee}. The event reference is required
|
|
105
105
|
* to query the calendar's timezone and summary when required.
|
|
106
106
|
*
|
|
107
107
|
* @param data Alarm Data
|
|
108
|
-
* @param
|
|
108
|
+
* @param event Reference to ICalEvent object
|
|
109
109
|
*/
|
|
110
110
|
constructor (data: ICalAlarmData, event: ICalEvent) {
|
|
111
111
|
this.data = {
|
|
@@ -142,7 +142,7 @@ export default class ICalAlarm {
|
|
|
142
142
|
type (type: ICalAlarmType): this;
|
|
143
143
|
|
|
144
144
|
/**
|
|
145
|
-
* Set the alarm type. See
|
|
145
|
+
* Set the alarm type. See {@link ICalAlarmType}
|
|
146
146
|
* for available status options.
|
|
147
147
|
* @since 0.2.1
|
|
148
148
|
*/
|
|
@@ -162,7 +162,7 @@ export default class ICalAlarm {
|
|
|
162
162
|
|
|
163
163
|
/**
|
|
164
164
|
* Get the trigger time for the alarm. Can either
|
|
165
|
-
* be a date and time value (
|
|
165
|
+
* be a date and time value ({@link ICalDateTimeValue}) or
|
|
166
166
|
* a number, which will represent the seconds between
|
|
167
167
|
* alarm and event start. The number is negative, if the
|
|
168
168
|
* alarm is triggered after the event started.
|
|
@@ -266,7 +266,7 @@ export default class ICalAlarm {
|
|
|
266
266
|
|
|
267
267
|
/**
|
|
268
268
|
* Get the trigger time for the alarm. Can either
|
|
269
|
-
* be a date and time value (
|
|
269
|
+
* be a date and time value ({@link ICalDateTimeValue}) or
|
|
270
270
|
* a number, which will represent the seconds between
|
|
271
271
|
* alarm and event start. The number is negative, if the
|
|
272
272
|
* alarm is triggered before the event started.
|
|
@@ -305,7 +305,7 @@ export default class ICalAlarm {
|
|
|
305
305
|
|
|
306
306
|
/**
|
|
307
307
|
* Get the trigger time for the alarm. Can either
|
|
308
|
-
* be a date and time value (
|
|
308
|
+
* be a date and time value ({@link ICalDateTimeValue}) or
|
|
309
309
|
* a number, which will represent the seconds between
|
|
310
310
|
* alarm and event start. The number is negative, if the
|
|
311
311
|
* alarm is triggered after the event started.
|
package/src/attendee.ts
CHANGED
|
@@ -75,7 +75,7 @@ export enum ICalAttendeeType {
|
|
|
75
75
|
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
|
-
* Usually you get an
|
|
78
|
+
* Usually you get an {@link ICalAttendee} object like this:
|
|
79
79
|
*
|
|
80
80
|
* ```javascript
|
|
81
81
|
* import ical from 'ical-generator';
|
|
@@ -84,7 +84,7 @@ export enum ICalAttendeeType {
|
|
|
84
84
|
* const attendee = event.createAttendee({ email: 'mail@example.com' });
|
|
85
85
|
* ```
|
|
86
86
|
*
|
|
87
|
-
* You can also use the
|
|
87
|
+
* You can also use the {@link ICalAttendee} object directly:
|
|
88
88
|
*
|
|
89
89
|
* ```javascript
|
|
90
90
|
* import ical, {ICalAttendee} from 'ical-generator';
|
|
@@ -97,11 +97,11 @@ export default class ICalAttendee {
|
|
|
97
97
|
private readonly event: ICalEvent;
|
|
98
98
|
|
|
99
99
|
/**
|
|
100
|
-
* Constructor of
|
|
100
|
+
* Constructor of {@link ICalAttendee}. The event reference is
|
|
101
101
|
* required to query the calendar's timezone when required.
|
|
102
102
|
*
|
|
103
103
|
* @param data Attendee Data
|
|
104
|
-
* @param
|
|
104
|
+
* @param event Reference to ICalEvent object
|
|
105
105
|
*/
|
|
106
106
|
constructor(data: ICalAttendeeData, event: ICalEvent) {
|
|
107
107
|
this.data = {
|
|
@@ -232,7 +232,7 @@ export default class ICalAttendee {
|
|
|
232
232
|
|
|
233
233
|
/**
|
|
234
234
|
* Set the attendee's role, defaults to `REQ` / `REQ-PARTICIPANT`.
|
|
235
|
-
* Checkout
|
|
235
|
+
* Checkout {@link ICalAttendeeRole} for available roles.
|
|
236
236
|
*
|
|
237
237
|
* @since 0.2.0
|
|
238
238
|
*/
|
|
@@ -279,7 +279,7 @@ export default class ICalAttendee {
|
|
|
279
279
|
status(): ICalAttendeeStatus | null;
|
|
280
280
|
|
|
281
281
|
/**
|
|
282
|
-
* Set the attendee's status. See
|
|
282
|
+
* Set the attendee's status. See {@link ICalAttendeeStatus}
|
|
283
283
|
* for available status options.
|
|
284
284
|
*
|
|
285
285
|
* @since 0.2.0
|
|
@@ -307,7 +307,7 @@ export default class ICalAttendee {
|
|
|
307
307
|
|
|
308
308
|
/**
|
|
309
309
|
* Set attendee's type (a.k.a. CUTYPE).
|
|
310
|
-
* See
|
|
310
|
+
* See {@link ICalAttendeeType} for available status options.
|
|
311
311
|
*
|
|
312
312
|
* @since 0.2.3
|
|
313
313
|
*/
|
|
@@ -336,7 +336,7 @@ export default class ICalAttendee {
|
|
|
336
336
|
* Set the attendee's delegated-to field.
|
|
337
337
|
*
|
|
338
338
|
* Creates a new Attendee if the passed object is not already a
|
|
339
|
-
*
|
|
339
|
+
* {@link ICalAttendee} object. Will set the `delegatedTo` and
|
|
340
340
|
* `delegatedFrom` attributes.
|
|
341
341
|
*
|
|
342
342
|
* Will also set the `status` to `DELEGATED`, if attribute is set.
|
|
@@ -392,7 +392,7 @@ export default class ICalAttendee {
|
|
|
392
392
|
* Set the attendee's delegated-from field
|
|
393
393
|
*
|
|
394
394
|
* Creates a new Attendee if the passed object is not already a
|
|
395
|
-
*
|
|
395
|
+
* {@link ICalAttendee} object. Will set the `delegatedTo` and
|
|
396
396
|
* `delegatedFrom` attributes.
|
|
397
397
|
*
|
|
398
398
|
* @param delegatedFrom
|
|
@@ -426,7 +426,7 @@ export default class ICalAttendee {
|
|
|
426
426
|
/**
|
|
427
427
|
* Create a new attendee this attendee delegates to and returns
|
|
428
428
|
* this new attendee. Creates a new attendee if the passed object
|
|
429
|
-
* is not already an
|
|
429
|
+
* is not already an {@link ICalAttendee}.
|
|
430
430
|
*
|
|
431
431
|
* ```javascript
|
|
432
432
|
* const cal = ical();
|
|
@@ -449,7 +449,7 @@ export default class ICalAttendee {
|
|
|
449
449
|
/**
|
|
450
450
|
* Create a new attendee this attendee delegates from and returns
|
|
451
451
|
* this new attendee. Creates a new attendee if the passed object
|
|
452
|
-
* is not already an
|
|
452
|
+
* is not already an {@link ICalAttendee}.
|
|
453
453
|
*
|
|
454
454
|
* ```javascript
|
|
455
455
|
* const cal = ical();
|
package/src/calendar.ts
CHANGED
|
@@ -73,7 +73,7 @@ export enum ICalCalendarMethod {
|
|
|
73
73
|
|
|
74
74
|
|
|
75
75
|
/**
|
|
76
|
-
* Usually you get an
|
|
76
|
+
* Usually you get an {@link ICalCalendar} object like this:
|
|
77
77
|
* ```javascript
|
|
78
78
|
* import ical from 'ical-generator';
|
|
79
79
|
* const calendar = ical();
|
|
@@ -160,7 +160,7 @@ export default class ICalCalendar {
|
|
|
160
160
|
/**
|
|
161
161
|
* Set your feed's prodid. `prodid` can be either a
|
|
162
162
|
* string like `//sebbo.net//ical-generator//EN` or a
|
|
163
|
-
* valid
|
|
163
|
+
* valid {@link ICalCalendarProdIdData} object. `language`
|
|
164
164
|
* is optional and defaults to `EN`.
|
|
165
165
|
*
|
|
166
166
|
* ```javascript
|
|
@@ -208,7 +208,7 @@ export default class ICalCalendar {
|
|
|
208
208
|
|
|
209
209
|
/**
|
|
210
210
|
* Get the feed method attribute.
|
|
211
|
-
* See
|
|
211
|
+
* See {@link ICalCalendarMethod} for possible results.
|
|
212
212
|
*
|
|
213
213
|
* @since 0.2.8
|
|
214
214
|
*/
|
|
@@ -216,7 +216,7 @@ export default class ICalCalendar {
|
|
|
216
216
|
|
|
217
217
|
/**
|
|
218
218
|
* Set the feed method attribute.
|
|
219
|
-
* See
|
|
219
|
+
* See {@link ICalCalendarMethod} for available options.
|
|
220
220
|
*
|
|
221
221
|
* #### Typescript Example
|
|
222
222
|
* ```typescript
|
|
@@ -315,7 +315,7 @@ export default class ICalCalendar {
|
|
|
315
315
|
* Use this method to set your feed's timezone. Is used
|
|
316
316
|
* to fill `TIMEZONE-ID` and `X-WR-TIMEZONE` in your iCal export.
|
|
317
317
|
* Please not that all date values are treaded differently, if
|
|
318
|
-
* a timezone was set. See
|
|
318
|
+
* a timezone was set. See {@link formatDate} for details. If no
|
|
319
319
|
* time zone is specified, all information is output as UTC.
|
|
320
320
|
*
|
|
321
321
|
* ```javascript
|
|
@@ -520,7 +520,7 @@ export default class ICalCalendar {
|
|
|
520
520
|
|
|
521
521
|
|
|
522
522
|
/**
|
|
523
|
-
* Creates a new
|
|
523
|
+
* Creates a new {@link ICalEvent} and returns it. Use options to prefill the event's attributes.
|
|
524
524
|
* Calling this method without options will create an empty event.
|
|
525
525
|
*
|
|
526
526
|
* ```javascript
|
package/src/category.ts
CHANGED
|
@@ -8,15 +8,16 @@ export interface ICalCategoryData {
|
|
|
8
8
|
name: string;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
export interface ICalCategoryJSONData {
|
|
12
13
|
name: string;
|
|
13
14
|
}
|
|
14
15
|
|
|
15
|
-
export type
|
|
16
|
+
export type ICalCategoryInternalData = ICalCategoryJSONData;
|
|
16
17
|
|
|
17
18
|
|
|
18
19
|
/**
|
|
19
|
-
* Usually you get an
|
|
20
|
+
* Usually you get an {@link ICalCategory} object like this:
|
|
20
21
|
*
|
|
21
22
|
* ```javascript
|
|
22
23
|
* import ical from 'ical-generator';
|
|
@@ -25,7 +26,7 @@ export type ICalCategoryJSONData = ICalCategoryInternalData;
|
|
|
25
26
|
* const category = event.createCategory();
|
|
26
27
|
* ```
|
|
27
28
|
*
|
|
28
|
-
* You can also use the
|
|
29
|
+
* You can also use the {@link ICalCategory} object directly:
|
|
29
30
|
*
|
|
30
31
|
* ```javascript
|
|
31
32
|
* import ical, {ICalCategory} from 'ical-generator';
|
|
@@ -37,7 +38,7 @@ export default class ICalCategory {
|
|
|
37
38
|
private readonly data: ICalCategoryInternalData;
|
|
38
39
|
|
|
39
40
|
/**
|
|
40
|
-
* Constructor of
|
|
41
|
+
* Constructor of {@link ICalCategory}.
|
|
41
42
|
* @param data Category Data
|
|
42
43
|
*/
|
|
43
44
|
constructor(data: ICalCategoryData) {
|
package/src/event.ts
CHANGED
|
@@ -94,7 +94,7 @@ interface ICalEventInternalData {
|
|
|
94
94
|
stamp: ICalDateTimeValue,
|
|
95
95
|
allDay: boolean,
|
|
96
96
|
floating: boolean,
|
|
97
|
-
repeating:
|
|
97
|
+
repeating: ICalEventJSONRepeatingData | ICalRRuleStub | string | null,
|
|
98
98
|
summary: string,
|
|
99
99
|
location: ICalLocation | null,
|
|
100
100
|
description: ICalDescription | null,
|
|
@@ -124,7 +124,7 @@ export interface ICalEventJSONData {
|
|
|
124
124
|
stamp: string,
|
|
125
125
|
allDay: boolean,
|
|
126
126
|
floating: boolean,
|
|
127
|
-
repeating:
|
|
127
|
+
repeating: ICalEventJSONRepeatingData | string | null,
|
|
128
128
|
summary: string,
|
|
129
129
|
location: ICalLocation | null,
|
|
130
130
|
description: ICalDescription | null,
|
|
@@ -143,7 +143,7 @@ export interface ICalEventJSONData {
|
|
|
143
143
|
x: {key: string, value: string}[];
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
interface
|
|
146
|
+
export interface ICalEventJSONRepeatingData {
|
|
147
147
|
freq: ICalEventRepeatingFreq;
|
|
148
148
|
count?: number;
|
|
149
149
|
interval?: number;
|
|
@@ -158,7 +158,7 @@ interface ICalEventInternalRepeatingData {
|
|
|
158
158
|
|
|
159
159
|
|
|
160
160
|
/**
|
|
161
|
-
* Usually you get an
|
|
161
|
+
* Usually you get an {@link ICalEvent} object like this:
|
|
162
162
|
* ```javascript
|
|
163
163
|
* import ical from 'ical-generator';
|
|
164
164
|
* const calendar = ical();
|
|
@@ -643,10 +643,10 @@ export default class ICalEvent {
|
|
|
643
643
|
* Get the event's repeating options
|
|
644
644
|
* @since 0.2.0
|
|
645
645
|
*/
|
|
646
|
-
repeating():
|
|
646
|
+
repeating(): ICalEventJSONRepeatingData | ICalRRuleStub | string | null;
|
|
647
647
|
|
|
648
648
|
/**
|
|
649
|
-
* Set the event's repeating options by passing an
|
|
649
|
+
* Set the event's repeating options by passing an {@link ICalRepeatingOptions} object.
|
|
650
650
|
*
|
|
651
651
|
* ```javascript
|
|
652
652
|
* event.repeating({
|
|
@@ -756,7 +756,7 @@ export default class ICalEvent {
|
|
|
756
756
|
* @internal
|
|
757
757
|
*/
|
|
758
758
|
repeating(repeating: ICalRepeatingOptions | ICalRRuleStub | string | null): this;
|
|
759
|
-
repeating(repeating?: ICalRepeatingOptions | ICalRRuleStub | string | null): this |
|
|
759
|
+
repeating(repeating?: ICalRepeatingOptions | ICalRRuleStub | string | null): this | ICalEventJSONRepeatingData | ICalRRuleStub | string | null {
|
|
760
760
|
if (repeating === undefined) {
|
|
761
761
|
return this.data.repeating;
|
|
762
762
|
}
|
|
@@ -880,7 +880,7 @@ export default class ICalEvent {
|
|
|
880
880
|
|
|
881
881
|
/**
|
|
882
882
|
* Set the event's location by passing a string (minimum) or
|
|
883
|
-
* an
|
|
883
|
+
* an {@link ICalLocation} object which will also fill the iCal
|
|
884
884
|
* `GEO` attribute and Apple's `X-APPLE-STRUCTURED-LOCATION`.
|
|
885
885
|
*
|
|
886
886
|
* ```javascript
|
|
@@ -933,7 +933,7 @@ export default class ICalEvent {
|
|
|
933
933
|
|
|
934
934
|
|
|
935
935
|
/**
|
|
936
|
-
* Get the event's description as an
|
|
936
|
+
* Get the event's description as an {@link ICalDescription} object.
|
|
937
937
|
* @since 0.2.0
|
|
938
938
|
*/
|
|
939
939
|
description(): ICalDescription | null;
|
|
@@ -1027,7 +1027,7 @@ export default class ICalEvent {
|
|
|
1027
1027
|
|
|
1028
1028
|
|
|
1029
1029
|
/**
|
|
1030
|
-
* Creates a new
|
|
1030
|
+
* Creates a new {@link ICalAttendee} and returns it. Use options to prefill
|
|
1031
1031
|
* the attendee's attributes. Calling this method without options will create
|
|
1032
1032
|
* an empty attendee.
|
|
1033
1033
|
*
|
|
@@ -1121,7 +1121,7 @@ export default class ICalEvent {
|
|
|
1121
1121
|
|
|
1122
1122
|
|
|
1123
1123
|
/**
|
|
1124
|
-
* Creates a new
|
|
1124
|
+
* Creates a new {@link ICalAlarm} and returns it. Use options to prefill
|
|
1125
1125
|
* the alarm's attributes. Calling this method without options will create
|
|
1126
1126
|
* an empty alarm.
|
|
1127
1127
|
*
|
|
@@ -1180,7 +1180,7 @@ export default class ICalEvent {
|
|
|
1180
1180
|
|
|
1181
1181
|
|
|
1182
1182
|
/**
|
|
1183
|
-
* Creates a new
|
|
1183
|
+
* Creates a new {@link ICalCategory} and returns it. Use options to prefill the category's attributes.
|
|
1184
1184
|
* Calling this method without options will create an empty category.
|
|
1185
1185
|
*
|
|
1186
1186
|
* ```javascript
|
|
@@ -1601,7 +1601,7 @@ export default class ICalEvent {
|
|
|
1601
1601
|
* @since 0.2.4
|
|
1602
1602
|
*/
|
|
1603
1603
|
toJSON(): ICalEventJSONData {
|
|
1604
|
-
let repeating:
|
|
1604
|
+
let repeating: ICalEventJSONRepeatingData | string | null = null;
|
|
1605
1605
|
if(isRRule(this.data.repeating) || typeof this.data.repeating === 'string') {
|
|
1606
1606
|
repeating = this.data.repeating.toString();
|
|
1607
1607
|
}
|
package/src/index.ts
CHANGED
|
@@ -49,11 +49,16 @@ export default ical;
|
|
|
49
49
|
export {
|
|
50
50
|
default as ICalAlarm,
|
|
51
51
|
ICalAlarmData,
|
|
52
|
+
ICalAlarmBaseData,
|
|
53
|
+
ICalAlarmJSONData,
|
|
54
|
+
ICalAlarmRelatesTo,
|
|
52
55
|
ICalAlarmRepeatData,
|
|
56
|
+
ICalAlarmTriggerData,
|
|
57
|
+
ICalAlarmTriggerAfterData,
|
|
58
|
+
ICalAlarmTriggerBeforeData,
|
|
53
59
|
ICalAlarmType,
|
|
54
60
|
ICalAlarmTypeValue,
|
|
55
|
-
|
|
56
|
-
ICalAttachment
|
|
61
|
+
ICalAttachment,
|
|
57
62
|
} from './alarm.js';
|
|
58
63
|
|
|
59
64
|
export {
|
|
@@ -86,6 +91,7 @@ export {
|
|
|
86
91
|
ICalEventTransparency,
|
|
87
92
|
ICalEventData,
|
|
88
93
|
ICalEventJSONData,
|
|
94
|
+
ICalEventJSONRepeatingData,
|
|
89
95
|
ICalEventClass,
|
|
90
96
|
} from './event.js';
|
|
91
97
|
|