UI WS server: use a map to store UI services per protocol version
[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 }
8
9 export enum ProtocolCommand {
10 LIST_CHARGING_STATIONS = 'listChargingStations',
11 START_TRANSACTION = 'startTransaction',
12 STOP_TRANSACTION = 'stopTransaction',
13 UNKNOWN = 'unknown',
14 }
15
16 export type ProtocolRequest = [ProtocolCommand, Record<string, unknown>];
17
18 export type ProtocolRequestHandler = (payload: Record<string, unknown>) => void | Promise<void> | Record<string, unknown> | Promise<Record<string, unknown>>;