-// Partial Copyright Jerome Benoit. 2021. All Rights Reserved.
+// Partial Copyright Jerome Benoit. 2021-2023. All Rights Reserved.
import path from 'path';
import { fileURLToPath } from 'url';
import type { Storage } from '../performance/storage/Storage';
import { StorageFactory } from '../performance/storage/StorageFactory';
import {
- ChargingStationData,
- ChargingStationWorkerData,
- ChargingStationWorkerMessage,
- ChargingStationWorkerMessageData,
+ type ChargingStationData,
+ type ChargingStationWorkerData,
+ type ChargingStationWorkerMessage,
+ type ChargingStationWorkerMessageData,
ChargingStationWorkerMessageEvents,
} from '../types/ChargingStationWorker';
import type { StationTemplateUrl } from '../types/ConfigurationData';
import type { Statistics } from '../types/Statistics';
+import type { MessageHandler } from '../types/Worker';
import Configuration from '../utils/Configuration';
import logger from '../utils/Logger';
import Utils from '../utils/Utils';
poolOptions: {
workerChoiceStrategy: Configuration.getWorker().poolStrategy,
},
- messageHandler: this.messageHandler.bind(this) as (
- this: Worker,
- msg: ChargingStationWorkerMessage<ChargingStationWorkerMessageData>
- ) => void,
+ messageHandler: this.messageHandler.bind(this) as MessageHandler<Worker>,
}
));
}