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