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