import Ajv, { type JSONSchemaType } from 'ajv';
import ajvFormats from 'ajv-formats';
-import { OCPPServiceUtils } from './internal';
+import { OCPPServiceUtils } from './OCPPServiceUtils';
import type { ChargingStation } from '../../charging-station';
import { OCPPError } from '../../exception';
import type {
OCPPVersion,
RequestCommand,
} from '../../types';
-import { logger } from '../../utils/Logger';
+import { logger } from '../../utils';
const moduleName = 'OCPPResponseService';
multipleOfPrecision: 2,
});
ajvFormats(this.ajv);
- this.responseHandler.bind(this);
- this.validateResponsePayload.bind(this);
+ this.responseHandler = this.responseHandler.bind(this) as (
+ chargingStation: ChargingStation,
+ commandName: RequestCommand,
+ payload: JsonType,
+ requestPayload: JsonType
+ ) => Promise<void>;
+ this.validateResponsePayload = this.validateResponsePayload.bind(this) as <T extends JsonType>(
+ chargingStation: ChargingStation,
+ commandName: RequestCommand,
+ schema: JSONSchemaType<T>,
+ payload: T
+ ) => boolean;
}
public static getInstance<T extends OCPPResponseService>(this: new () => T): T {