UNPKG

@citrineos/data

Version:

The OCPP data module which includes all persistence layer implementation.

46 lines (45 loc) 2.41 kB
import { LocationEnum, MeasurandEnum, OCPP2_0_1, PhaseEnum, ReadingContextEnum, type MeterValueDto, type SampledValue } from '@citrineos/base'; export declare class MeterValueMapper { /** * Converts native ReadingContextEnum to OCPP 2.0.1 ReadingContextEnumType */ static toReadingContextEnumType(context?: keyof typeof ReadingContextEnum | null): OCPP2_0_1.ReadingContextEnumType | undefined; /** * Converts OCPP 2.0.1 ReadingContextEnumType to native ReadingContextEnum */ static fromReadingContextEnumType(context?: OCPP2_0_1.ReadingContextEnumType | null): keyof typeof ReadingContextEnum | undefined; /** * Converts native MeasurandEnum to OCPP 2.0.1 MeasurandEnumType */ static toMeasurandEnumType(measurand?: keyof typeof MeasurandEnum | null): OCPP2_0_1.MeasurandEnumType | undefined; /** * Converts OCPP 2.0.1 MeasurandEnumType to native MeasurandEnum */ static fromMeasurandEnumType(measurand?: OCPP2_0_1.MeasurandEnumType | null): keyof typeof MeasurandEnum | undefined; /** * Converts native LocationEnum to OCPP 2.0.1 LocationEnumType */ static toLocationEnumType(location?: keyof typeof LocationEnum | null): OCPP2_0_1.LocationEnumType | undefined; /** * Converts OCPP 2.0.1 LocationEnumType to native LocationEnum */ static fromLocationEnumType(location?: OCPP2_0_1.LocationEnumType | null): keyof typeof LocationEnum | undefined; /** * Converts native PhaseEnum to OCPP 2.0.1 PhaseEnumType */ static toPhaseEnumType(phase?: keyof typeof PhaseEnum | null): OCPP2_0_1.PhaseEnumType | undefined; /** * Converts OCPP 2.0.1 PhaseEnumType to native PhaseEnum */ static fromPhaseEnumType(phase?: OCPP2_0_1.PhaseEnumType | null): keyof typeof PhaseEnum | undefined; static toMeterValueType(meterValue: MeterValueDto): OCPP2_0_1.MeterValueType; static toSampledValueTypes(sampledValues: SampledValue[]): [OCPP2_0_1.SampledValueType, ...OCPP2_0_1.SampledValueType[]]; /** * Converts OCPP2_0_1.SampledValueType[] back to SampledValue[] */ static fromSampledValueTypes(sampledValueTypes: OCPP2_0_1.SampledValueType[]): [SampledValue, ...SampledValue[]]; /** * Converts OCPP2_0_1.MeterValueType back to a partial MeterValue structure */ static fromMeterValueType(meterValueType: OCPP2_0_1.MeterValueType): MeterValueDto; }