Remove uneeded intermediate variable
[e-mobility-charging-stations-simulator.git] / src / types / WorkerBroadcastChannel.ts
... / ...
CommitLineData
1import type { RequestPayload, ResponsePayload } from './UIProtocol';
2
3export type BroadcastChannelRequest = [
4 string,
5 BroadcastChannelProcedureName,
6 BroadcastChannelRequestPayload
7];
8export type BroadcastChannelResponse = [string, BroadcastChannelResponsePayload];
9
10export enum BroadcastChannelProcedureName {
11 START_CHARGING_STATION = 'startChargingStation',
12 STOP_CHARGING_STATION = 'stopChargingStation',
13 OPEN_CONNECTION = 'openConnection',
14 CLOSE_CONNECTION = 'closeConnection',
15 START_TRANSACTION = 'startTransaction',
16 STOP_TRANSACTION = 'stopTransaction',
17 START_AUTOMATIC_TRANSACTION_GENERATOR = 'startAutomaticTransactionGenerator',
18 STOP_AUTOMATIC_TRANSACTION_GENERATOR = 'stopAutomaticTransactionGenerator',
19 STATUS_NOTIFICATION = 'statusNotification',
20}
21
22export interface BroadcastChannelRequestPayload extends RequestPayload {
23 connectorId?: number;
24 transactionId?: number;
25 idTag?: string;
26}
27
28export interface BroadcastChannelResponsePayload
29 extends Omit<ResponsePayload, 'hashIdsSucceeded' | 'hashIdsFailed' | 'responsesFailed'> {
30 hashId: string;
31}
32
33export type MessageEvent = { data: BroadcastChannelRequest | BroadcastChannelResponse };