X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Ftypes%2FChargingStationWorker.ts;h=2326d765c7ddd05f3021cb46d1d001ae2f4da0b9;hb=d929adcc32a8cc79f0c7182d16f70367b001d28c;hp=d53152dc00dd4c2cf56f0d23064d35548468d9cc;hpb=8d8599f0565ba2121394a3d22214d13dbfa0f2c3;p=e-mobility-charging-stations-simulator.git diff --git a/src/types/ChargingStationWorker.ts b/src/types/ChargingStationWorker.ts index d53152dc..2326d765 100644 --- a/src/types/ChargingStationWorker.ts +++ b/src/types/ChargingStationWorker.ts @@ -1,14 +1,13 @@ import type { WebSocket } from 'ws'; -import type { - BootNotificationResponse, - ChargingStationAutomaticTransactionGeneratorConfiguration, - ChargingStationInfo, - ChargingStationOcppConfiguration, - ConnectorStatus, - JsonObject, - Statistics, -} from './internal'; +import type { ChargingStationAutomaticTransactionGeneratorConfiguration } from './AutomaticTransactionGenerator'; +import type { ChargingStationInfo } from './ChargingStationInfo'; +import type { ChargingStationOcppConfiguration } from './ChargingStationOcppConfiguration'; +import type { ConnectorStatus } from './ConnectorStatus'; +import type { EvseStatus } from './Evse'; +import type { JsonObject } from './JsonType'; +import type { BootNotificationResponse } from './ocpp/Responses'; +import type { Statistics } from './Statistics'; import { type WorkerData, type WorkerMessage, WorkerMessageEvents } from '../worker'; interface ChargingStationWorkerOptions extends JsonObject { @@ -21,10 +20,15 @@ export interface ChargingStationWorkerData extends WorkerData { chargingStationWorkerOptions?: ChargingStationWorkerOptions; } +export type EvseStatusWorkerType = Omit & { + connectors?: ConnectorStatus[]; +}; + export interface ChargingStationData extends WorkerData { started: boolean; stationInfo: ChargingStationInfo; connectors: ConnectorStatus[]; + evses: EvseStatusWorkerType[]; ocppConfiguration: ChargingStationOcppConfiguration; wsState?: | typeof WebSocket.CONNECTING @@ -36,10 +40,10 @@ export interface ChargingStationData extends WorkerData { } enum ChargingStationMessageEvents { - STARTED = 'started', - STOPPED = 'stopped', - UPDATED = 'updated', - PERFORMANCE_STATISTICS = 'performanceStatistics', + started = 'started', + stopped = 'stopped', + updated = 'updated', + performanceStatistics = 'performanceStatistics', } export const ChargingStationWorkerMessageEvents = { @@ -52,7 +56,7 @@ export type ChargingStationWorkerMessageData = ChargingStationData | Statistics; export type ChargingStationWorkerMessage = Omit< WorkerMessage, - 'id' + 'event' > & { - id: ChargingStationWorkerMessageEvents; + event: ChargingStationWorkerMessageEvents; };