import type { Driver } from "../driver/Driver" ; import { FunctionType , MessagePriority , MessageType , } from "../message/Constants" ; import { expectedResponse , Message , MessageBaseOptions , MessageDeserializationOptions , messageTypes , priority , } from "../message/Message" ; export interface IsFailedNodeRequestOptions extends MessageBaseOptions { failedNodeId : number ; } @ messageTypes ( MessageType . Request , FunctionType . IsFailedNode ) @ expectedResponse ( FunctionType . IsFailedNode ) @ priority ( MessagePriority . Controller ) export class IsFailedNodeRequest extends Message { public constructor ( driver , options ) { super ( driver , options ) ; this . failedNodeId = options . failedNodeId ; } public failedNodeId : number ; public serialize ( ) { this . payload = Buffer . from ( [ this . failedNodeId ] ) ; return super . serialize ( ) ; } } @ messageTypes ( MessageType . Response , FunctionType . IsFailedNode ) export class IsFailedNodeResponse extends Message { public constructor ( driver , options ) { super ( driver , options ) ; this . result = ! ! this . payload [ 0 ] ; } public readonly result : boolean ; }