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