From 284900bc037b44fa562795ccc47b3837a25bbb13 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 25 Sep 2022 00:08:47 +0200 Subject: [PATCH] Refine type definitions MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/types/JsonType.ts | 2 +- src/ui/web/src/types/ChargingStationType.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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', -- 2.34.1