ContactType: Add a way to clone.

master
Tom Hacohen 2017-12-13 11:13:11 +00:00
parent 6d76559d08
commit daf27ca517
2 changed files with 8 additions and 0 deletions

4
src/ical.js.d.ts vendored
View File

@ -3,8 +3,12 @@ declare module 'ical.js' {
class Component {
name: string;
static fromString(str: string): Component;
constructor(jCal: Array<any> | string, parent?: Component);
toJSON(): Array<any>;
getFirstSubcomponent(name?: string): Component | null;
getFirstPropertyValue(name?: string): any;

View File

@ -39,6 +39,10 @@ export class ContactType {
return this.comp.toString();
}
clone() {
return new ContactType(new ICAL.Component(this.comp.toJSON()));
}
get uid() {
return this.comp.getFirstPropertyValue('uid');
}