26283cc91ea8e0391e5e5a3034d85728ebeb499c
[e-mobility-charging-stations-simulator.git] / src / types / ocpp / Requests.ts
1 import { OCPP16AvailabilityType, OCPP16BootNotificationRequest, OCPP16IncomingRequestCommand, OCPP16RequestCommand } from './1.6/Requests';
2
3 import { MessageType } from './MessageType';
4 import OCPPError from '../../charging-station/OcppError';
5
6 export default interface Requests {
7 [id: string]: Request;
8 }
9
10 export type BootNotificationRequest = OCPP16BootNotificationRequest;
11
12 export type AvailabilityType = OCPP16AvailabilityType;
13
14 export const AvailabilityType = {
15 ...OCPP16AvailabilityType
16 };
17
18 export type RequestCommand = OCPP16RequestCommand;
19
20 export const RequestCommand = {
21 ...OCPP16RequestCommand
22 };
23
24 export type IncomingRequestCommand = OCPP16IncomingRequestCommand;
25
26 export const IncomingRequestCommand = {
27 ...OCPP16IncomingRequestCommand
28 };
29
30 export type Request = [(payload: Record<string, unknown>, requestPayload: Record<string, unknown>) => void, (error: OCPPError) => void, Record<string, unknown>];
31
32 export type IncomingRequest = [MessageType, string, IncomingRequestCommand, Record<string, unknown>, Record<string, unknown>];