Permit to disable persistent configuration storage.
[e-mobility-charging-stations-simulator.git] / src / types / UIProtocol.ts
index 2abefe258dc991de01a9723d3d5fb563de181149..1756c0faff73b694a310f83bbf368c898aa8100f 100644 (file)
@@ -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<string, unknown>];
+export type ProtocolRequest = [ProtocolCommand, JsonType];
 
-export type ProtocolRequestHandler = (payload: Record<string, unknown>) => void | Promise<void> | Record<string, unknown> | Promise<Record<string, unknown>>;
+export type ProtocolRequestHandler = (
+  payload: JsonType
+) => void | Promise<void> | JsonType | Promise<JsonType>;