1module Theme exposing (..)
2
3import Html exposing (Html)
4import Json.Decode as Decode
5import Json.Encode as Encode
6import Material.Icons.Types exposing (Icon)
7
8
9type alias Id =
10 { id : String }
11
12
13type alias Theme msg model =
14 { id : String
15 , title : String
16 , icon : Icon msg
17 , view : model -> Html msg
18 }
19
20
21idDecoder : Decode.Decoder Id
22idDecoder =
23 Decode.map (\s -> { id = s }) Decode.string
24
25
26encodeId : Id -> Encode.Value
27encodeId { id } =
28 Encode.string id