import { type SystemConfig, type HandlerProperties, MessageOrigin, type OcppRequest, type OcppResponse, type CallAction, type OCPPVersionType } from '@citrineos/types'; import { OcppError } from '../../ocpp/rpc/message.js'; import type { ICache } from '../cache/cache.js'; import type { IMessage } from '../messages/message.js'; import type { IMessageConfirmation } from '../messages/message-confirmation.js'; import type { IMessageHandler } from '../messages/message-handler.js'; import type { IMessageSender } from '../messages/message-sender.js'; import type { OCPPValidator } from './ocpp-validator.js'; /** * Base interface for all OCPP modules. * */ export interface IModule { config: SystemConfig; ocppValidator: OCPPValidator; cache: ICache; sender: IMessageSender; handler: IMessageHandler; sendCall(ocppConnectionName: string, tenantId: number, protocol: OCPPVersionType, action: CallAction, payload: OcppRequest, callbackUrl?: string, correlationId?: string, origin?: MessageOrigin): Promise; sendCallResult(correlationId: string, ocppConnectionName: string, tenantId: number, protocol: OCPPVersionType, action: CallAction, payload: OcppResponse, origin?: MessageOrigin): Promise; sendCallError(correlationId: string, ocppConnectionName: string, tenantId: number, protocol: OCPPVersionType, action: CallAction, error: OcppError, origin?: MessageOrigin): Promise; handle(message: IMessage, props?: HandlerProperties): Promise; shutdown(): Promise; }