You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

42 lines
963 B

import { Response as ResponseData } from "@common/sprinklers/requests";
export interface IError {
type: "error";
message: string;
data: any;
}
export interface IDeviceUpdate {
type: "deviceUpdate";
deviceId: string;
data: any;
}
export interface IDeviceCallResponse {
type: "deviceCallResponse";
id: number;
data: ResponseData;
}
export interface IBrokerConnectionUpdate {
type: "brokerConnectionUpdate";
brokerConnected: boolean;
}
export type IServerMessage = IError | IDeviceUpdate | IDeviceCallResponse | IBrokerConnectionUpdate;
export type SubscriptionType = "deviceUpdate" | "brokerConnectionUpdate";
export interface IDeviceSubscribeRequest {
type: "deviceSubscribeRequest";
deviceId: string;
}
export interface IDeviceCallRequest {
type: "deviceCallRequest";
id: number;
deviceId: string;
data: any;
}
export type IClientMessage = IDeviceSubscribeRequest | IDeviceCallRequest;