Use the fixed JsonType definition where appropriate
[e-mobility-charging-stations-simulator.git] / src / types / UIProtocol.ts
index 2abefe258dc991de01a9723d3d5fb563de181149..6d2478924285e3b97dfa67c1de04b28c0272bee5 100644 (file)
@@ -1,10 +1,11 @@
+import { JsonType } from './JsonType';
+
 export enum Protocol {
   UI = 'ui',
 }
 
 export enum ProtocolVersion {
   '0.0.1' = '0.0.1',
-  '0.0.2' = '0.0.2',
 }
 
 export enum ProtocolCommand {
@@ -14,6 +15,8 @@ export enum ProtocolCommand {
   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>;