Commit | Line | Data |
---|---|---|
5cc4b63b | 1 | import { JsonType } from './JsonType'; |
d1888640 | 2 | |
4198ad5c JB |
3 | export enum Protocol { |
4 | UI = 'ui', | |
5 | } | |
8244f5f0 | 6 | |
675fa8e3 JB |
7 | export enum ApplicationProtocol { |
8 | HTTP = 'http', | |
9 | WS = 'ws', | |
10 | } | |
11 | ||
8244f5f0 JB |
12 | export enum ProtocolVersion { |
13 | '0.0.1' = '0.0.1', | |
8244f5f0 JB |
14 | } |
15 | ||
16 | export enum ProtocolCommand { | |
ee0f106b | 17 | LIST_CHARGING_STATIONS = 'listChargingStations', |
8244f5f0 JB |
18 | START_TRANSACTION = 'startTransaction', |
19 | STOP_TRANSACTION = 'stopTransaction', | |
8244f5f0 JB |
20 | } |
21 | ||
5cc4b63b | 22 | export type ProtocolRequest = [ProtocolCommand, JsonType]; |
8244f5f0 | 23 | |
e7aeea18 | 24 | export type ProtocolRequestHandler = ( |
5cc4b63b JB |
25 | payload: JsonType |
26 | ) => void | Promise<void> | JsonType | Promise<JsonType>; |