diff options
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/query.ts | 4 | ||||
-rw-r--r-- | src/util/timer.ts | 16 |
2 files changed, 12 insertions, 8 deletions
diff --git a/src/util/query.ts b/src/util/query.ts index d11b79a96..256395d42 100644 --- a/src/util/query.ts +++ b/src/util/query.ts @@ -292,7 +292,7 @@ export class TransactionHandle { return requestToPromise(req); } - mutate<T>(store: Store<T>, key: any, f: (x: T) => T | undefined) { + mutate<T>(store: Store<T>, key: any, f: (x: T) => T | undefined): Promise<void> { const req = this.tx.objectStore(store.name).openCursor(key); return applyMutation(req, f); } @@ -438,7 +438,7 @@ export function openDatabase( export class Database { constructor(private db: IDBDatabase) {} - static deleteDatabase(idbFactory: IDBFactory, dbName: string) { + static deleteDatabase(idbFactory: IDBFactory, dbName: string): void { idbFactory.deleteDatabase(dbName); } diff --git a/src/util/timer.ts b/src/util/timer.ts index a1712b03f..18132a812 100644 --- a/src/util/timer.ts +++ b/src/util/timer.ts @@ -1,5 +1,3 @@ -import { Duration } from "./time"; - /* This file is part of GNU Taler (C) 2017-2019 Taler Systems S.A. @@ -24,6 +22,12 @@ import { Duration } from "./time"; */ /** + * Imports. + */ +import { Duration } from "./time"; + + +/** * Cancelable timer. */ export interface TimerHandle { @@ -33,7 +37,7 @@ export interface TimerHandle { class IntervalHandle { constructor(public h: any) {} - clear() { + clear(): void { clearInterval(this.h); } } @@ -41,7 +45,7 @@ class IntervalHandle { class TimeoutHandle { constructor(public h: any) {} - clear() { + clear(): void { clearTimeout(this.h); } } @@ -55,7 +59,7 @@ export const performanceNow: () => number = (() => { const t = process.hrtime(); return t[0] * 1e9 + t[1]; }; - } else if (typeof "performance" !== "undefined") { + } else if (typeof performance !== "undefined") { return () => performance.now(); } else { return () => 0; @@ -93,7 +97,7 @@ export class TimerGroup { private idGen = 1; - stopCurrentAndFutureTimers() { + stopCurrentAndFutureTimers(): void { this.stopped = true; for (const x in this.timerMap) { if (!this.timerMap.hasOwnProperty(x)) { |