shamansir / tron-gui / Tron.Tree.Expose.Data

The types which are used to communicate b/w Tron and ports (and so JS and WebSockets and dat.gui).

See Option.Communication module for the usage.

Packages for ports


type alias Ack =
{ client : ClientId
, tree : Tree 
}

Acknowledge package, which lets the server know the current Client ID and the initial tree structure.


type alias In =
{ path : List ( Tron.Path.Index
, Tron.Path.Label )
, value : Json.Encode.Value
, type_ : String 
}

The JSON-friendly structure of updates which is received from the incoming ports by Tron.


type alias Out =
{ client : ClientId
, update : Value 
}

The JSON-friendly structure of updates which is sent to the outgoing ports from Tron.


type alias DeduceIn =
{ path : List ( Tron.Path.Index
, Tron.Path.Label )
, value : Json.Encode.Value 
}

The JSON-friendly structure of updates which is received from the incoming ports by Tron. This one is intended to be deduced, so that the type of the value will be deduced from the current tree condition.


type alias Tree =
Json.Encode.Value

The GUI Tree converted to a JSON value.

Helpers


type alias ClientId =
Json.Encode.Value

Client ID as a JSON value


type alias Value =
{ path : List ( Tron.Path.Index
, Tron.Path.Label )
, value : Json.Encode.Value
, stringValue : String
, type_ : String 
}

The JSON-friendly representation of any value.

No-value

nothingGoesIn : In

noAck : Ack

nothingGoesOut : Out