ical-generator 6.0.2-develop.7 → 6.0.2-develop.9

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/package.json CHANGED
@@ -25,18 +25,18 @@
25
25
  "esm": "^3.2.25",
26
26
  "license-checker": "^25.0.1",
27
27
  "luxon": "^3.4.4",
28
- "mocha": "^10.2.0",
28
+ "mocha": "^10.3.0",
29
29
  "mochawesome": "^7.1.3",
30
30
  "moment": "^2.30.1",
31
31
  "moment-timezone": "^0.5.45",
32
32
  "nyc": "^15.1.0",
33
33
  "rrule": "^2.8.1",
34
- "semantic-release": "^23.0.0",
34
+ "semantic-release": "^23.0.2",
35
35
  "semantic-release-license": "^1.0.2",
36
36
  "source-map-support": "^0.5.21",
37
37
  "ts-node": "^10.9.2",
38
- "tsup": "^8.0.1",
39
- "typedoc": "^0.25.7",
38
+ "tsup": "^8.0.2",
39
+ "typedoc": "^0.25.8",
40
40
  "typescript": "^5.3.3"
41
41
  },
42
42
  "engines": {
@@ -125,5 +125,5 @@
125
125
  "test": "mocha"
126
126
  },
127
127
  "type": "module",
128
- "version": "6.0.2-develop.7"
128
+ "version": "6.0.2-develop.9"
129
129
  }
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 `ICalAlarm` object like this:
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 [[`ICalAlarm`]] object directly:
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 [[`ICalAttendee`]]. The event reference is required
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 calendar Reference to ICalEvent object
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 [[`ICalAlarmType`]]
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 ([[`ICalDateTimeValue`]]) or
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 ([[`ICalDateTimeValue`]]) or
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 ([[`ICalDateTimeValue`]]) or
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 `ICalAttendee` object like this:
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 [[`ICalAttendee`]] object directly:
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 [[`ICalAttendee`]]. The event reference is
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 calendar Reference to ICalEvent object
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 [[`ICalAttendeeRole`]] for available roles.
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 [[`ICalAttendeeStatus`]]
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 [[`ICalAttendeeType`]] for available status options.
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
- * [[`ICalAttendee`]] object. Will set the `delegatedTo` and
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
- * [[`ICalAttendee`]] object. Will set the `delegatedTo` and
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 [[`ICalAttendee`]].
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 [[`ICalAttendee`]].
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 `ICalCalendar` object like this:
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 [[`ICalCalendarProdIdData`]] object. `language`
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 [[`ICalCalendarMethod`]] for possible results.
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 [[`ICalCalendarMethod`]] for available options.
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 [[`formatDate`]] for details. If no
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 [[`ICalEvent`]] and returns it. Use options to prefill the event's attributes.
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
- export interface ICalCategoryInternalData {
11
+
12
+ export interface ICalCategoryJSONData {
12
13
  name: string;
13
14
  }
14
15
 
15
- export type ICalCategoryJSONData = ICalCategoryInternalData;
16
+ export type ICalCategoryInternalData = ICalCategoryJSONData;
16
17
 
17
18
 
18
19
  /**
19
- * Usually you get an `ICalCategory` object like this:
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 [[`ICalCategory`]] object directly:
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 [[`ICalCategory`]].
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: ICalEventInternalRepeatingData | ICalRRuleStub | string | null,
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: ICalEventInternalRepeatingData | string | null,
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 ICalEventInternalRepeatingData {
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 `ICalEvent` object like this:
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(): ICalEventInternalRepeatingData | ICalRRuleStub | string | null;
646
+ repeating(): ICalEventJSONRepeatingData | ICalRRuleStub | string | null;
647
647
 
648
648
  /**
649
- * Set the event's repeating options by passing an [[`ICalRepeatingOptions`]] object.
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 | ICalEventInternalRepeatingData | ICalRRuleStub | string | null {
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 [[`ICalLocation`]] object which will also fill the iCal
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 [[`ICalDescription`]] object.
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 [[`ICalAttendee`]] and returns it. Use options to prefill
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 [[`ICalAlarm`]] and returns it. Use options to prefill
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 [[`ICalCategory`]] and returns it. Use options to prefill the category's attributes.
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: ICalEventInternalRepeatingData | string | null = null;
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
- ICalAlarmJSONData,
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