From 1471aae8927c20d646cc2aa5ab0e20c1a7f2c0ca Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 7 Apr 2020 01:23:29 +0530 Subject: linter / simpler webextension pack --- src/util/timer.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/util/timer.ts') 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. @@ -23,6 +21,12 @@ import { Duration } from "./time"; * this abstracts over these differences. */ +/** + * Imports. + */ +import { Duration } from "./time"; + + /** * Cancelable timer. */ @@ -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)) { -- cgit v1.2.3