From: Jérôme Benoit Date: Sat, 24 Sep 2022 22:08:47 +0000 (+0200) Subject: Refine type definitions X-Git-Tag: v1.1.74~19 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=284900bc037b44fa562795ccc47b3837a25bbb13;p=e-mobility-charging-stations-simulator.git Refine type definitions Signed-off-by: Jérôme Benoit --- diff --git a/src/types/JsonType.ts b/src/types/JsonType.ts index 5b6c9f6f..256f0f42 100644 --- a/src/types/JsonType.ts +++ b/src/types/JsonType.ts @@ -1,7 +1,7 @@ type JsonPrimitive = string | number | boolean | Date | null; export type JsonObject = { - [key in string]: JsonType; + [key in string]?: JsonType; }; export type JsonType = JsonPrimitive | JsonType[] | JsonObject; diff --git a/src/ui/web/src/types/ChargingStationType.ts b/src/ui/web/src/types/ChargingStationType.ts index 292cd1e1..a3f9931c 100644 --- a/src/ui/web/src/types/ChargingStationType.ts +++ b/src/ui/web/src/types/ChargingStationType.ts @@ -121,10 +121,10 @@ export interface OCPP16BootNotificationResponse extends JsonObject { interval: number; } -export interface CommandsSupport { +type CommandsSupport = { incomingCommands: Record; outgoingCommands?: Record; -} +}; export enum OCPPVersion { VERSION_16 = '1.6',