Commit | Line | Data |
---|---|---|
6c1761d4 JB |
1 | import type ChargingStationInfo from './ChargingStationInfo'; |
2 | import type { ConnectorStatus } from './ConnectorStatus'; | |
3 | import type { JsonObject } from './JsonType'; | |
4 | import type { BootNotificationResponse } from './ocpp/Responses'; | |
5 | import type Statistics from './Statistics'; | |
8114d10e | 6 | import { WorkerData, WorkerMessage, WorkerMessageEvents } from './Worker'; |
d070d967 | 7 | |
e3822d6f | 8 | export interface ChargingStationWorkerOptions extends JsonObject { |
d070d967 JB |
9 | elementStartDelay?: number; |
10 | } | |
11 | ||
98dc07fa JB |
12 | export interface ChargingStationWorkerData extends WorkerData { |
13 | index: number; | |
14 | templateFile: string; | |
d070d967 | 15 | chargingStationWorkerOptions?: ChargingStationWorkerOptions; |
98dc07fa JB |
16 | } |
17 | ||
32de5a57 | 18 | export interface ChargingStationData extends WorkerData { |
32de5a57 | 19 | stationInfo: ChargingStationInfo; |
89b7a234 | 20 | stopped: boolean; |
ce7a4fc3 | 21 | bootNotificationResponse: BootNotificationResponse; |
32de5a57 LM |
22 | connectors: ConnectorStatus[]; |
23 | } | |
24 | ||
25 | enum ChargingStationMessageEvents { | |
ee0f106b JB |
26 | STARTED = 'started', |
27 | STOPPED = 'stopped', | |
32de5a57 | 28 | UPDATED = 'updated', |
e7aeea18 | 29 | PERFORMANCE_STATISTICS = 'performanceStatistics', |
98dc07fa JB |
30 | } |
31 | ||
32de5a57 | 32 | export type ChargingStationWorkerMessageEvents = WorkerMessageEvents | ChargingStationMessageEvents; |
98dc07fa JB |
33 | |
34 | export const ChargingStationWorkerMessageEvents = { | |
35 | ...WorkerMessageEvents, | |
32de5a57 | 36 | ...ChargingStationMessageEvents, |
98dc07fa JB |
37 | }; |
38 | ||
53e5fd67 JB |
39 | export type ChargingStationWorkerMessageData = ChargingStationData | Statistics; |
40 | ||
32de5a57 LM |
41 | export interface ChargingStationWorkerMessage<T extends WorkerData> |
42 | extends Omit<WorkerMessage<T>, 'id'> { | |
98dc07fa JB |
43 | id: ChargingStationWorkerMessageEvents; |
44 | } |