ContactType: Add a way to clone.

master
Tom Hacohen 7 years ago
parent 6d76559d08
commit daf27ca517

4
src/ical.js.d.ts vendored

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

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

Loading…
Cancel
Save