mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-24 12:04:57 +01:00
Annotate with return types
This commit is contained in:
parent
f8613e9e96
commit
8ad2857c6a
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user