X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Ftypes%2FChargingStationWorker.ts;h=4d47a5e3698bb96a5bad1e9f3093af396993be32;hb=01b82de5b532cd149eccab7b82fe86a741289581;hp=ff3c5ef0fe56ed6b29d11745279dd334741a3b92;hpb=afbb820255fb5afe908c743ae53ae5a5f990c700;p=e-mobility-charging-stations-simulator.git diff --git a/src/types/ChargingStationWorker.ts b/src/types/ChargingStationWorker.ts index ff3c5ef0..4d47a5e3 100644 --- a/src/types/ChargingStationWorker.ts +++ b/src/types/ChargingStationWorker.ts @@ -1,5 +1,6 @@ import type { WebSocket } from 'ws' +import type { WorkerData } from '../worker/index.js' import type { ChargingStationAutomaticTransactionGeneratorConfiguration } from './AutomaticTransactionGenerator.js' import { ChargingStationEvents } from './ChargingStationEvents.js' import type { ChargingStationInfo } from './ChargingStationInfo.js' @@ -9,7 +10,6 @@ import type { EvseStatus } from './Evse.js' import type { JsonObject } from './JsonType.js' import type { BootNotificationResponse } from './ocpp/Responses.js' import type { Statistics } from './Statistics.js' -import { type WorkerData, type WorkerMessage, WorkerMessageEvents } from '../worker/index.js' export interface ChargingStationOptions extends JsonObject { supervisionUrls?: string | string[] @@ -52,31 +52,17 @@ enum ChargingStationMessageEvents { } export const ChargingStationWorkerMessageEvents = { - ...WorkerMessageEvents, ...ChargingStationEvents, ...ChargingStationMessageEvents } as const // eslint-disable-next-line @typescript-eslint/no-redeclare export type ChargingStationWorkerMessageEvents = - | WorkerMessageEvents | ChargingStationEvents | ChargingStationMessageEvents -export interface ChargingStationWorkerEventError extends WorkerData { - event: WorkerMessageEvents - name: string - message: string - stack?: string -} - -export type ChargingStationWorkerMessageData = - | ChargingStationData - | Statistics - | ChargingStationWorkerEventError +export type ChargingStationWorkerMessageData = ChargingStationData | Statistics -export type ChargingStationWorkerMessage = Omit< -WorkerMessage, -'event' -> & { +export interface ChargingStationWorkerMessage { event: ChargingStationWorkerMessageEvents + data: T }