-import { JsonObject } from './JsonType';
-import { RequestPayload, ResponsePayload } from './UIProtocol';
+import type { RequestPayload, ResponsePayload } from './UIProtocol';
export type BroadcastChannelRequest = [
string,
export enum BroadcastChannelProcedureName {
START_CHARGING_STATION = 'startChargingStation',
STOP_CHARGING_STATION = 'stopChargingStation',
+ OPEN_CONNECTION = 'openConnection',
+ CLOSE_CONNECTION = 'closeConnection',
+ START_AUTOMATIC_TRANSACTION_GENERATOR = 'startAutomaticTransactionGenerator',
+ STOP_AUTOMATIC_TRANSACTION_GENERATOR = 'stopAutomaticTransactionGenerator',
START_TRANSACTION = 'startTransaction',
STOP_TRANSACTION = 'stopTransaction',
+ AUTHORIZE = 'authorize',
+ BOOT_NOTIFICATION = 'bootNotification',
+ STATUS_NOTIFICATION = 'statusNotification',
+ HEARTBEAT = 'heartbeat',
+ METER_VALUES = 'meterValues',
}
-interface BroadcastChannelBasePayload extends JsonObject {
- hashId: string;
-}
-
-export interface BroadcastChannelRequestPayload
- extends BroadcastChannelBasePayload,
- Omit<RequestPayload, 'hashId'> {
+export interface BroadcastChannelRequestPayload extends RequestPayload {
connectorId?: number;
transactionId?: number;
idTag?: string;
}
-export type BroadcastChannelResponsePayload = ResponsePayload;
+export interface BroadcastChannelResponsePayload
+ extends Omit<ResponsePayload, 'hashIdsSucceeded' | 'hashIdsFailed' | 'responsesFailed'> {
+ hashId: string;
+}
+
+export type MessageEvent = { data: BroadcastChannelRequest | BroadcastChannelResponse };