First sketch of layers

This commit is contained in:
uwap 2017-10-27 16:43:17 +02:00
parent d1dd22eb5d
commit 412d95f07a
8 changed files with 62 additions and 13 deletions

View file

@ -41,7 +41,8 @@ declare type Controls = Map<string,Control>;
declare type Config = {
topics: Topics,
controls: Controls
controls: Controls,
layers: Array<Layer>
};
declare type State = {
@ -53,10 +54,17 @@ declare type State = {
// topic, for example given by:
// values: { off: "OFF", on: "ON" }
// and actual is the value of that or whatever is given by mqtt.
values: Map<string, { internal: ?string, actual: any }>
values: Map<string, { internal: ?string, actual: any }>,
visibleLayers: Array<string>
};
declare type Layer = {
image: string,
name: string,
forceVisibility?: "on"|"off"
};
declare type StateAction = {
type: "DISCONNECT" | "CONNECT" | "MESSAGE" | "UI_POPUP",
payload?: any
}
};