aboutsummaryrefslogtreecommitdiff
path: root/lib/wallet/query.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2016-10-13 02:23:24 +0200
committerFlorian Dold <florian.dold@gmail.com>2016-10-13 02:23:24 +0200
commit250069d86097a966366d21e447f6c3fcc70659bd (patch)
tree0710d7957ece0997e217206622854bf112d8e9b6 /lib/wallet/query.ts
parent122e069d914622343fa1a21c3990a2f416ea9dfe (diff)
refactoring / refresh WIP
Diffstat (limited to 'lib/wallet/query.ts')
-rw-r--r--lib/wallet/query.ts8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/wallet/query.ts b/lib/wallet/query.ts
index 77a4f8e35..fa78fe640 100644
--- a/lib/wallet/query.ts
+++ b/lib/wallet/query.ts
@@ -24,10 +24,6 @@
"use strict";
-export function Query(db: IDBDatabase) {
- return new QueryRoot(db);
-}
-
/**
* Stream that can be filtered, reduced or joined
* with indices.
@@ -265,7 +261,7 @@ class IterQueryStream<T> extends QueryStreamBase<T> {
}
-class QueryRoot {
+export class QueryRoot {
private work: ((t: IDBTransaction) => void)[] = [];
private db: IDBDatabase;
private stores = new Set();
@@ -332,7 +328,7 @@ class QueryRoot {
/**
* Get one object from a store by its key.
*/
- get(storeName: any, key: any): Promise<any> {
+ get<T>(storeName: any, key: any): Promise<T|undefined> {
if (key === void 0) {
throw Error("key must not be undefined");
}