user 6 yıl önce
ebeveyn
işleme
26b5fee818

+ 4 - 2
lib/contact-item.d.ts

@@ -3,11 +3,13 @@ export declare class ContactItem {
     readonly data: ContactParams;
     readonly id: string;
     readonly hash: string;
-    readonly addrs: string[];
-    readonly groups: string[];
+    addrs: string[];
+    groups: string[];
+    notes: string;
     constructor(props: ContactParams);
     matchesAddressOrName(search: string): boolean;
     matchesGroup(group: string): boolean;
     getFirstEmail(): string | undefined;
     getMatchingAddresses(search: string): string[];
+    getData(): ContactParams;
 }

+ 10 - 0
lib/contact-item.js

@@ -7,6 +7,7 @@ class ContactItem {
         this.id = props.id;
         this.addrs = props.addrs || [];
         this.groups = props.groups || [];
+        this.notes = props.notes || '';
     }
     matchesAddressOrName(search) {
         if (this.addrs.filter(x => x.indexOf(search.trim()) >= 0).length > 0) {
@@ -30,6 +31,15 @@ class ContactItem {
     getMatchingAddresses(search) {
         return this.addrs.filter(x => x.indexOf(search) >= 0);
     }
+    getData() {
+        return {
+            addrs: this.addrs,
+            groups: this.groups,
+            hash: this.hash,
+            id: this.id,
+            notes: this.notes
+        };
+    }
 }
 exports.ContactItem = ContactItem;
 //# sourceMappingURL=contact-item.js.map

Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
lib/contact-item.js.map


+ 1 - 0
lib/contact-params.d.ts

@@ -3,4 +3,5 @@ export interface ContactParams {
     hash: string;
     addrs: string[];
     groups: string[];
+    notes: string;
 }

+ 15 - 3
src/contact-item.ts

@@ -5,8 +5,9 @@ export class ContactItem {
   public readonly data: ContactParams;
   public readonly id: string;
   public readonly hash: string;
-  public readonly addrs: string[];
-  public readonly groups: string[];
+  public addrs: string[];
+  public groups: string[];
+  public notes: string;
   
   constructor(props: ContactParams) {
     this.data = props;
@@ -14,6 +15,7 @@ export class ContactItem {
     this.id = props.id;
     this.addrs = props.addrs || [];
     this.groups = props.groups || [];
+    this.notes = props.notes || '';
   }
 
   public matchesAddressOrName(search: string): boolean {
@@ -40,5 +42,15 @@ export class ContactItem {
 
   public getMatchingAddresses(search: string): string[] {
       return this.addrs.filter(x => x.indexOf(search) >= 0);
-    }
+  }
+
+  public getData(): ContactParams {
+    return {
+      addrs: this.addrs,
+      groups: this.groups,
+      hash: this.hash,
+      id: this.id,
+      notes: this.notes
+    };
+  }
 }

+ 1 - 0
src/contact-params.ts

@@ -3,4 +3,5 @@ export interface ContactParams {
     hash: string;
     addrs: string[];
     groups: string[];
+    notes: string;
 }