| 1 | import { OCPP16AvailabilityType, OCPP16BootNotificationRequest, OCPP16IncomingRequestCommand, OCPP16RequestCommand } from './1.6/Requests'; |
| 2 | |
| 3 | import { MessageType } from './MessageType'; |
| 4 | import { OCPP16DiagnosticsStatus } from './1.6/DiagnosticsStatus'; |
| 5 | import OCPPError from '../../exception/OCPPError'; |
| 6 | |
| 7 | export interface SendParams { |
| 8 | skipBufferingOnError?: boolean, |
| 9 | triggerMessage?: boolean |
| 10 | } |
| 11 | |
| 12 | export type IncomingRequestHandler = (commandPayload: Record<string, unknown>) => Record<string, unknown> | Promise<Record<string, unknown>>; |
| 13 | |
| 14 | export type BootNotificationRequest = OCPP16BootNotificationRequest; |
| 15 | |
| 16 | export type AvailabilityType = OCPP16AvailabilityType; |
| 17 | |
| 18 | export const AvailabilityType = { |
| 19 | ...OCPP16AvailabilityType |
| 20 | }; |
| 21 | |
| 22 | export type RequestCommand = OCPP16RequestCommand; |
| 23 | |
| 24 | export const RequestCommand = { |
| 25 | ...OCPP16RequestCommand |
| 26 | }; |
| 27 | |
| 28 | export type IncomingRequestCommand = OCPP16IncomingRequestCommand; |
| 29 | |
| 30 | export const IncomingRequestCommand = { |
| 31 | ...OCPP16IncomingRequestCommand |
| 32 | }; |
| 33 | |
| 34 | export type DiagnosticsStatus = OCPP16DiagnosticsStatus; |
| 35 | |
| 36 | export const DiagnosticsStatus = { |
| 37 | ...OCPP16DiagnosticsStatus |
| 38 | }; |
| 39 | |
| 40 | export type Request = [MessageType, string, RequestCommand, Record<string, unknown>, Record<string, unknown>]; |
| 41 | |
| 42 | export type IncomingRequest = [MessageType, string, IncomingRequestCommand, Record<string, unknown>, Record<string, unknown>]; |
| 43 | |
| 44 | export type CachedRequest = [(payload: Record<string, unknown> | string, requestPayload: Record<string, unknown>) => void, (error: OCPPError, requestStatistic?: boolean) => void, RequestCommand | IncomingRequestCommand, Record<string, unknown>]; |