From c5a209258e2acfda2098115b7eddfb85acc761b0 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Wed, 11 Aug 2021 16:41:00 -0700 Subject: [PATCH] Add type annotations to UserIdentityStore --- .../storage/idb/stores/UserIdentityStore.ts | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/matrix/storage/idb/stores/UserIdentityStore.ts b/src/matrix/storage/idb/stores/UserIdentityStore.ts index 1cf6d636..2ba6440a 100644 --- a/src/matrix/storage/idb/stores/UserIdentityStore.ts +++ b/src/matrix/storage/idb/stores/UserIdentityStore.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 UserIdentity { + userId: string + roomIds: string[] + deviceTrackingStatus: number +} export class UserIdentityStore { - constructor(store) { + private _store: Store + + constructor(store: Store) { this._store = store; } - get(userId) { + get(userId: string): Promise { return this._store.get(userId); } - set(userIdentity) { - this._store.put(userIdentity); + set(userIdentity: UserIdentity): Promise { + return this._store.put(userIdentity); } - remove(userId) { + remove(userId: string): Promise { return this._store.delete(userId); } }