X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Ftypes%2FChargingStationWorker.ts;h=ff3c5ef0fe56ed6b29d11745279dd334741a3b92;hb=0b1828224edf798044ef54672ddfc69598cd99a5;hp=740d6e50a21a0e30f2138be7cbce8dd49fcf046c;hpb=68220b423c52da387fdf41967dd8c738da0ff52e;p=e-mobility-charging-stations-simulator.git diff --git a/src/types/ChargingStationWorker.ts b/src/types/ChargingStationWorker.ts index 740d6e50..ff3c5ef0 100644 --- a/src/types/ChargingStationWorker.ts +++ b/src/types/ChargingStationWorker.ts @@ -11,14 +11,20 @@ import type { BootNotificationResponse } from './ocpp/Responses.js' import type { Statistics } from './Statistics.js' import { type WorkerData, type WorkerMessage, WorkerMessageEvents } from '../worker/index.js' -interface ChargingStationWorkerOptions extends JsonObject { - elementStartDelay?: number +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 { index: number templateFile: string - chargingStationWorkerOptions?: ChargingStationWorkerOptions + options?: ChargingStationOptions } export type EvseStatusWorkerType = Omit & { @@ -31,6 +37,7 @@ export interface ChargingStationData extends WorkerData { connectors: ConnectorStatus[] evses: EvseStatusWorkerType[] ocppConfiguration: ChargingStationOcppConfiguration + supervisionUrl: string wsState?: | typeof WebSocket.CONNECTING | typeof WebSocket.OPEN @@ -41,7 +48,7 @@ export interface ChargingStationData extends WorkerData { } enum ChargingStationMessageEvents { - performanceStatistics = 'performanceStatistics', + performanceStatistics = 'performanceStatistics' } export const ChargingStationWorkerMessageEvents = { @@ -55,7 +62,17 @@ export type ChargingStationWorkerMessageEvents = | ChargingStationEvents | ChargingStationMessageEvents -export type ChargingStationWorkerMessageData = ChargingStationData | Statistics +export interface ChargingStationWorkerEventError extends WorkerData { + event: WorkerMessageEvents + name: string + message: string + stack?: string +} + +export type ChargingStationWorkerMessageData = + | ChargingStationData + | Statistics + | ChargingStationWorkerEventError export type ChargingStationWorkerMessage = Omit< WorkerMessage,