ical-generator 6.0.1-develop.1 → 6.0.1-develop.10
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/LICENSE +1 -1
- package/README.md +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +18 -18
- package/src/calendar.ts +2 -10
- package/src/event.ts +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -910,7 +910,7 @@ interface ICalEventInternalRepeatingData {
|
|
|
910
910
|
startOfWeek?: ICalWeekday;
|
|
911
911
|
}
|
|
912
912
|
/**
|
|
913
|
-
* Usually you get an `
|
|
913
|
+
* Usually you get an `ICalEvent` object like this:
|
|
914
914
|
* ```javascript
|
|
915
915
|
* import ical from 'ical-generator';
|
|
916
916
|
* const calendar = ical();
|
|
@@ -1315,7 +1315,7 @@ declare class ICalEvent {
|
|
|
1315
1315
|
*/
|
|
1316
1316
|
alarms(alarms: ICalAlarm[] | ICalAlarmData[]): this;
|
|
1317
1317
|
/**
|
|
1318
|
-
* Creates a new [[`ICalCategory`]] and returns it. Use options to prefill the
|
|
1318
|
+
* Creates a new [[`ICalCategory`]] and returns it. Use options to prefill the category's attributes.
|
|
1319
1319
|
* Calling this method without options will create an empty category.
|
|
1320
1320
|
*
|
|
1321
1321
|
* ```javascript
|
|
@@ -1323,7 +1323,7 @@ declare class ICalEvent {
|
|
|
1323
1323
|
* const event = cal.createEvent();
|
|
1324
1324
|
* const category = event.createCategory({name: 'APPOINTMENT'});
|
|
1325
1325
|
*
|
|
1326
|
-
* // add another
|
|
1326
|
+
* // add another category
|
|
1327
1327
|
* event.createCategory({
|
|
1328
1328
|
* name: 'MEETING'
|
|
1329
1329
|
* });
|
|
@@ -2074,4 +2074,4 @@ declare function foldLines(input: string): string;
|
|
|
2074
2074
|
*/
|
|
2075
2075
|
declare function ical(data?: ICalCalendarData): ICalCalendar;
|
|
2076
2076
|
|
|
2077
|
-
export { ICalAlarm, ICalAlarmData, ICalAlarmJSONData, ICalAlarmRepeatData, ICalAlarmType, ICalAlarmTypeValue, ICalAttachment, ICalAttendee, ICalAttendeeData, ICalAttendeeJSONData, ICalAttendeeRole, ICalAttendeeStatus, ICalAttendeeType, ICalCalendar, ICalCalendarData, ICalCalendarJSONData, ICalCalendarMethod, ICalCalendarProdIdData, ICalCategory, ICalCategoryData, ICalCategoryJSONData, ICalDateTimeValue, ICalDayJsStub, ICalDescription, ICalEvent, ICalEventBusyStatus, ICalEventClass, ICalEventData, ICalEventJSONData, ICalEventRepeatingFreq, ICalEventStatus, ICalEventTransparency, ICalGeo, ICalLocation, ICalLuxonDateTimeStub, ICalMomentDurationStub, ICalMomentStub, ICalMomentTimezoneStub, ICalOrganizer, ICalRRuleStub, ICalRepeatingOptions, ICalTimezone, ICalWeekday, ical as default, escape, foldLines, formatDate, formatDateTZ };
|
|
2077
|
+
export { ICalAlarm, type ICalAlarmData, type ICalAlarmJSONData, type ICalAlarmRepeatData, ICalAlarmType, type ICalAlarmTypeValue, type ICalAttachment, ICalAttendee, type ICalAttendeeData, type ICalAttendeeJSONData, ICalAttendeeRole, 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, ICalEventRepeatingFreq, ICalEventStatus, ICalEventTransparency, type ICalGeo, type ICalLocation, type ICalLuxonDateTimeStub, type ICalMomentDurationStub, type ICalMomentStub, type ICalMomentTimezoneStub, type ICalOrganizer, type ICalRRuleStub, type ICalRepeatingOptions, type ICalTimezone, ICalWeekday, ical as default, escape, foldLines, formatDate, formatDateTZ };
|
package/dist/index.d.ts
CHANGED
|
@@ -910,7 +910,7 @@ interface ICalEventInternalRepeatingData {
|
|
|
910
910
|
startOfWeek?: ICalWeekday;
|
|
911
911
|
}
|
|
912
912
|
/**
|
|
913
|
-
* Usually you get an `
|
|
913
|
+
* Usually you get an `ICalEvent` object like this:
|
|
914
914
|
* ```javascript
|
|
915
915
|
* import ical from 'ical-generator';
|
|
916
916
|
* const calendar = ical();
|
|
@@ -1315,7 +1315,7 @@ declare class ICalEvent {
|
|
|
1315
1315
|
*/
|
|
1316
1316
|
alarms(alarms: ICalAlarm[] | ICalAlarmData[]): this;
|
|
1317
1317
|
/**
|
|
1318
|
-
* Creates a new [[`ICalCategory`]] and returns it. Use options to prefill the
|
|
1318
|
+
* Creates a new [[`ICalCategory`]] and returns it. Use options to prefill the category's attributes.
|
|
1319
1319
|
* Calling this method without options will create an empty category.
|
|
1320
1320
|
*
|
|
1321
1321
|
* ```javascript
|
|
@@ -1323,7 +1323,7 @@ declare class ICalEvent {
|
|
|
1323
1323
|
* const event = cal.createEvent();
|
|
1324
1324
|
* const category = event.createCategory({name: 'APPOINTMENT'});
|
|
1325
1325
|
*
|
|
1326
|
-
* // add another
|
|
1326
|
+
* // add another category
|
|
1327
1327
|
* event.createCategory({
|
|
1328
1328
|
* name: 'MEETING'
|
|
1329
1329
|
* });
|
|
@@ -2074,4 +2074,4 @@ declare function foldLines(input: string): string;
|
|
|
2074
2074
|
*/
|
|
2075
2075
|
declare function ical(data?: ICalCalendarData): ICalCalendar;
|
|
2076
2076
|
|
|
2077
|
-
export { ICalAlarm, ICalAlarmData, ICalAlarmJSONData, ICalAlarmRepeatData, ICalAlarmType, ICalAlarmTypeValue, ICalAttachment, ICalAttendee, ICalAttendeeData, ICalAttendeeJSONData, ICalAttendeeRole, ICalAttendeeStatus, ICalAttendeeType, ICalCalendar, ICalCalendarData, ICalCalendarJSONData, ICalCalendarMethod, ICalCalendarProdIdData, ICalCategory, ICalCategoryData, ICalCategoryJSONData, ICalDateTimeValue, ICalDayJsStub, ICalDescription, ICalEvent, ICalEventBusyStatus, ICalEventClass, ICalEventData, ICalEventJSONData, ICalEventRepeatingFreq, ICalEventStatus, ICalEventTransparency, ICalGeo, ICalLocation, ICalLuxonDateTimeStub, ICalMomentDurationStub, ICalMomentStub, ICalMomentTimezoneStub, ICalOrganizer, ICalRRuleStub, ICalRepeatingOptions, ICalTimezone, ICalWeekday, ical as default, escape, foldLines, formatDate, formatDateTZ };
|
|
2077
|
+
export { ICalAlarm, type ICalAlarmData, type ICalAlarmJSONData, type ICalAlarmRepeatData, ICalAlarmType, type ICalAlarmTypeValue, type ICalAttachment, ICalAttendee, type ICalAttendeeData, type ICalAttendeeJSONData, ICalAttendeeRole, 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, ICalEventRepeatingFreq, ICalEventStatus, ICalEventTransparency, type ICalGeo, type ICalLocation, type ICalLuxonDateTimeStub, type ICalMomentDurationStub, type ICalMomentStub, type ICalMomentTimezoneStub, type ICalOrganizer, type ICalRRuleStub, type ICalRepeatingOptions, type ICalTimezone, ICalWeekday, ical as default, escape, foldLines, formatDate, formatDateTZ };
|
package/dist/index.js
CHANGED
|
@@ -57,7 +57,7 @@ var G=Object.defineProperty;var Y=Object.getOwnPropertySymbols;var H=Object.prot
|
|
|
57
57
|
`),this.data.lastModified&&(t+="LAST-MODIFIED:"+o(this.calendar.timezone(),this.data.lastModified)+`\r
|
|
58
58
|
`),this.data.class&&(t+="CLASS:"+this.data.class.toUpperCase()+`\r
|
|
59
59
|
`),t+=`END:VEVENT\r
|
|
60
|
-
`,t}};var k=(h=>(h.PUBLISH="PUBLISH",h.REQUEST="REQUEST",h.REPLY="REPLY",h.ADD="ADD",h.CANCEL="CANCEL",h.REFRESH="REFRESH",h.COUNTER="COUNTER",h.DECLINECOUNTER="DECLINECOUNTER",h))(k||{}),E=class{constructor(t={}){this.data={prodId:"//sebbo.net//ical-generator//EN",method:null,name:null,description:null,timezone:null,source:null,url:null,scale:null,ttl:null,events:[],x:[]},t.prodId!==void 0&&this.prodId(t.prodId),t.method!==void 0&&this.method(t.method),t.name!==void 0&&this.name(t.name),t.description!==void 0&&this.description(t.description),t.timezone!==void 0&&this.timezone(t.timezone),t.source!==void 0&&this.source(t.source),t.url!==void 0&&this.url(t.url),t.scale!==void 0&&this.scale(t.scale),t.ttl!==void 0&&this.ttl(t.ttl),t.events!==void 0&&this.events(t.events),t.x!==void 0&&this.x(t.x)}prodId(t){if(!t)return this.data.prodId;if(typeof t=="string"
|
|
60
|
+
`,t}};var k=(h=>(h.PUBLISH="PUBLISH",h.REQUEST="REQUEST",h.REPLY="REPLY",h.ADD="ADD",h.CANCEL="CANCEL",h.REFRESH="REFRESH",h.COUNTER="COUNTER",h.DECLINECOUNTER="DECLINECOUNTER",h))(k||{}),E=class{constructor(t={}){this.data={prodId:"//sebbo.net//ical-generator//EN",method:null,name:null,description:null,timezone:null,source:null,url:null,scale:null,ttl:null,events:[],x:[]},t.prodId!==void 0&&this.prodId(t.prodId),t.method!==void 0&&this.method(t.method),t.name!==void 0&&this.name(t.name),t.description!==void 0&&this.description(t.description),t.timezone!==void 0&&this.timezone(t.timezone),t.source!==void 0&&this.source(t.source),t.url!==void 0&&this.url(t.url),t.scale!==void 0&&this.scale(t.scale),t.ttl!==void 0&&this.ttl(t.ttl),t.events!==void 0&&this.events(t.events),t.x!==void 0&&this.x(t.x)}prodId(t){if(!t)return this.data.prodId;if(typeof t=="string")return this.data.prodId=t,this;if(typeof t!="object")throw new Error("`prodid` needs to be a string or an object!");if(!t.company)throw new Error("`prodid.company` is a mandatory item!");if(!t.product)throw new Error("`prodid.product` is a mandatory item!");let e=(t.language||"EN").toUpperCase();return this.data.prodId="//"+t.company+"//"+t.product+"//"+e,this}method(t){return t===void 0?this.data.method:t?(this.data.method=d(k,t),this):(this.data.method=null,this)}name(t){return t===void 0?this.data.name:(this.data.name=t?String(t):null,this)}description(t){return t===void 0?this.data.description:(this.data.description=t?String(t):null,this)}timezone(t){var e;return t===void 0?((e=this.data.timezone)==null?void 0:e.name)||null:(t==="UTC"?this.data.timezone=null:typeof t=="string"?this.data.timezone={name:t}:t===null?this.data.timezone=null:this.data.timezone=t,this)}source(t){return t===void 0?this.data.source:(this.data.source=t||null,this)}url(t){return t===void 0?this.data.url:(this.data.url=t||null,this)}scale(t){return t===void 0?this.data.scale:(t===null?this.data.scale=null:this.data.scale=t.toUpperCase(),this)}ttl(t){return t===void 0?this.data.ttl:(J(t)?this.data.ttl=t.asSeconds():t&&t>0?this.data.ttl=t:this.data.ttl=null,this)}createEvent(t){let e=t instanceof D?t:new D(t,this);return this.data.events.push(e),e}events(t){return t?(t.forEach(e=>this.createEvent(e)),this):this.data.events}clear(){return this.data.events=[],this}x(t,e){if(t===void 0)return u(this.data);if(typeof t=="string"&&typeof e=="string")u(this.data,t,e);else if(typeof t=="object")u(this.data,t);else throw new Error("Either key or value is not a string!");return this}toJSON(){return Object.assign({},this.data,{timezone:this.timezone(),events:this.data.events.map(t=>t.toJSON()),x:this.x()})}length(){return this.data.events.length}toString(){var e,n;let t="";return t=`BEGIN:VCALENDAR\r
|
|
61
61
|
VERSION:2.0\r
|
|
62
62
|
`,t+="PRODID:-"+this.data.prodId+`\r
|
|
63
63
|
`,this.data.url&&(t+="URL:"+this.data.url+`\r
|