X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Ftypes%2Focpp%2FRequests.ts;h=aeb6828c7c97cd1e9e1bcff8ebcf3c480a45f5de;hb=7e1dc8784bef178de6438ae9af2bece427809cde;hp=486436196285289a336e6b6929d3a5eb0279d987;hpb=af99a73f2968dea5c3feae8a82f32f491d2fd141;p=e-mobility-charging-stations-simulator.git diff --git a/src/types/ocpp/Requests.ts b/src/types/ocpp/Requests.ts index 48643619..aeb6828c 100644 --- a/src/types/ocpp/Requests.ts +++ b/src/types/ocpp/Requests.ts @@ -1,4 +1,5 @@ -import { IncomingRequestCommand } from './1.6/Requests'; +import { OCPP16AvailabilityType, OCPP16BootNotificationRequest, OCPP16IncomingRequestCommand, OCPP16RequestCommand } from './1.6/Requests'; + import { MessageType } from './MessageType'; import OCPPError from '../../charging-station/OcppError'; @@ -6,6 +7,26 @@ export default interface Requests { [id: string]: Request; } -export type Request = [(payload?, requestPayload?) => void, (error?: OCPPError) => void, Record]; +export type BootNotificationRequest = OCPP16BootNotificationRequest; + +export type AvailabilityType = OCPP16AvailabilityType; + +export const AvailabilityType = { + ...OCPP16AvailabilityType +}; + +export type RequestCommand = OCPP16RequestCommand; + +export const RequestCommand = { + ...OCPP16RequestCommand +}; + +export type IncomingRequestCommand = OCPP16IncomingRequestCommand; + +export const IncomingRequestCommand = { + ...OCPP16IncomingRequestCommand +}; + +export type Request = [(payload: Record | string, requestPayload: Record) => void, (error: OCPPError) => void, Record]; -export type IncomingRequest = [MessageType, string, IncomingRequestCommand, string, string]; +export type IncomingRequest = [MessageType, string, IncomingRequestCommand, Record, Record];