From 016b51ba37ff8fbf20d0ec6638773c6ada4d70e1 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Thu, 12 Aug 2021 10:39:02 -0700 Subject: [PATCH] Add type annotations to OutboundGroupSessionStore --- .../idb/stores/OutboundGroupSessionStore.ts | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/matrix/storage/idb/stores/OutboundGroupSessionStore.ts b/src/matrix/storage/idb/stores/OutboundGroupSessionStore.ts index 9710765f..3e3e781b 100644 --- a/src/matrix/storage/idb/stores/OutboundGroupSessionStore.ts +++ b/src/matrix/storage/idb/stores/OutboundGroupSessionStore.ts @@ -13,21 +13,30 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ +import {Store} from "../Store" + +interface OutboundSession { + roomId: string + session: string + createdAt: number +} export class OutboundGroupSessionStore { - constructor(store) { + private _store: Store + + constructor(store: Store) { this._store = store; } - remove(roomId) { - this._store.delete(roomId); + remove(roomId: string): Promise { + return this._store.delete(roomId); } - get(roomId) { + get(roomId: string): Promise { return this._store.get(roomId); } - set(session) { - this._store.put(session); + set(session: OutboundSession): Promise { + return this._store.put(session); } }