Commit | Line | Data |
---|---|---|
6c1761d4 | 1 | import type { RequestPayload, ResponsePayload } from './UIProtocol'; |
32de5a57 | 2 | |
4e3ff94d JB |
3 | export type BroadcastChannelRequest = [ |
4 | string, | |
5 | BroadcastChannelProcedureName, | |
6 | BroadcastChannelRequestPayload | |
7 | ]; | |
8 | export type BroadcastChannelResponse = [string, BroadcastChannelResponsePayload]; | |
89b7a234 JB |
9 | |
10 | export 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_TRANSACTION = 'startTransaction', |
16 | STOP_TRANSACTION = 'stopTransaction', | |
17 | START_AUTOMATIC_TRANSACTION_GENERATOR = 'startAutomaticTransactionGenerator', | |
18 | STOP_AUTOMATIC_TRANSACTION_GENERATOR = 'stopAutomaticTransactionGenerator', | |
89b7a234 JB |
19 | } |
20 | ||
4eca248c | 21 | interface BaseBroadcastChannelRequestPayload extends Omit<RequestPayload, 'hashId' | 'hashIds'> { |
32de5a57 LM |
22 | connectorId?: number; |
23 | transactionId?: number; | |
24 | idTag?: string; | |
25 | } | |
89b7a234 | 26 | |
4eca248c JB |
27 | interface HashIdBroadcastChannelRequestPayload extends BaseBroadcastChannelRequestPayload { |
28 | hashId: string; | |
29 | } | |
30 | ||
31 | interface HashIdsBroadcastChannelRequestPayload extends BaseBroadcastChannelRequestPayload { | |
32 | hashIds: string[]; | |
33 | } | |
34 | ||
35 | export type BroadcastChannelRequestPayload = | |
36 | | HashIdBroadcastChannelRequestPayload | |
37 | | HashIdsBroadcastChannelRequestPayload; | |
38 | ||
b3b45e6c | 39 | export interface BroadcastChannelResponsePayload extends ResponsePayload { |
10d244c0 JB |
40 | hashId: string; |
41 | } | |
6c8f5d90 JB |
42 | |
43 | export type MessageEvent = { data: BroadcastChannelRequest | BroadcastChannelResponse }; |