From: Jérôme Benoit Date: Thu, 1 Feb 2024 10:22:33 +0000 (+0100) Subject: refactor: add type for template charging stations tracking X-Git-Tag: v1.2.34~5 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=efc411f77a552bf66e118c46c25dcf6ef8d07a16;p=e-mobility-charging-stations-simulator.git refactor: add type for template charging stations tracking Signed-off-by: Jérôme Benoit --- 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) )