From 8ad2857c6a2becc4443ba54c08aa59ad85d3f007 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Tue, 10 Aug 2021 16:44:49 -0700 Subject: [PATCH] Annotate with return types --- src/matrix/storage/idb/Store.ts | 2 +- src/matrix/storage/idb/stores/RoomSummaryStore.ts | 10 +++++----- src/matrix/storage/idb/stores/SessionStore.ts | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/matrix/storage/idb/Store.ts b/src/matrix/storage/idb/Store.ts index 17fb3762..82669753 100644 --- a/src/matrix/storage/idb/Store.ts +++ b/src/matrix/storage/idb/Store.ts @@ -89,7 +89,7 @@ class QueryTargetWrapper { } } - get(key: IDBValidKey): IDBRequest { + get(key: IDBValidKey): IDBRequest { try { LOG_REQUESTS && logRequest("get", [key], this._qt); return this._qt.get(key); diff --git a/src/matrix/storage/idb/stores/RoomSummaryStore.ts b/src/matrix/storage/idb/stores/RoomSummaryStore.ts index bacefa5c..7b6ed600 100644 --- a/src/matrix/storage/idb/stores/RoomSummaryStore.ts +++ b/src/matrix/storage/idb/stores/RoomSummaryStore.ts @@ -38,24 +38,24 @@ export class RoomSummaryStore { this._summaryStore = summaryStore; } - getAll() { + getAll(): Promise { return this._summaryStore.selectAll(); } - set(summary: SummaryData) { + set(summary: SummaryData): void { return this._summaryStore.put(summary); } - get(roomId: string) { + get(roomId: string): Promise { return this._summaryStore.get(roomId); } - async has(roomId: string) { + async has(roomId: string): Promise { const fetchedKey = await this._summaryStore.getKey(roomId); return roomId === fetchedKey; } - remove(roomId: string) { + remove(roomId: string): void { return this._summaryStore.delete(roomId); } } diff --git a/src/matrix/storage/idb/stores/SessionStore.ts b/src/matrix/storage/idb/stores/SessionStore.ts index 4da63649..dd578d8c 100644 --- a/src/matrix/storage/idb/stores/SessionStore.ts +++ b/src/matrix/storage/idb/stores/SessionStore.ts @@ -22,7 +22,7 @@ export class SessionStore { this._sessionStore = sessionStore; } - async get(key: IDBValidKey) { + async get(key: IDBValidKey): Promise { const entry = await this._sessionStore.get(key); if (entry) { return entry.value;