X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Ftypes%2FWorkerBroadcastChannel.ts;h=9d1133d0941d7dcc692797a8cb2528682b28ab8f;hb=4e3ff94d15f16cbeb7f65d14525bca7af3c551fd;hp=381f57e41b03e2f9d0bba89aeb3e09662b211729;hpb=1598b27c55255d49693d67950242661fefbe1d7d;p=e-mobility-charging-stations-simulator.git diff --git a/src/types/WorkerBroadcastChannel.ts b/src/types/WorkerBroadcastChannel.ts index 381f57e4..9d1133d0 100644 --- a/src/types/WorkerBroadcastChannel.ts +++ b/src/types/WorkerBroadcastChannel.ts @@ -1,7 +1,12 @@ import { JsonObject } from './JsonType'; +import { RequestPayload, ResponsePayload } from './UIProtocol'; -export type BroadcastChannelRequest = [string, BroadcastChannelProcedureName, RequestPayload]; -export type BroadcastChannelResponse = [string, ResponsePayload]; +export type BroadcastChannelRequest = [ + string, + BroadcastChannelProcedureName, + BroadcastChannelRequestPayload +]; +export type BroadcastChannelResponse = [string, BroadcastChannelResponsePayload]; export enum BroadcastChannelProcedureName { START_CHARGING_STATION = 'startChargingStation', @@ -10,14 +15,16 @@ export enum BroadcastChannelProcedureName { STOP_TRANSACTION = 'stopTransaction', } -interface BasePayload extends JsonObject { +interface BroadcastChannelBasePayload extends JsonObject { hashId: string; } -export interface RequestPayload extends BasePayload { +export interface BroadcastChannelRequestPayload + extends BroadcastChannelBasePayload, + Omit { connectorId?: number; transactionId?: number; idTag?: string; } -export type ResponsePayload = BasePayload; +export type BroadcastChannelResponsePayload = ResponsePayload;