X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Ftypes%2FChargingStationWorker.ts;h=4d47a5e3698bb96a5bad1e9f3093af396993be32;hb=385c5e62929a2c113898706b8ec940840b7f6f4f;hp=5b12307973d495118e65b273bc00190d32809b20;hpb=66a7748ddeda8c94d7562a1ce58d440319654a4c;p=e-mobility-charging-stations-simulator.git diff --git a/src/types/ChargingStationWorker.ts b/src/types/ChargingStationWorker.ts index 5b123079..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,16 +10,21 @@ 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' -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 @@ -45,21 +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 type ChargingStationWorkerMessageData = ChargingStationData | Statistics -export type ChargingStationWorkerMessage = Omit< -WorkerMessage, -'event' -> & { +export interface ChargingStationWorkerMessage { event: ChargingStationWorkerMessageEvents + data: T }