Simplify Connectors type definition
authorJérôme Benoit <jerome.benoit@sap.com>
Sat, 18 Sep 2021 12:28:34 +0000 (14:28 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Sat, 18 Sep 2021 12:28:34 +0000 (14:28 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ChargingStation.ts
src/types/ChargingStationTemplate.ts
src/types/Connectors.ts

index ff7ce6cd31a4bf12edece490175abc44f497226d..260365400f77e32b5f81d817de1bc0327576913f 100644 (file)
@@ -4,8 +4,8 @@ import { AvailabilityType, BootNotificationRequest, IncomingRequest, IncomingReq
 import { BootNotificationResponse, RegistrationStatus } from '../types/ocpp/Responses';
 import ChargingStationConfiguration, { ConfigurationKey } from '../types/ChargingStationConfiguration';
 import ChargingStationTemplate, { CurrentType, PowerUnits, Voltage } from '../types/ChargingStationTemplate';
+import { Connector, Connectors, SampledValueTemplate } from '../types/Connectors';
 import { ConnectorPhaseRotation, StandardParametersKey, SupportedFeatureProfiles } from '../types/ocpp/Configuration';
-import Connectors, { Connector, SampledValueTemplate } from '../types/Connectors';
 import { MeterValueMeasurand, MeterValuePhase } from '../types/ocpp/MeterValues';
 import { WSError, WebSocketCloseEventStatusCode } from '../types/WebSocket';
 import WebSocket, { ClientOptions, Data, OPEN } from 'ws';
index 5b91d0d2dafcfe30de829e30bb950cfa33dc6cd4..6ecc9ec971e294ae0f6858cc88515ea0a780bbad 100644 (file)
@@ -1,5 +1,5 @@
 import ChargingStationConfiguration from './ChargingStationConfiguration';
-import Connectors from './Connectors';
+import { Connectors } from './Connectors';
 import { OCPPProtocol } from './ocpp/OCPPProtocol';
 import { OCPPVersion } from './ocpp/OCPPVersion';
 
index 36ba52313d5b18dbb6d0d09b079375cd89bc1336..ad669c8715000d0d1253cad04111dd7ad236ca21 100644 (file)
@@ -25,6 +25,4 @@ export interface Connector {
   chargingProfiles?: ChargingProfile[];
 }
 
-export default interface Connectors {
-  [id: string]: Connector;
-}
+export type Connectors = Record<string, Connector>;