aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-04-07 01:23:29 +0530
committerFlorian Dold <florian.dold@gmail.com>2020-04-07 01:23:29 +0530
commit1471aae8927c20d646cc2aa5ab0e20c1a7f2c0ca (patch)
tree32d32d7f33b2ca64cf101006442b1b17bfaf61aa /src/util
parent47787c0b0b846d5f4a057661efdd05d8786032f1 (diff)
downloadwallet-core-1471aae8927c20d646cc2aa5ab0e20c1a7f2c0ca.tar.xz
linter / simpler webextension pack
Diffstat (limited to 'src/util')
-rw-r--r--src/util/query.ts4
-rw-r--r--src/util/timer.ts16
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)) {