declare type Map = { [K]: V }; declare type Topic = { state: string, command: string, value: any, values: Map, parseState?: (msg: Object) => any }; declare type Topics = Map; declare type ControlUI = { type: "toggle" | "dropDown" | "slider", text: string, topic: string, enableCondition?: (val: any) => boolean, // TOGGLE optional properties on?: string, // on override for toggle off?: string, // off override for toggle toggled?: (val: any) => boolean, // DROPDOWN optional properties options?: Map, //options for dropDown // SLIDER optional properties min?: number, max?: number, step?: number }; declare type Control = { name: string, position: Array, icon: string, iconColor?: (state: Map) => string, ui: Array }; declare type Controls = Map; declare type Config = { topics: Topics, controls: Controls }; declare type State = { mqtt: ?any, ui: ?string, values: Map };