From efc411f77a552bf66e118c46c25dcf6ef8d07a16 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Thu, 1 Feb 2024 11:22:33 +0100 Subject: [PATCH] refactor: add type for template charging stations tracking MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/Bootstrap.ts | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/charging-station/Bootstrap.ts b/src/charging-station/Bootstrap.ts index de438978..bd740997 100644 --- a/src/charging-station/Bootstrap.ts +++ b/src/charging-station/Bootstrap.ts @@ -54,16 +54,18 @@ enum exitCodes { gracefulShutdownError = 4 } +interface TemplateChargingStations { + configured: number + started: number + lastIndex: number +} + export class Bootstrap extends EventEmitter { private static instance: Bootstrap | null = null private workerImplementation?: WorkerAbstract private readonly uiServer?: AbstractUIServer private storage?: Storage - private readonly chargingStationsByTemplate: Map< - string, - { configured: number, started: number, lastIndex: number } - > - + private readonly chargingStationsByTemplate: Map private readonly version: string = version private initializedCounters: boolean private started: boolean @@ -81,10 +83,7 @@ export class Bootstrap extends EventEmitter { this.started = false this.starting = false this.stopping = false - this.chargingStationsByTemplate = new Map< - string, - { configured: number, started: number, lastIndex: number } - >() + this.chargingStationsByTemplate = new Map() this.uiServer = UIServerFactory.getUIServerImplementation( Configuration.getConfigurationSection(ConfigurationSection.uiServer) ) -- 2.34.1