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.
47 lines
1.0 KiB
47 lines
1.0 KiB
import { Response as ResponseData } from "@common/sprinklers/requests"; |
|
|
|
export interface IError { |
|
type: "error"; |
|
message: string; |
|
data: any; |
|
} |
|
|
|
export interface IDeviceSubscribeResponse { |
|
type: "deviceSubscribeResponse"; |
|
deviceId: string; |
|
result: "success" | "noPermission"; |
|
} |
|
|
|
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 | IDeviceSubscribeResponse | IDeviceUpdate | IDeviceCallResponse | |
|
IBrokerConnectionUpdate; |
|
|
|
export interface IDeviceSubscribeRequest { |
|
type: "deviceSubscribeRequest"; |
|
deviceId: string; |
|
} |
|
|
|
export interface IDeviceCallRequest { |
|
type: "deviceCallRequest"; |
|
id: number; |
|
deviceId: string; |
|
data: any; |
|
} |
|
|
|
export type IClientMessage = IDeviceSubscribeRequest | IDeviceCallRequest;
|
|
|