X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Ftypes%2FUIProtocol.ts;h=1756c0faff73b694a310f83bbf368c898aa8100f;hb=ccb1d6e97cc0248cd96a9505cf5e8f037d66984c;hp=a7dfa334ef7f3fbb7c0e1b2ec03782c6a00a2538;hpb=8244f5f080133602e63ce6d985f87782a8af9fbc;p=e-mobility-charging-stations-simulator.git diff --git a/src/types/UIProtocol.ts b/src/types/UIProtocol.ts index a7dfa334..1756c0fa 100644 --- a/src/types/UIProtocol.ts +++ b/src/types/UIProtocol.ts @@ -1,15 +1,26 @@ +import { JsonType } from './JsonType'; + +export enum Protocol { + UI = 'ui', +} + +export enum ApplicationProtocol { + HTTP = 'http', + WS = 'ws', +} export enum ProtocolVersion { '0.0.1' = '0.0.1', - '0.0.2' = '0.0.2', } export enum ProtocolCommand { + LIST_CHARGING_STATIONS = 'listChargingStations', START_TRANSACTION = 'startTransaction', STOP_TRANSACTION = 'stopTransaction', - UNKNOWN = 'unknown', } -export type ProtocolRequest = [ProtocolVersion, ProtocolCommand, Record]; +export type ProtocolRequest = [ProtocolCommand, JsonType]; -export type ProtocolRequestHandler = (payload: Record) => Record | Promise>; +export type ProtocolRequestHandler = ( + payload: JsonType +) => void | Promise | JsonType | Promise;