X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Ftypes%2FUIProtocol.ts;h=1756c0faff73b694a310f83bbf368c898aa8100f;hb=ccb1d6e97cc0248cd96a9505cf5e8f037d66984c;hp=2abefe258dc991de01a9723d3d5fb563de181149;hpb=4198ad5c76ad58e444c1dd2d3f81b5f8fd2846d4;p=e-mobility-charging-stations-simulator.git diff --git a/src/types/UIProtocol.ts b/src/types/UIProtocol.ts index 2abefe25..1756c0fa 100644 --- a/src/types/UIProtocol.ts +++ b/src/types/UIProtocol.ts @@ -1,19 +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 = [ProtocolCommand, Record]; +export type ProtocolRequest = [ProtocolCommand, JsonType]; -export type ProtocolRequestHandler = (payload: Record) => void | Promise | Record | Promise>; +export type ProtocolRequestHandler = ( + payload: JsonType +) => void | Promise | JsonType | Promise;