UNPKG

typed-ocpp

Version:

A library for type-aware parsing, serialization and validation of OCPP 1.6, OCPP 2.0 and OCPP 2.1 messages

27 lines (26 loc) 1.99 kB
import type { ChargingRateUnit, ChargingProfilePurpose, ChargingLimits } from '../utils.js'; import type { ChargingContext, ChargingSchedule, MaybeChargingSchedule } from './utils.js'; import type { Models } from '../models.js'; export interface WrappedProfile<ProfileType> { profile: ProfileType; stackLevel: number; /** * This maps to `connectorId` when using OCPP 1.6 and to `evseId` when using * OCPP 2.0 or OCPP 2.1. */ chargerId: number; } export declare abstract class AbstractChargingManager<SetChargingProfileType, ClearChargingProfileRequestType> { #private; constructor(); getDefaultLimits: (fromDate: Date, toDate: Date, chargerId: number) => ChargingLimits; protected abstract _getScheduleFromProfile(context: ChargingContext, profile: SetChargingProfileType, fromDate: Date, endDate: Date, unit: ChargingRateUnit): MaybeChargingSchedule; abstract setChargingProfile(profile: SetChargingProfileType): void; abstract clearChargingProfile(request: ClearChargingProfileRequestType): void; protected _setChargingProfile(purpose: ChargingProfilePurpose | 'ChargePointMaxProfile', chargerId: number, stackLevel: number, profile: SetChargingProfileType): void; protected _clearChargingProfiles(purpose: ChargingProfilePurpose | 'ChargePointMaxProfile' | undefined, chargerId: number | undefined, stackLevel: number | undefined): void; getStationSchedule(fromDate: Date, toDate: Date, unit: ChargingRateUnit, model: Models.ChargingStation): ChargingSchedule; protected _getChargerSchedule(fromDate: Date, toDate: Date, chargerId: number, unit: ChargingRateUnit, model: Models.ChargingSession, priority?: boolean): ChargingSchedule; getStationLimitsAtDate(atDate: Date, unit: ChargingRateUnit, model: Models.ChargingStation): ChargingLimits; protected _getChargerLimitsAtDate(atDate: Date, chargerId: number, unit: ChargingRateUnit, model: Models.ChargingSession, priority?: boolean): ChargingLimits; }