Annotate with return types

This commit is contained in:
Danila Fedorin 2021-08-10 16:44:49 -07:00
parent f8613e9e96
commit 8ad2857c6a
3 changed files with 7 additions and 7 deletions

View File

@ -89,7 +89,7 @@ class QueryTargetWrapper<T> {
} }
} }
get(key: IDBValidKey): IDBRequest<T> { get(key: IDBValidKey): IDBRequest<T | null> {
try { try {
LOG_REQUESTS && logRequest("get", [key], this._qt); LOG_REQUESTS && logRequest("get", [key], this._qt);
return this._qt.get(key); return this._qt.get(key);

View File

@ -38,24 +38,24 @@ export class RoomSummaryStore {
this._summaryStore = summaryStore; this._summaryStore = summaryStore;
} }
getAll() { getAll(): Promise<SummaryData[]> {
return this._summaryStore.selectAll(); return this._summaryStore.selectAll();
} }
set(summary: SummaryData) { set(summary: SummaryData): void {
return this._summaryStore.put(summary); return this._summaryStore.put(summary);
} }
get(roomId: string) { get(roomId: string): Promise<SummaryData | null> {
return this._summaryStore.get(roomId); return this._summaryStore.get(roomId);
} }
async has(roomId: string) { async has(roomId: string): Promise<boolean> {
const fetchedKey = await this._summaryStore.getKey(roomId); const fetchedKey = await this._summaryStore.getKey(roomId);
return roomId === fetchedKey; return roomId === fetchedKey;
} }
remove(roomId: string) { remove(roomId: string): void {
return this._summaryStore.delete(roomId); return this._summaryStore.delete(roomId);
} }
} }

View File

@ -22,7 +22,7 @@ export class SessionStore {
this._sessionStore = sessionStore; this._sessionStore = sessionStore;
} }
async get(key: IDBValidKey) { async get(key: IDBValidKey): Promise<any> {
const entry = await this._sessionStore.get(key); const entry = await this._sessionStore.get(key);
if (entry) { if (entry) {
return entry.value; return entry.value;