X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Ftypes%2Focpp%2FResponses.ts;h=43250047ade5952a2d818aa7c8a0c97e5aa271b3;hb=cb886184464ed30ee14f538581e511710131b6ef;hp=db44800c4e0c9d44eb3db03eab6d746d14190a34;hpb=e3822d6f1b40477f7308ad70c290ed2c4106c585;p=e-mobility-charging-stations-simulator.git diff --git a/src/types/ocpp/Responses.ts b/src/types/ocpp/Responses.ts index db44800c..43250047 100644 --- a/src/types/ocpp/Responses.ts +++ b/src/types/ocpp/Responses.ts @@ -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,19 +13,17 @@ import { OCPP16TriggerMessageStatus, OCPP16UnlockStatus, } from './1.6/Responses'; +import type { ErrorType } from './ErrorType'; +import type { MessageType } from './MessageType'; -import { ErrorType } from './ErrorType'; -import { JsonObject } from '../JsonType'; -import { MessageType } from './MessageType'; -import { OCPP16MeterValuesResponse } from './1.6/MeterValues'; +export type Response = [MessageType.CALL_RESULT_MESSAGE, string, JsonType]; -export type Response = [MessageType.CALL_RESULT_MESSAGE, string, JsonObject]; - -export type ErrorResponse = [MessageType.CALL_ERROR_MESSAGE, string, ErrorType, string, JsonObject]; +export type ErrorResponse = [MessageType.CALL_ERROR_MESSAGE, string, ErrorType, string, JsonType]; export type ResponseHandler = ( - payload: JsonObject, - requestPayload?: JsonObject + chargingStation: ChargingStation, + payload: JsonType, + requestPayload?: JsonType ) => void | Promise; export type BootNotificationResponse = OCPP16BootNotificationResponse;