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 LM |
18 | export interface ChargingStationData extends WorkerData { |
19 | hashId: string; | |
20 | stationInfo: ChargingStationInfo; | |
89b7a234 | 21 | stopped: boolean; |
ce7a4fc3 | 22 | bootNotificationResponse: BootNotificationResponse; |
32de5a57 LM |
23 | connectors: ConnectorStatus[]; |
24 | } | |
25 | ||
26 | enum ChargingStationMessageEvents { | |
ee0f106b JB |
27 | STARTED = 'started', |
28 | STOPPED = 'stopped', | |
32de5a57 | 29 | UPDATED = 'updated', |
e7aeea18 | 30 | PERFORMANCE_STATISTICS = 'performanceStatistics', |
98dc07fa JB |
31 | } |
32 | ||
32de5a57 | 33 | export type ChargingStationWorkerMessageEvents = WorkerMessageEvents | ChargingStationMessageEvents; |
98dc07fa JB |
34 | |
35 | export const ChargingStationWorkerMessageEvents = { | |
36 | ...WorkerMessageEvents, | |
32de5a57 | 37 | ...ChargingStationMessageEvents, |
98dc07fa JB |
38 | }; |
39 | ||
53e5fd67 JB |
40 | export type ChargingStationWorkerMessageData = ChargingStationData | Statistics; |
41 | ||
32de5a57 LM |
42 | export interface ChargingStationWorkerMessage<T extends WorkerData> |
43 | extends Omit<WorkerMessage<T>, 'id'> { | |
98dc07fa JB |
44 | id: ChargingStationWorkerMessageEvents; |
45 | } |