X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2FWorkerBroadcastChannel.ts;h=b19bf946dc633db77e5c690e75dd4b921de6868a;hb=853ed24a1ca05b0de603402228dd99e7c41fa397;hp=ea89dc3dbf65f093f0a0bbfacdfdb32aab3c5f62;hpb=852a4c5f07886502e278d44fda06efdfa8c711d8;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/WorkerBroadcastChannel.ts b/src/charging-station/WorkerBroadcastChannel.ts index ea89dc3d..b19bf946 100644 --- a/src/charging-station/WorkerBroadcastChannel.ts +++ b/src/charging-station/WorkerBroadcastChannel.ts @@ -1,7 +1,8 @@ import { BroadcastChannel } from 'worker_threads'; import BaseError from '../exception/BaseError'; -import { +import type { JsonType } from '../types/JsonType'; +import type { BroadcastChannelRequest, BroadcastChannelResponse, MessageEvent, @@ -20,11 +21,11 @@ export default abstract class WorkerBroadcastChannel extends BroadcastChannel { this.postMessage(response); } - protected isRequest(message: any): boolean { + protected isRequest(message: JsonType[]): boolean { return Array.isArray(message) && message.length === 3; } - protected isResponse(message: any): boolean { + protected isResponse(message: JsonType[]): boolean { return Array.isArray(message) && message.length === 2; }