From: Jérôme Benoit Date: Sat, 18 Sep 2021 12:28:34 +0000 (+0200) Subject: Simplify Connectors type definition X-Git-Tag: v1.1.4~4 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=2d7040b2cd9d96dceb0160a5afe7dca5c727b890;p=e-mobility-charging-stations-simulator.git Simplify Connectors type definition Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index ff7ce6cd..26036540 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -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'; diff --git a/src/types/ChargingStationTemplate.ts b/src/types/ChargingStationTemplate.ts index 5b91d0d2..6ecc9ec9 100644 --- a/src/types/ChargingStationTemplate.ts +++ b/src/types/ChargingStationTemplate.ts @@ -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'; diff --git a/src/types/Connectors.ts b/src/types/Connectors.ts index 36ba5231..ad669c87 100644 --- a/src/types/Connectors.ts +++ b/src/types/Connectors.ts @@ -25,6 +25,4 @@ export interface Connector { chargingProfiles?: ChargingProfile[]; } -export default interface Connectors { - [id: string]: Connector; -} +export type Connectors = Record;