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