import { StateMachine } from "@zwave-js/core"; export interface SerialAPICommand { expectsAck(): boolean; expectsResponse(): boolean; expectsCallback(): boolean; } export type SerialAPICommandState = { value: "initial"; } | { value: "sending"; } | { value: "waitingForACK"; } | { value: "waitingForResponse"; } | { value: "waitingForCallback"; responseTimedOut?: boolean; } | { value: "success"; result?: T; done: true; } | ({ value: "failure"; } & SerialAPICommandMachineFailure); export type SerialAPICommandMachineFailure = { reason: "ACK timeout"; result?: undefined; } | { reason: "CAN"; result?: undefined; } | { reason: "NAK"; result?: undefined; } | { reason: "response timeout"; result?: undefined; } | { reason: "callback timeout"; result?: undefined; } | { reason: "response NOK"; result: T; } | { reason: "callback NOK"; result: T; }; export type SerialAPICommandMachineInput = { value: "start"; } | { value: "message sent"; } | { value: "ACK"; } | { value: "CAN"; } | { value: "NAK"; } | { value: "timeout"; } | { value: "response" | "response NOK"; response: T; } | { value: "callback" | "callback NOK"; callback: T; }; export type SerialAPICommandMachine = StateMachine, SerialAPICommandMachineInput>; export declare function createSerialAPICommandMachine(message: T): SerialAPICommandMachine; //# sourceMappingURL=SerialAPICommandMachine.d.ts.map