import type { AutomaticTransactionGeneratorConfiguration } from '../types/AutomaticTransactionGenerator';
import type ChargingStationConfiguration from '../types/ChargingStationConfiguration';
import type ChargingStationInfo from '../types/ChargingStationInfo';
-import type ChargingStationOcppConfiguration from '../types/ChargingStationOcppConfiguration';
+import type { ChargingStationOcppConfiguration } from '../types/ChargingStationOcppConfiguration';
import ChargingStationTemplate, {
CurrentType,
PowerUnits,
import OCPPError from '../../../exception/OCPPError';
import { CurrentType, Voltage } from '../../../types/ChargingStationTemplate';
-import type MeasurandPerPhaseSampledValueTemplates from '../../../types/MeasurandPerPhaseSampledValueTemplates';
-// eslint-disable-next-line no-duplicate-imports
-import type { SampledValueTemplate } from '../../../types/MeasurandPerPhaseSampledValueTemplates';
-import type MeasurandValues from '../../../types/MeasurandValues';
+import type {
+ MeasurandPerPhaseSampledValueTemplates,
+ SampledValueTemplate,
+} from '../../../types/MeasurandPerPhaseSampledValueTemplates';
+import type { MeasurandValues } from '../../../types/MeasurandValues';
import {
OCPP16StandardParametersKey,
OCPP16SupportedFeatureProfiles,
import type { ChargingStationInfoConfiguration } from './ChargingStationInfo';
-import type ChargingStationOcppConfiguration from './ChargingStationOcppConfiguration';
+import type { ChargingStationOcppConfiguration } from './ChargingStationOcppConfiguration';
export default interface ChargingStationConfiguration
extends ChargingStationInfoConfiguration,
maximumAmperage?: number; // Always in Ampere
}
-export interface ChargingStationInfoConfiguration {
+export type ChargingStationInfoConfiguration = {
stationInfo?: ChargingStationInfo;
-}
+};
reboot?: boolean;
}
-export default interface ChargingStationOcppConfiguration {
+export type ChargingStationOcppConfiguration = {
configurationKey?: ConfigurationKey[];
-}
+};
import type { ClientOptions } from 'ws';
import type { AutomaticTransactionGeneratorConfiguration } from './AutomaticTransactionGenerator';
-import type ChargingStationOcppConfiguration from './ChargingStationOcppConfiguration';
+import type { ChargingStationOcppConfiguration } from './ChargingStationOcppConfiguration';
import type { ConnectorStatus } from './ConnectorStatus';
import type { OCPPProtocol } from './ocpp/OCPPProtocol';
import type { OCPPVersion } from './ocpp/OCPPVersion';
export type WsOptions = ClientOptions & ClientRequestArgs;
-interface CommandsSupport {
+type CommandsSupport = {
incomingCommands: Record<IncomingRequestCommand, boolean>;
outgoingCommands?: Record<RequestCommand, boolean>;
-}
+};
export default interface ChargingStationTemplate {
templateHash?: string;
SEQUENTIAL = 'sequential',
}
-export interface StationTemplateUrl {
+export type StationTemplateUrl = {
file: string;
numberOfStations: number;
-}
+};
-export interface UIServerConfiguration {
+export type UIServerConfiguration = {
enabled?: boolean;
type?: ApplicationProtocol;
options?: ServerOptions;
username?: string;
password?: string;
};
-}
+};
-export interface StorageConfiguration {
+export type StorageConfiguration = {
enabled?: boolean;
type?: StorageType;
uri?: string;
-}
+};
-export interface WorkerConfiguration {
+export type WorkerConfiguration = {
processType?: WorkerProcessType;
startDelay?: number;
elementsPerWorker?: number;
poolMinSize?: number;
poolMaxSize?: number;
poolStrategy?: WorkerChoiceStrategy;
-}
+};
-export default interface ConfigurationData {
+export type ConfigurationData = {
supervisionUrls?: string | string[];
supervisionUrlDistribution?: SupervisionUrlDistribution;
stationTemplateUrls: StationTemplateUrl[];
logFile?: string;
logErrorFile?: string;
logConsole?: boolean;
-}
+};
import type { MeterValue } from './ocpp/MeterValues';
import type { AvailabilityType } from './ocpp/Requests';
-export interface ConnectorStatus {
+export type ConnectorStatus = {
availability: AvailabilityType;
bootStatus?: ChargePointStatus;
status?: ChargePointStatus;
transactionEnergyActiveImportRegisterValue?: number; // In Wh
transactionBeginMeterValue?: MeterValue;
chargingProfiles?: ChargingProfile[];
-}
+};
-export interface HandleErrorParams<T> {
+export type HandleErrorParams<T> = {
throwError?: boolean;
consoleOut?: boolean;
errorResponse?: T;
-}
+};
fluctuationPercent?: number;
}
-export default interface MeasurandPerPhaseSampledValueTemplates {
+export type MeasurandPerPhaseSampledValueTemplates = {
L1?: SampledValueTemplate;
L2?: SampledValueTemplate;
L3?: SampledValueTemplate;
-}
+};
-export default interface MeasurandValues {
+export type MeasurandValues = {
L1: number;
L2: number;
L3: number;
allPhases: number;
-}
+};
import type { CircularArray } from '../utils/CircularArray';
import type { WorkerData } from './Worker';
-export interface TimeSeries {
+export type TimeSeries = {
timestamp: number;
value: number;
-}
+};
-export interface StatisticsData {
+export type StatisticsData = {
countRequest: number;
countResponse: number;
countError: number;
medTimeMeasurement: number;
ninetyFiveThPercentileTimeMeasurement: number;
stdDevTimeMeasurement: number;
-}
+};
export default interface Statistics extends WorkerData {
id: string;
STATIC_POOL = 'staticPool',
}
-export interface WorkerOptions {
+export type WorkerOptions = {
workerStartDelay?: number;
elementStartDelay?: number;
poolMaxSize?: number;
elementsPerWorker?: number;
poolOptions?: PoolOptions<Worker>;
messageHandler?: (message: unknown) => void | Promise<void>;
-}
+};
export type WorkerData = Record<string, unknown>;
-export interface WorkerSetElement {
+export type WorkerSetElement = {
worker: Worker;
numberOfWorkerElements: number;
-}
+};
-export interface WorkerMessage<T extends WorkerData> {
+export type WorkerMessage<T extends WorkerData> = {
id: WorkerMessageEvents;
data: T;
-}
+};
export enum WorkerMessageEvents {
START_WORKER_ELEMENT = 'startWorkerElement',
export type OutgoingRequest = [MessageType.CALL_MESSAGE, string, RequestCommand, JsonType];
-export interface RequestParams {
+export type RequestParams = {
skipBufferingOnError?: boolean;
triggerMessage?: boolean;
-}
+};
export type IncomingRequestCommand = OCPP16IncomingRequestCommand;
REJECTED = 'Rejected',
}
-export interface DefaultResponse {
+export type DefaultResponse = {
status: DefaultStatus;
-}
+};
export type RegistrationStatus = OCPP16RegistrationStatus;
-export interface BaseConfig {
+export type BaseConfig = {
uiServer: UIServerConfig;
-}
+};
-interface UIServerConfig {
+type UIServerConfig = {
host: string;
port: number;
protocol: string;
username?: string;
password?: string;
-}
+};
import chalk from 'chalk';
-import ConfigurationData, {
- StationTemplateUrl,
- StorageConfiguration,
+import {
+ type ConfigurationData,
+ type StationTemplateUrl,
+ type StorageConfiguration,
SupervisionUrlDistribution,
- UIServerConfiguration,
- WorkerConfiguration,
+ type UIServerConfiguration,
+ type WorkerConfiguration,
} from '../types/ConfigurationData';
import type { EmptyObject } from '../types/EmptyObject';
import type { HandleErrorParams } from '../types/Error';