X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Ftypes%2FChargingStationWorker.ts;h=4d47a5e3698bb96a5bad1e9f3093af396993be32;hb=551f2b6e68f544b559243a2634c8b52a15bcdeec;hp=d0cdf900dd2a836ed76dd827c035e795714757e2;hpb=1d41bc6b533ef7361954f472811263c24cd6f64b;p=e-mobility-charging-stations-simulator.git diff --git a/src/types/ChargingStationWorker.ts b/src/types/ChargingStationWorker.ts index d0cdf900..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,10 +10,15 @@ 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[] + persistentConfiguration?: boolean autoStart?: boolean + autoRegister?: boolean + enableStatistics?: boolean + ocppStrictCompliance?: boolean + stopTransactionsOnStopped?: boolean } export interface ChargingStationWorkerData extends WorkerData { @@ -46,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 }