Browse Source

add types

Carsten Porth 5 years ago
parent
commit
ec646fb33e
1 changed files with 3 additions and 3 deletions
  1. 3 3
      app/src/providers/p2p-storage-ipfs/p2p-storage-ipfs.ts

+ 3 - 3
app/src/providers/p2p-storage-ipfs/p2p-storage-ipfs.ts

@@ -30,15 +30,15 @@ export class P2pStorageIpfsProvider {
     return await this.http.get(this.infuraUrl + "cat", options).toPromise();
   }
 
-  public fetchTweet(hash: string) {
+  public fetchTweet(hash: string): Promise<string> {
     const options = {
       params: { arg: hash }
     };
 
-    return this.http.get(this.infuraUrl + "cat", options).toPromise();
+    return this.http.get<string>(this.infuraUrl + "cat", options).toPromise();
   }
 
-  public async fetchTweets(hashs: string[]) {
+  public async fetchTweets(hashs: string[]): Promise<string[]> {
     return await Promise.all(hashs.map(hash => this.fetchTweet(hash)));
   }
 }