refactor: switch eslint configuration to strict type checking
[e-mobility-charging-stations-simulator.git] / src / types / WorkerBroadcastChannel.ts
CommitLineData
66a7748d 1import type { RequestPayload, ResponsePayload } from './UIProtocol.js'
32de5a57 2
4e3ff94d
JB
3export type BroadcastChannelRequest = [
4 string,
5 BroadcastChannelProcedureName,
a807045b 6 BroadcastChannelRequestPayload,
66a7748d
JB
7]
8export type BroadcastChannelResponse = [string, BroadcastChannelResponsePayload]
89b7a234
JB
9
10export enum BroadcastChannelProcedureName {
11 START_CHARGING_STATION = 'startChargingStation',
12 STOP_CHARGING_STATION = 'stopChargingStation',
db2336d9
JB
13 OPEN_CONNECTION = 'openConnection',
14 CLOSE_CONNECTION = 'closeConnection',
4f69be04
JB
15 START_AUTOMATIC_TRANSACTION_GENERATOR = 'startAutomaticTransactionGenerator',
16 STOP_AUTOMATIC_TRANSACTION_GENERATOR = 'stopAutomaticTransactionGenerator',
269de583 17 SET_SUPERVISION_URL = 'setSupervisionUrl',
5e8e29f4
JB
18 START_TRANSACTION = 'startTransaction',
19 STOP_TRANSACTION = 'stopTransaction',
1984f194 20 AUTHORIZE = 'authorize',
8bfbc743 21 BOOT_NOTIFICATION = 'bootNotification',
a9ed42b2 22 STATUS_NOTIFICATION = 'statusNotification',
10db00b2 23 HEARTBEAT = 'heartbeat',
d3195f0a 24 METER_VALUES = 'meterValues',
91a7d3ea 25 DATA_TRANSFER = 'dataTransfer',
c9a4f9ea 26 DIAGNOSTICS_STATUS_NOTIFICATION = 'diagnosticsStatusNotification',
a807045b 27 FIRMWARE_STATUS_NOTIFICATION = 'firmwareStatusNotification',
89b7a234
JB
28}
29
39257250 30export interface BroadcastChannelRequestPayload extends RequestPayload {
66a7748d
JB
31 connectorId?: number
32 transactionId?: number
32de5a57 33}
89b7a234 34
a9ed42b2
JB
35export interface BroadcastChannelResponsePayload
36 extends Omit<ResponsePayload, 'hashIdsSucceeded' | 'hashIdsFailed' | 'responsesFailed'> {
5199f9fd 37 hashId: string | undefined
10d244c0 38}
6c8f5d90 39
e1d9a0f4 40export interface MessageEvent {
66a7748d 41 data: BroadcastChannelRequest | BroadcastChannelResponse
e1d9a0f4 42}