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