2abefe258dc991de01a9723d3d5fb563de181149
[e-mobility-charging-stations-simulator.git] / src / types / UIProtocol.ts
1 export enum Protocol {
2 UI = 'ui',
3 }
4
5 export enum ProtocolVersion {
6 '0.0.1' = '0.0.1',
7 '0.0.2' = '0.0.2',
8 }
9
10 export enum ProtocolCommand {
11 LIST_CHARGING_STATIONS = 'listChargingStations',
12 START_TRANSACTION = 'startTransaction',
13 STOP_TRANSACTION = 'stopTransaction',
14 UNKNOWN = 'unknown',
15 }
16
17 export type ProtocolRequest = [ProtocolCommand, Record<string, unknown>];
18
19 export type ProtocolRequestHandler = (payload: Record<string, unknown>) => void | Promise<void> | Record<string, unknown> | Promise<Record<string, unknown>>;