import { Base64Message } from '../backend/src/Model/Base64Message' ; import { DataSourceState , MqttOptions } from '../backend/src/DataSource' ; import { UpdateInfo } from 'builder-util-runtime' ; export interface Event < MessageType > { topic : string ; } export interface AddMqttConnection { id : string ; options : MqttOptions ; } export const addMqttConnectionEvent = { topic : 'connection/add/mqtt' } ; export const removeConnection = { topic : 'connection/remove' } ; export function makeConnectionStateEvent ( connectionId ) { return { topic : `conn/state/${ connectionId }` } ; } export const updateAvailable = { topic : 'app/update/available' } ; export interface MqttMessage { topic : string ; payload : Base64Message | null ; qos : 0 | 1 | 2 ; retain : boolean ; messageId : number | undefined ; } export function makePublishEvent ( connectionId ) { return { topic : `conn/publish/${ connectionId }` } ; } export function makeConnectionMessageEvent ( connectionId ) { return { topic : `conn/${ connectionId }` } ; }