repositories
/
e-mobility-charging-stations-simulator.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Permit to disable persistent configuration storage.
[e-mobility-charging-stations-simulator.git]
/
src
/
types
/
UIProtocol.ts
diff --git
a/src/types/UIProtocol.ts
b/src/types/UIProtocol.ts
index a7dfa334ef7f3fbb7c0e1b2ec03782c6a00a2538..1756c0faff73b694a310f83bbf368c898aa8100f 100644
(file)
--- 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',
export enum ProtocolVersion {
'0.0.1' = '0.0.1',
- '0.0.2' = '0.0.2',
}
export enum ProtocolCommand {
}
export enum ProtocolCommand {
+ LIST_CHARGING_STATIONS = 'listChargingStations',
START_TRANSACTION = 'startTransaction',
STOP_TRANSACTION = 'stopTransaction',
START_TRANSACTION = 'startTransaction',
STOP_TRANSACTION = 'stopTransaction',
- UNKNOWN = 'unknown',
}
}
-export type ProtocolRequest = [Protocol
Version, ProtocolCommand, Record<string, unknown>
];
+export type ProtocolRequest = [Protocol
Command, JsonType
];
-export type ProtocolRequestHandler = (payload: Record<string, unknown>) => Record<string, unknown> | Promise<Record<string, unknown>>;
+export type ProtocolRequestHandler = (
+ payload: JsonType
+) => void | Promise<void> | JsonType | Promise<JsonType>;