86838d221c636b6f98f59860f1c42b0ae552e2d7
[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 type Request = [(payload?: Record<string, unknown>, requestPayload?: Record<string, unknown>) => void, (error?: OCPPError) => void, Record<string, unknown>];
27
28 export type IncomingRequest = [MessageType, string, IncomingRequestCommand, Record<string, unknown>, Record<string, unknown>];