README.md: refine UI protocol documentation
[e-mobility-charging-stations-simulator.git] / src / types / WorkerBroadcastChannel.ts
CommitLineData
89b7a234 1import { JsonObject } from './JsonType';
4e3ff94d 2import { RequestPayload, ResponsePayload } from './UIProtocol';
32de5a57 3
4e3ff94d
JB
4export type BroadcastChannelRequest = [
5 string,
6 BroadcastChannelProcedureName,
7 BroadcastChannelRequestPayload
8];
9export type BroadcastChannelResponse = [string, BroadcastChannelResponsePayload];
89b7a234
JB
10
11export enum BroadcastChannelProcedureName {
12 START_CHARGING_STATION = 'startChargingStation',
13 STOP_CHARGING_STATION = 'stopChargingStation',
14 START_TRANSACTION = 'startTransaction',
15 STOP_TRANSACTION = 'stopTransaction',
16}
17
6c8f5d90 18export interface BroadcastChannelRequestPayload extends Omit<RequestPayload, 'hashId'> {
89b7a234 19 hashId: string;
32de5a57
LM
20 connectorId?: number;
21 transactionId?: number;
22 idTag?: string;
23}
89b7a234 24
4e3ff94d 25export type BroadcastChannelResponsePayload = ResponsePayload;
6c8f5d90
JB
26
27export type MessageEvent = { data: BroadcastChannelRequest | BroadcastChannelResponse };