First commit
This commit is contained in:
commit
9d69521b26
14 changed files with 3636 additions and 0 deletions
35
types/types.js
Normal file
35
types/types.js
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
declare type Map<K,V> = { [K]: V };
|
||||
|
||||
declare type Topic = {
|
||||
state: string,
|
||||
command: string,
|
||||
value: any,
|
||||
values: Map<string,any>,
|
||||
parseState?: (msg: Object) => any
|
||||
};
|
||||
declare type Topics = Map<string,Topic>;
|
||||
|
||||
declare type ControlUI = {
|
||||
type: "toggle",
|
||||
text: string,
|
||||
topic: string
|
||||
};
|
||||
|
||||
declare type Control = {
|
||||
name: string,
|
||||
position: Array<number>,
|
||||
icon: string,
|
||||
ui: Array<ControlUI>
|
||||
};
|
||||
declare type Controls = Map<string,Control>;
|
||||
|
||||
declare type Config = {
|
||||
topics: Topics,
|
||||
controls: Controls
|
||||
};
|
||||
|
||||
declare type State = {
|
||||
mqtt: ?any,
|
||||
ui: ?string,
|
||||
values: Map<string,any>
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue