ical-generator 6.0.2-develop.5 → 6.0.2-develop.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -982,6 +982,35 @@ declare class ICalEvent {
982
982
  * [Readme](https://github.com/sebbo2002/ical-generator#-date-time--timezones)
983
983
  * for details about supported values and timezone handling.
984
984
  *
985
+ * ```typescript
986
+ * import ical from 'ical-generator';
987
+ *
988
+ * const cal = ical();
989
+ *
990
+ * const event = cal.createEvent({
991
+ * start: new Date('2020-01-01')
992
+ * });
993
+ *
994
+ * // overwrites old start date
995
+ * event.start(new Date('2024-02-01'));
996
+ *
997
+ * cal.toString();
998
+ * ```
999
+ *
1000
+ * ```text
1001
+ * BEGIN:VCALENDAR
1002
+ * VERSION:2.0
1003
+ * PRODID:-//sebbo.net//ical-generator//EN
1004
+ * BEGIN:VEVENT
1005
+ * UID:7e2aee64-b07a-4256-9b3e-e9eaa452bac8
1006
+ * SEQUENCE:0
1007
+ * DTSTAMP:20240212T190915Z
1008
+ * DTSTART:20240201T000000Z
1009
+ * SUMMARY:
1010
+ * END:VEVENT
1011
+ * END:VCALENDAR
1012
+ * ```
1013
+ *
985
1014
  * @since 0.2.0
986
1015
  */
987
1016
  start(start: ICalDateTimeValue): this;
@@ -1083,6 +1112,36 @@ declare class ICalEvent {
1083
1112
  * event.allDay(true); // → appointment is for the whole day
1084
1113
  * ```
1085
1114
  *
1115
+ * ```typescript
1116
+ * import ical from 'ical-generator';
1117
+ *
1118
+ * const cal = ical();
1119
+ *
1120
+ * cal.createEvent({
1121
+ * start: new Date('2020-01-01'),
1122
+ * summary: 'Very Important Day',
1123
+ * allDay: true
1124
+ * });
1125
+ *
1126
+ * cal.toString();
1127
+ * ```
1128
+ *
1129
+ * ```text
1130
+ * BEGIN:VCALENDAR
1131
+ * VERSION:2.0
1132
+ * PRODID:-//sebbo.net//ical-generator//EN
1133
+ * BEGIN:VEVENT
1134
+ * UID:1964fe8d-32c5-4f2a-bd62-7d9d7de5992b
1135
+ * SEQUENCE:0
1136
+ * DTSTAMP:20240212T191956Z
1137
+ * DTSTART;VALUE=DATE:20200101
1138
+ * X-MICROSOFT-CDO-ALLDAYEVENT:TRUE
1139
+ * X-MICROSOFT-MSNCALENDAR-ALLDAYEVENT:TRUE
1140
+ * SUMMARY:Very Important Day
1141
+ * END:VEVENT
1142
+ * END:VCALENDAR
1143
+ * ```
1144
+ *
1086
1145
  * @since 0.2.0
1087
1146
  */
1088
1147
  allDay(allDay: boolean): this;
@@ -1116,12 +1175,84 @@ declare class ICalEvent {
1116
1175
  * });
1117
1176
  * ```
1118
1177
  *
1178
+ * **Example:**
1179
+ *
1180
+ *```typescript
1181
+ * import ical, { ICalEventRepeatingFreq } from 'ical-generator';
1182
+ *
1183
+ * const cal = ical();
1184
+ *
1185
+ * const event = cal.createEvent({
1186
+ * start: new Date('2020-01-01T20:00:00Z'),
1187
+ * summary: 'Repeating Event'
1188
+ * });
1189
+ * event.repeating({
1190
+ * freq: ICalEventRepeatingFreq.WEEKLY,
1191
+ * count: 4
1192
+ * });
1193
+ *
1194
+ * cal.toString();
1195
+ * ```
1196
+ *
1197
+ * ```text
1198
+ * BEGIN:VCALENDAR
1199
+ * VERSION:2.0
1200
+ * PRODID:-//sebbo.net//ical-generator//EN
1201
+ * BEGIN:VEVENT
1202
+ * UID:b80e6a68-c2cd-48f5-b94d-cecc7ce83871
1203
+ * SEQUENCE:0
1204
+ * DTSTAMP:20240212T193646Z
1205
+ * DTSTART:20200101T200000Z
1206
+ * RRULE:FREQ=WEEKLY;COUNT=4
1207
+ * SUMMARY:Repeating Event
1208
+ * END:VEVENT
1209
+ * END:VCALENDAR
1210
+ * ```
1211
+ *
1119
1212
  * @since 0.2.0
1120
1213
  */
1121
1214
  repeating(repeating: ICalRepeatingOptions | null): this;
1122
1215
  /**
1123
1216
  * Set the event's repeating options by passing an [RRule object](https://github.com/jakubroztocil/rrule).
1124
1217
  * @since 2.0.0-develop.5
1218
+ *
1219
+ * ```typescript
1220
+ * import ical from 'ical-generator';
1221
+ * import { datetime, RRule } from 'rrule';
1222
+ *
1223
+ * const cal = ical();
1224
+ *
1225
+ * const event = cal.createEvent({
1226
+ * start: new Date('2020-01-01T20:00:00Z'),
1227
+ * summary: 'Repeating Event'
1228
+ * });
1229
+ *
1230
+ * const rule = new RRule({
1231
+ * freq: RRule.WEEKLY,
1232
+ * interval: 5,
1233
+ * byweekday: [RRule.MO, RRule.FR],
1234
+ * dtstart: datetime(2012, 2, 1, 10, 30),
1235
+ * until: datetime(2012, 12, 31)
1236
+ * })
1237
+ * event.repeating(rule);
1238
+ *
1239
+ * cal.toString();
1240
+ * ```
1241
+ *
1242
+ * ```text
1243
+ * BEGIN:VCALENDAR
1244
+ * VERSION:2.0
1245
+ * PRODID:-//sebbo.net//ical-generator//EN
1246
+ * BEGIN:VEVENT
1247
+ * UID:36585e40-8fa8-460d-af0c-88b6f434030b
1248
+ * SEQUENCE:0
1249
+ * DTSTAMP:20240212T193827Z
1250
+ * DTSTART:20200101T200000Z
1251
+ * RRULE:FREQ=WEEKLY;INTERVAL=5;BYDAY=MO,FR;UNTIL=20121231T000000Z
1252
+ * SUMMARY:Repeating Event
1253
+ * END:VEVENT
1254
+ * END:VCALENDAR
1255
+ * ```
1125
1256
  */
1126
1257
  repeating(repeating: ICalRRuleStub | null): this;
1127
1258
  /**
@@ -1167,6 +1298,15 @@ declare class ICalEvent {
1167
1298
  * });
1168
1299
  * ```
1169
1300
  *
1301
+ * ```text
1302
+ * LOCATION:Apple Store Kurfürstendamm\nKurfürstendamm 26\, 10719 Berlin\,
1303
+ * Deutschland
1304
+ * X-APPLE-STRUCTURED-LOCATION;VALUE=URI;X-ADDRESS=Kurfürstendamm 26\, 10719
1305
+ * Berlin\, Deutschland;X-APPLE-RADIUS=141.1751386318387;X-TITLE=Apple Store
1306
+ * Kurfürstendamm:geo:52.50363,13.32865
1307
+ * GEO:52.50363;13.32865
1308
+ * ```
1309
+ *
1170
1310
  * @since 0.2.0
1171
1311
  */
1172
1312
  location(location: ICalLocation | string | null): this;
@@ -1183,11 +1323,16 @@ declare class ICalEvent {
1183
1323
  *
1184
1324
  * ```javascript
1185
1325
  * event.description({
1186
- * plain: 'Hello World!';
1187
- * html: '<p>Hello World!</p>';
1326
+ * plain: 'Hello World!',
1327
+ * html: '<p>Hello World!</p>'
1188
1328
  * });
1189
1329
  * ```
1190
1330
  *
1331
+ * ```text
1332
+ * DESCRIPTION:Hello World!
1333
+ * X-ALT-DESC;FMTTYPE=text/html:<p>Hello World!</p>
1334
+ * ```
1335
+ *
1191
1336
  * @since 0.2.0
1192
1337
  */
1193
1338
  description(description: ICalDescription | string | null): this;
@@ -1230,14 +1375,35 @@ declare class ICalEvent {
1230
1375
  * an empty attendee.
1231
1376
  *
1232
1377
  * ```javascript
1378
+ * import ical from 'ical-generator';
1379
+ *
1233
1380
  * const cal = ical();
1234
- * const event = cal.createEvent();
1235
- * const attendee = event.createAttendee({email: 'hui@example.com', name: 'Hui'});
1381
+ * const event = cal.createEvent({
1382
+ * start: new Date()
1383
+ * });
1384
+ *
1385
+ * event.createAttendee({email: 'hui@example.com', name: 'Hui'});
1236
1386
  *
1237
1387
  * // add another attendee
1238
1388
  * event.createAttendee('Buh <buh@example.net>');
1239
1389
  * ```
1240
1390
  *
1391
+ * ```text
1392
+ * BEGIN:VCALENDAR
1393
+ * VERSION:2.0
1394
+ * PRODID:-//sebbo.net//ical-generator//EN
1395
+ * BEGIN:VEVENT
1396
+ * UID:b4944f07-98e4-4581-ac80-2589bb20273d
1397
+ * SEQUENCE:0
1398
+ * DTSTAMP:20240212T194232Z
1399
+ * DTSTART:20240212T194232Z
1400
+ * SUMMARY:
1401
+ * ATTENDEE;ROLE=REQ-PARTICIPANT;CN="Hui":MAILTO:hui@example.com
1402
+ * ATTENDEE;ROLE=REQ-PARTICIPANT;CN="Buh":MAILTO:buh@example.net
1403
+ * END:VEVENT
1404
+ * END:VCALENDAR
1405
+ * ```
1406
+ *
1241
1407
  * As with the organizer, you can also add an explicit `mailto` address.
1242
1408
  *
1243
1409
  * ```javascript
@@ -1648,7 +1814,7 @@ declare enum ICalCalendarMethod {
1648
1814
  declare class ICalCalendar {
1649
1815
  private readonly data;
1650
1816
  /**
1651
- * You can pass options to setup your calendar or use setters to do this.
1817
+ * You can pass options to set up your calendar or use setters to do this.
1652
1818
  *
1653
1819
  * ```javascript
1654
1820
  * * import ical from 'ical-generator';
@@ -1669,6 +1835,16 @@ declare class ICalCalendar {
1669
1835
  * cal.name('sebbo.net');
1670
1836
  * ```
1671
1837
  *
1838
+ * `cal.toString()` would then produce the following string:
1839
+ * ```text
1840
+ * BEGIN:VCALENDAR
1841
+ * VERSION:2.0
1842
+ * PRODID:-//sebbo.net//ical-generator//EN
1843
+ * NAME:sebbo.net
1844
+ * X-WR-CALNAME:sebbo.net
1845
+ * END:VCALENDAR
1846
+ * ```
1847
+ *
1672
1848
  * @param data Calendar data
1673
1849
  */
1674
1850
  constructor(data?: ICalCalendarData);
@@ -1691,6 +1867,11 @@ declare class ICalCalendar {
1691
1867
  * });
1692
1868
  * ```
1693
1869
  *
1870
+ * `cal.toString()` would then produce the following string:
1871
+ * ```text
1872
+ * PRODID:-//My Company//My Product//EN
1873
+ * ```
1874
+ *
1694
1875
  * @since 0.2.0
1695
1876
  */
1696
1877
  prodId(prodId: ICalCalendarProdIdData | string): this;
@@ -1708,6 +1889,8 @@ declare class ICalCalendar {
1708
1889
  * #### Typescript Example
1709
1890
  * ```typescript
1710
1891
  * import {ICalCalendarMethod} from 'ical-generator';
1892
+ *
1893
+ * // METHOD:PUBLISH
1711
1894
  * calendar.method(ICalCalendarMethod.PUBLISH);
1712
1895
  * ```
1713
1896
  *
@@ -1723,6 +1906,24 @@ declare class ICalCalendar {
1723
1906
  * Set your feed's name. Is used to fill `NAME`
1724
1907
  * and `X-WR-CALNAME` in your iCal file.
1725
1908
  *
1909
+ * ```typescript
1910
+ * import ical from 'ical-generator';
1911
+ *
1912
+ * const cal = ical();
1913
+ * cal.name('Next Arrivals');
1914
+ *
1915
+ * cal.toString();
1916
+ * ```
1917
+ *
1918
+ * ```text
1919
+ * BEGIN:VCALENDAR
1920
+ * VERSION:2.0
1921
+ * PRODID:-//sebbo.net//ical-generator//EN
1922
+ * NAME:Next Arrivals
1923
+ * X-WR-CALNAME:Next Arrivals
1924
+ * END:VCALENDAR
1925
+ * ```
1926
+ *
1726
1927
  * @since 0.2.0
1727
1928
  */
1728
1929
  name(name: string | null): this;
@@ -1776,7 +1977,7 @@ declare class ICalCalendar {
1776
1977
  * import ical from 'ical-generator';
1777
1978
  * import {getVtimezoneComponent} from '@touch4it/ical-timezones';
1778
1979
  *
1779
- * const cal = new ICalCalendar();
1980
+ * const cal = ical();
1780
1981
  * cal.timezone({
1781
1982
  * name: 'FOO',
1782
1983
  * generator: getVtimezoneComponent
@@ -1804,6 +2005,10 @@ declare class ICalCalendar {
1804
2005
  * cal.source('http://example.com/my/original_source.ical');
1805
2006
  * ```
1806
2007
  *
2008
+ * ```text
2009
+ * SOURCE;VALUE=URI:http://example.com/my/original_source.ical
2010
+ * ```
2011
+ *
1807
2012
  * @since 2.2.0-develop.1
1808
2013
  */
1809
2014
  source(source: string | null): this;
@@ -1956,6 +2161,14 @@ declare class ICalCalendar {
1956
2161
  * });
1957
2162
  * ```
1958
2163
  *
2164
+ * ```text
2165
+ * BEGIN:VCALENDAR
2166
+ * VERSION:2.0
2167
+ * PRODID:-//sebbo.net//ical-generator//EN
2168
+ * X-MY-CUSTOM-ATTR:1337!
2169
+ * END:VCALENDAR
2170
+ * ```
2171
+ *
1959
2172
  * @since 1.9.0
1960
2173
  */
1961
2174
  x(keyOrArray: {
@@ -1971,6 +2184,14 @@ declare class ICalCalendar {
1971
2184
  * calendar.x("X-MY-CUSTOM-ATTR", "1337!");
1972
2185
  * ```
1973
2186
  *
2187
+ * ```text
2188
+ * BEGIN:VCALENDAR
2189
+ * VERSION:2.0
2190
+ * PRODID:-//sebbo.net//ical-generator//EN
2191
+ * X-MY-CUSTOM-ATTR:1337!
2192
+ * END:VCALENDAR
2193
+ * ```
2194
+ *
1974
2195
  * @since 1.9.0
1975
2196
  */
1976
2197
  x(keyOrArray: string, value: string): this;
package/dist/index.d.ts CHANGED
@@ -982,6 +982,35 @@ declare class ICalEvent {
982
982
  * [Readme](https://github.com/sebbo2002/ical-generator#-date-time--timezones)
983
983
  * for details about supported values and timezone handling.
984
984
  *
985
+ * ```typescript
986
+ * import ical from 'ical-generator';
987
+ *
988
+ * const cal = ical();
989
+ *
990
+ * const event = cal.createEvent({
991
+ * start: new Date('2020-01-01')
992
+ * });
993
+ *
994
+ * // overwrites old start date
995
+ * event.start(new Date('2024-02-01'));
996
+ *
997
+ * cal.toString();
998
+ * ```
999
+ *
1000
+ * ```text
1001
+ * BEGIN:VCALENDAR
1002
+ * VERSION:2.0
1003
+ * PRODID:-//sebbo.net//ical-generator//EN
1004
+ * BEGIN:VEVENT
1005
+ * UID:7e2aee64-b07a-4256-9b3e-e9eaa452bac8
1006
+ * SEQUENCE:0
1007
+ * DTSTAMP:20240212T190915Z
1008
+ * DTSTART:20240201T000000Z
1009
+ * SUMMARY:
1010
+ * END:VEVENT
1011
+ * END:VCALENDAR
1012
+ * ```
1013
+ *
985
1014
  * @since 0.2.0
986
1015
  */
987
1016
  start(start: ICalDateTimeValue): this;
@@ -1083,6 +1112,36 @@ declare class ICalEvent {
1083
1112
  * event.allDay(true); // → appointment is for the whole day
1084
1113
  * ```
1085
1114
  *
1115
+ * ```typescript
1116
+ * import ical from 'ical-generator';
1117
+ *
1118
+ * const cal = ical();
1119
+ *
1120
+ * cal.createEvent({
1121
+ * start: new Date('2020-01-01'),
1122
+ * summary: 'Very Important Day',
1123
+ * allDay: true
1124
+ * });
1125
+ *
1126
+ * cal.toString();
1127
+ * ```
1128
+ *
1129
+ * ```text
1130
+ * BEGIN:VCALENDAR
1131
+ * VERSION:2.0
1132
+ * PRODID:-//sebbo.net//ical-generator//EN
1133
+ * BEGIN:VEVENT
1134
+ * UID:1964fe8d-32c5-4f2a-bd62-7d9d7de5992b
1135
+ * SEQUENCE:0
1136
+ * DTSTAMP:20240212T191956Z
1137
+ * DTSTART;VALUE=DATE:20200101
1138
+ * X-MICROSOFT-CDO-ALLDAYEVENT:TRUE
1139
+ * X-MICROSOFT-MSNCALENDAR-ALLDAYEVENT:TRUE
1140
+ * SUMMARY:Very Important Day
1141
+ * END:VEVENT
1142
+ * END:VCALENDAR
1143
+ * ```
1144
+ *
1086
1145
  * @since 0.2.0
1087
1146
  */
1088
1147
  allDay(allDay: boolean): this;
@@ -1116,12 +1175,84 @@ declare class ICalEvent {
1116
1175
  * });
1117
1176
  * ```
1118
1177
  *
1178
+ * **Example:**
1179
+ *
1180
+ *```typescript
1181
+ * import ical, { ICalEventRepeatingFreq } from 'ical-generator';
1182
+ *
1183
+ * const cal = ical();
1184
+ *
1185
+ * const event = cal.createEvent({
1186
+ * start: new Date('2020-01-01T20:00:00Z'),
1187
+ * summary: 'Repeating Event'
1188
+ * });
1189
+ * event.repeating({
1190
+ * freq: ICalEventRepeatingFreq.WEEKLY,
1191
+ * count: 4
1192
+ * });
1193
+ *
1194
+ * cal.toString();
1195
+ * ```
1196
+ *
1197
+ * ```text
1198
+ * BEGIN:VCALENDAR
1199
+ * VERSION:2.0
1200
+ * PRODID:-//sebbo.net//ical-generator//EN
1201
+ * BEGIN:VEVENT
1202
+ * UID:b80e6a68-c2cd-48f5-b94d-cecc7ce83871
1203
+ * SEQUENCE:0
1204
+ * DTSTAMP:20240212T193646Z
1205
+ * DTSTART:20200101T200000Z
1206
+ * RRULE:FREQ=WEEKLY;COUNT=4
1207
+ * SUMMARY:Repeating Event
1208
+ * END:VEVENT
1209
+ * END:VCALENDAR
1210
+ * ```
1211
+ *
1119
1212
  * @since 0.2.0
1120
1213
  */
1121
1214
  repeating(repeating: ICalRepeatingOptions | null): this;
1122
1215
  /**
1123
1216
  * Set the event's repeating options by passing an [RRule object](https://github.com/jakubroztocil/rrule).
1124
1217
  * @since 2.0.0-develop.5
1218
+ *
1219
+ * ```typescript
1220
+ * import ical from 'ical-generator';
1221
+ * import { datetime, RRule } from 'rrule';
1222
+ *
1223
+ * const cal = ical();
1224
+ *
1225
+ * const event = cal.createEvent({
1226
+ * start: new Date('2020-01-01T20:00:00Z'),
1227
+ * summary: 'Repeating Event'
1228
+ * });
1229
+ *
1230
+ * const rule = new RRule({
1231
+ * freq: RRule.WEEKLY,
1232
+ * interval: 5,
1233
+ * byweekday: [RRule.MO, RRule.FR],
1234
+ * dtstart: datetime(2012, 2, 1, 10, 30),
1235
+ * until: datetime(2012, 12, 31)
1236
+ * })
1237
+ * event.repeating(rule);
1238
+ *
1239
+ * cal.toString();
1240
+ * ```
1241
+ *
1242
+ * ```text
1243
+ * BEGIN:VCALENDAR
1244
+ * VERSION:2.0
1245
+ * PRODID:-//sebbo.net//ical-generator//EN
1246
+ * BEGIN:VEVENT
1247
+ * UID:36585e40-8fa8-460d-af0c-88b6f434030b
1248
+ * SEQUENCE:0
1249
+ * DTSTAMP:20240212T193827Z
1250
+ * DTSTART:20200101T200000Z
1251
+ * RRULE:FREQ=WEEKLY;INTERVAL=5;BYDAY=MO,FR;UNTIL=20121231T000000Z
1252
+ * SUMMARY:Repeating Event
1253
+ * END:VEVENT
1254
+ * END:VCALENDAR
1255
+ * ```
1125
1256
  */
1126
1257
  repeating(repeating: ICalRRuleStub | null): this;
1127
1258
  /**
@@ -1167,6 +1298,15 @@ declare class ICalEvent {
1167
1298
  * });
1168
1299
  * ```
1169
1300
  *
1301
+ * ```text
1302
+ * LOCATION:Apple Store Kurfürstendamm\nKurfürstendamm 26\, 10719 Berlin\,
1303
+ * Deutschland
1304
+ * X-APPLE-STRUCTURED-LOCATION;VALUE=URI;X-ADDRESS=Kurfürstendamm 26\, 10719
1305
+ * Berlin\, Deutschland;X-APPLE-RADIUS=141.1751386318387;X-TITLE=Apple Store
1306
+ * Kurfürstendamm:geo:52.50363,13.32865
1307
+ * GEO:52.50363;13.32865
1308
+ * ```
1309
+ *
1170
1310
  * @since 0.2.0
1171
1311
  */
1172
1312
  location(location: ICalLocation | string | null): this;
@@ -1183,11 +1323,16 @@ declare class ICalEvent {
1183
1323
  *
1184
1324
  * ```javascript
1185
1325
  * event.description({
1186
- * plain: 'Hello World!';
1187
- * html: '<p>Hello World!</p>';
1326
+ * plain: 'Hello World!',
1327
+ * html: '<p>Hello World!</p>'
1188
1328
  * });
1189
1329
  * ```
1190
1330
  *
1331
+ * ```text
1332
+ * DESCRIPTION:Hello World!
1333
+ * X-ALT-DESC;FMTTYPE=text/html:<p>Hello World!</p>
1334
+ * ```
1335
+ *
1191
1336
  * @since 0.2.0
1192
1337
  */
1193
1338
  description(description: ICalDescription | string | null): this;
@@ -1230,14 +1375,35 @@ declare class ICalEvent {
1230
1375
  * an empty attendee.
1231
1376
  *
1232
1377
  * ```javascript
1378
+ * import ical from 'ical-generator';
1379
+ *
1233
1380
  * const cal = ical();
1234
- * const event = cal.createEvent();
1235
- * const attendee = event.createAttendee({email: 'hui@example.com', name: 'Hui'});
1381
+ * const event = cal.createEvent({
1382
+ * start: new Date()
1383
+ * });
1384
+ *
1385
+ * event.createAttendee({email: 'hui@example.com', name: 'Hui'});
1236
1386
  *
1237
1387
  * // add another attendee
1238
1388
  * event.createAttendee('Buh <buh@example.net>');
1239
1389
  * ```
1240
1390
  *
1391
+ * ```text
1392
+ * BEGIN:VCALENDAR
1393
+ * VERSION:2.0
1394
+ * PRODID:-//sebbo.net//ical-generator//EN
1395
+ * BEGIN:VEVENT
1396
+ * UID:b4944f07-98e4-4581-ac80-2589bb20273d
1397
+ * SEQUENCE:0
1398
+ * DTSTAMP:20240212T194232Z
1399
+ * DTSTART:20240212T194232Z
1400
+ * SUMMARY:
1401
+ * ATTENDEE;ROLE=REQ-PARTICIPANT;CN="Hui":MAILTO:hui@example.com
1402
+ * ATTENDEE;ROLE=REQ-PARTICIPANT;CN="Buh":MAILTO:buh@example.net
1403
+ * END:VEVENT
1404
+ * END:VCALENDAR
1405
+ * ```
1406
+ *
1241
1407
  * As with the organizer, you can also add an explicit `mailto` address.
1242
1408
  *
1243
1409
  * ```javascript
@@ -1648,7 +1814,7 @@ declare enum ICalCalendarMethod {
1648
1814
  declare class ICalCalendar {
1649
1815
  private readonly data;
1650
1816
  /**
1651
- * You can pass options to setup your calendar or use setters to do this.
1817
+ * You can pass options to set up your calendar or use setters to do this.
1652
1818
  *
1653
1819
  * ```javascript
1654
1820
  * * import ical from 'ical-generator';
@@ -1669,6 +1835,16 @@ declare class ICalCalendar {
1669
1835
  * cal.name('sebbo.net');
1670
1836
  * ```
1671
1837
  *
1838
+ * `cal.toString()` would then produce the following string:
1839
+ * ```text
1840
+ * BEGIN:VCALENDAR
1841
+ * VERSION:2.0
1842
+ * PRODID:-//sebbo.net//ical-generator//EN
1843
+ * NAME:sebbo.net
1844
+ * X-WR-CALNAME:sebbo.net
1845
+ * END:VCALENDAR
1846
+ * ```
1847
+ *
1672
1848
  * @param data Calendar data
1673
1849
  */
1674
1850
  constructor(data?: ICalCalendarData);
@@ -1691,6 +1867,11 @@ declare class ICalCalendar {
1691
1867
  * });
1692
1868
  * ```
1693
1869
  *
1870
+ * `cal.toString()` would then produce the following string:
1871
+ * ```text
1872
+ * PRODID:-//My Company//My Product//EN
1873
+ * ```
1874
+ *
1694
1875
  * @since 0.2.0
1695
1876
  */
1696
1877
  prodId(prodId: ICalCalendarProdIdData | string): this;
@@ -1708,6 +1889,8 @@ declare class ICalCalendar {
1708
1889
  * #### Typescript Example
1709
1890
  * ```typescript
1710
1891
  * import {ICalCalendarMethod} from 'ical-generator';
1892
+ *
1893
+ * // METHOD:PUBLISH
1711
1894
  * calendar.method(ICalCalendarMethod.PUBLISH);
1712
1895
  * ```
1713
1896
  *
@@ -1723,6 +1906,24 @@ declare class ICalCalendar {
1723
1906
  * Set your feed's name. Is used to fill `NAME`
1724
1907
  * and `X-WR-CALNAME` in your iCal file.
1725
1908
  *
1909
+ * ```typescript
1910
+ * import ical from 'ical-generator';
1911
+ *
1912
+ * const cal = ical();
1913
+ * cal.name('Next Arrivals');
1914
+ *
1915
+ * cal.toString();
1916
+ * ```
1917
+ *
1918
+ * ```text
1919
+ * BEGIN:VCALENDAR
1920
+ * VERSION:2.0
1921
+ * PRODID:-//sebbo.net//ical-generator//EN
1922
+ * NAME:Next Arrivals
1923
+ * X-WR-CALNAME:Next Arrivals
1924
+ * END:VCALENDAR
1925
+ * ```
1926
+ *
1726
1927
  * @since 0.2.0
1727
1928
  */
1728
1929
  name(name: string | null): this;
@@ -1776,7 +1977,7 @@ declare class ICalCalendar {
1776
1977
  * import ical from 'ical-generator';
1777
1978
  * import {getVtimezoneComponent} from '@touch4it/ical-timezones';
1778
1979
  *
1779
- * const cal = new ICalCalendar();
1980
+ * const cal = ical();
1780
1981
  * cal.timezone({
1781
1982
  * name: 'FOO',
1782
1983
  * generator: getVtimezoneComponent
@@ -1804,6 +2005,10 @@ declare class ICalCalendar {
1804
2005
  * cal.source('http://example.com/my/original_source.ical');
1805
2006
  * ```
1806
2007
  *
2008
+ * ```text
2009
+ * SOURCE;VALUE=URI:http://example.com/my/original_source.ical
2010
+ * ```
2011
+ *
1807
2012
  * @since 2.2.0-develop.1
1808
2013
  */
1809
2014
  source(source: string | null): this;
@@ -1956,6 +2161,14 @@ declare class ICalCalendar {
1956
2161
  * });
1957
2162
  * ```
1958
2163
  *
2164
+ * ```text
2165
+ * BEGIN:VCALENDAR
2166
+ * VERSION:2.0
2167
+ * PRODID:-//sebbo.net//ical-generator//EN
2168
+ * X-MY-CUSTOM-ATTR:1337!
2169
+ * END:VCALENDAR
2170
+ * ```
2171
+ *
1959
2172
  * @since 1.9.0
1960
2173
  */
1961
2174
  x(keyOrArray: {
@@ -1971,6 +2184,14 @@ declare class ICalCalendar {
1971
2184
  * calendar.x("X-MY-CUSTOM-ATTR", "1337!");
1972
2185
  * ```
1973
2186
  *
2187
+ * ```text
2188
+ * BEGIN:VCALENDAR
2189
+ * VERSION:2.0
2190
+ * PRODID:-//sebbo.net//ical-generator//EN
2191
+ * X-MY-CUSTOM-ATTR:1337!
2192
+ * END:VCALENDAR
2193
+ * ```
2194
+ *
1974
2195
  * @since 1.9.0
1975
2196
  */
1976
2197
  x(keyOrArray: string, value: string): this;