Bladeren bron

Add events key to Message type

Danilo Bargen 7 jaren geleden
bovenliggende
commit
13f1a96650
1 gewijzigde bestanden met toevoegingen van 21 en 0 verwijderingen
  1. 21 0
      src/threema.d.ts

+ 21 - 0
src/threema.d.ts

@@ -60,6 +60,26 @@ declare namespace threema {
         height: number;
     }
 
+    const enum EventType {
+        Created = 'created',
+        Sent = 'sent',
+        Delivered = 'delivered',
+        Read = 'read',
+        Acked = 'acked',
+        Modified = 'modified',
+    }
+
+    /**
+     * A message event, e.g. when it was delivered, read or modified.
+     */
+    interface MessageEvent {
+        // The event type
+        type: EventType;
+
+        // Unix timestamp in seconds
+        date: number;
+    }
+
     /**
      * A Threema chat message.
      */
@@ -69,6 +89,7 @@ declare namespace threema {
         body: string;
         thumbnail?: Thumbnail;
         date?: number;
+        events?: MessageEvent[];
         sortKey: number;
         partnerId: string;
         isOutbox: boolean;