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 {
LOG_REQUESTS && logRequest("get", [key], this._qt);
return this._qt.get(key);

View file

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

View file

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