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', | |
13 | START_TRANSACTION = 'startTransaction', | |
14 | STOP_TRANSACTION = 'stopTransaction', | |
db2336d9 JB |
15 | OPEN_CONNECTION = 'openConnection', |
16 | CLOSE_CONNECTION = 'closeConnection', | |
89b7a234 JB |
17 | } |
18 | ||
4eca248c | 19 | interface BaseBroadcastChannelRequestPayload extends Omit<RequestPayload, 'hashId' | 'hashIds'> { |
32de5a57 LM |
20 | connectorId?: number; |
21 | transactionId?: number; | |
22 | idTag?: string; | |
23 | } | |
89b7a234 | 24 | |
4eca248c JB |
25 | interface HashIdBroadcastChannelRequestPayload extends BaseBroadcastChannelRequestPayload { |
26 | hashId: string; | |
27 | } | |
28 | ||
29 | interface HashIdsBroadcastChannelRequestPayload extends BaseBroadcastChannelRequestPayload { | |
30 | hashIds: string[]; | |
31 | } | |
32 | ||
33 | export type BroadcastChannelRequestPayload = | |
34 | | HashIdBroadcastChannelRequestPayload | |
35 | | HashIdsBroadcastChannelRequestPayload; | |
36 | ||
b3b45e6c | 37 | export interface BroadcastChannelResponsePayload extends ResponsePayload { |
10d244c0 JB |
38 | hashId: string; |
39 | } | |
6c8f5d90 JB |
40 | |
41 | export type MessageEvent = { data: BroadcastChannelRequest | BroadcastChannelResponse }; |