Do not throw an error at OCPP message sending to avoid crashing the
[e-mobility-charging-stations-simulator.git] / src / types / UIProtocol.ts
CommitLineData
d1888640
JB
1import { JsonType } from './JsonType';
2
4198ad5c
JB
3export enum Protocol {
4 UI = 'ui',
5}
8244f5f0
JB
6
7export enum ProtocolVersion {
8 '0.0.1' = '0.0.1',
8244f5f0
JB
9}
10
11export enum ProtocolCommand {
ee0f106b 12 LIST_CHARGING_STATIONS = 'listChargingStations',
8244f5f0
JB
13 START_TRANSACTION = 'startTransaction',
14 STOP_TRANSACTION = 'stopTransaction',
15 UNKNOWN = 'unknown',
16}
17
d1888640 18export type ProtocolRequest = [ProtocolCommand, JsonType];
8244f5f0 19
d1888640 20export type ProtocolRequestHandler = (payload: JsonType) => void | Promise<void> | JsonType | Promise<JsonType>;