Use the fixed JsonType definition where appropriate
[e-mobility-charging-stations-simulator.git] / src / types / ocpp / Requests.ts
index 60724254c8a61390bcee73787bfc4facdaa8514f..16a79c05d2cf74365cd09f2e102af269cfe08b0a 100644 (file)
@@ -7,33 +7,26 @@ import {
   OCPP16StatusNotificationRequest,
 } from './1.6/Requests';
 
-import { JsonObject } from '../JsonType';
+import { JsonType } from '../JsonType';
 import { MessageType } from './MessageType';
 import { OCPP16DiagnosticsStatus } from './1.6/DiagnosticsStatus';
 import { OCPP16MeterValuesRequest } from './1.6/MeterValues';
 import OCPPError from '../../exception/OCPPError';
 
-export type OutgoingRequest = [MessageType.CALL_MESSAGE, string, RequestCommand, JsonObject];
+export type OutgoingRequest = [MessageType.CALL_MESSAGE, string, RequestCommand, JsonType];
 
-export type IncomingRequest = [
-  MessageType.CALL_MESSAGE,
-  string,
-  IncomingRequestCommand,
-  JsonObject
-];
+export type IncomingRequest = [MessageType.CALL_MESSAGE, string, IncomingRequestCommand, JsonType];
 
 export type CachedRequest = [
-  (payload: JsonObject, requestPayload: JsonObject) => void,
+  (payload: JsonType, requestPayload: JsonType) => void,
   (error: OCPPError, requestStatistic?: boolean) => void,
   RequestCommand | IncomingRequestCommand,
-  JsonObject
+  JsonType
 ];
 
-export type IncomingRequestHandler = (
-  commandPayload: JsonObject
-) => JsonObject | Promise<JsonObject>;
+export type IncomingRequestHandler = (commandPayload: JsonType) => JsonType | Promise<JsonType>;
 
-export type ResponseType = JsonObject | OCPPError;
+export type ResponseType = JsonType | OCPPError;
 
 export interface RequestParams {
   skipBufferingOnError?: boolean;