Strict boolean check in src/charging-station/UIServiceWorkerBroadcastChannel.ts
[e-mobility-charging-stations-simulator.git] / src / types / ocpp / Responses.ts
index d7e6db554f68456e79aac01709f4366b6bbaeb64..c57510ae7eaf04ebb71d9c407e9a9007b574a9c3 100644 (file)
@@ -1,3 +1,6 @@
+import type ChargingStation from '../../charging-station/ChargingStation';
+import type { JsonType } from '../JsonType';
+import type { OCPP16MeterValuesResponse } from './1.6/MeterValues';
 import {
   OCPP16AvailabilityStatus,
   OCPP16BootNotificationResponse,
@@ -10,12 +13,16 @@ import {
   OCPP16TriggerMessageStatus,
   OCPP16UnlockStatus,
 } from './1.6/Responses';
+import type { ErrorType } from './ErrorType';
+import type { MessageType } from './MessageType';
 
-import { JsonType } from '../JsonType';
-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,
+  chargingStation: ChargingStation,
+  payload: JsonType,
   requestPayload?: JsonType
 ) => void | Promise<void>;
 
@@ -32,9 +39,9 @@ export enum DefaultStatus {
   REJECTED = 'Rejected',
 }
 
-export interface DefaultResponse {
+export type DefaultResponse = {
   status: DefaultStatus;
-}
+};
 
 export type RegistrationStatus = OCPP16RegistrationStatus;