import { ErrorType } from '../../types/ocpp/ErrorType';
import { MessageType } from '../../types/ocpp/MessageType';
import {
- ErrorCallback,
- IncomingRequestCommand,
- OutgoingRequest,
+ type ErrorCallback,
+ type IncomingRequestCommand,
+ type OutgoingRequest,
RequestCommand,
- RequestParams,
- ResponseCallback,
- ResponseType,
+ type RequestParams,
+ type ResponseCallback,
+ type ResponseType,
} from '../../types/ocpp/Requests';
import type { ErrorResponse, Response } from '../../types/ocpp/Responses';
import Constants from '../../utils/Constants';
// Check if wsConnection opened
if (chargingStation.isWebSocketConnectionOpened() === true) {
// Yes: Send Message
- const beginId = PerformanceStatistics.beginMeasure(commandName);
+ const beginId = PerformanceStatistics.beginMeasure(commandName as string);
// FIXME: Handle sending error
chargingStation.wsConnection.send(messageToSend);
- PerformanceStatistics.endMeasure(commandName, beginId);
+ PerformanceStatistics.endMeasure(commandName as string, beginId);
logger.debug(
`${chargingStation.logPrefix()} >> Command '${commandName}' sent ${this.getMessageTypeString(
messageType
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
- public abstract requestHandler<RequestType extends JsonType, ResponseType extends JsonType>(
+ public abstract requestHandler<ReqType extends JsonType, ResType extends JsonType>(
chargingStation: ChargingStation,
commandName: RequestCommand,
commandParams?: JsonType,
params?: RequestParams
- ): Promise<ResponseType>;
+ ): Promise<ResType>;
}