Use the fixed JsonType definition where appropriate
[e-mobility-charging-stations-simulator.git] / src / types / ocpp / Responses.ts
index 50f1d2b134f9b71867ac7eb02b92ae4b11fac827..baefc637ba389df281b8136323137b6312891451 100644 (file)
@@ -4,20 +4,35 @@ import {
   OCPP16ChargingProfileStatus,
   OCPP16ClearChargingProfileStatus,
   OCPP16ConfigurationStatus,
+  OCPP16HeartbeatResponse,
   OCPP16RegistrationStatus,
+  OCPP16StatusNotificationResponse,
   OCPP16TriggerMessageStatus,
   OCPP16UnlockStatus,
 } from './1.6/Responses';
 
+import { ErrorType } from './ErrorType';
 import { JsonType } from '../JsonType';
+import { MessageType } from './MessageType';
+import { OCPP16MeterValuesResponse } from './1.6/MeterValues';
+
+export type Response = [MessageType.CALL_RESULT_MESSAGE, string, JsonType];
+
+export type ErrorResponse = [MessageType.CALL_ERROR_MESSAGE, string, ErrorType, string, JsonType];
 
 export type ResponseHandler = (
-  payload: JsonType | string,
+  payload: JsonType,
   requestPayload?: JsonType
 ) => void | Promise<void>;
 
 export type BootNotificationResponse = OCPP16BootNotificationResponse;
 
+export type HeartbeatResponse = OCPP16HeartbeatResponse;
+
+export type StatusNotificationResponse = OCPP16StatusNotificationResponse;
+
+export type MeterValuesResponse = OCPP16MeterValuesResponse;
+
 export enum DefaultStatus {
   ACCEPTED = 'Accepted',
   REJECTED = 'Rejected',