aboutsummaryrefslogtreecommitdiff
path: root/src/client/Init.elm
blob: d87e870cc4dcd6e54fb4042fab232083d41a3b6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
module Init exposing
  ( Init
  , decoder
  )

import Time exposing (..)

import Json.Decode as Decode exposing (Decoder)

import Model.Translations exposing (..)
import Model.Conf exposing (..)
import Model.InitResult exposing (..)
import Model.Size exposing (..)

type alias Init =
  { time : Time
  , translations : Translations
  , conf : Conf
  , result : InitResult
  , windowSize : Size
  }

decoder : Decoder Init
decoder =
  Decode.map5 Init
    (Decode.field "time" Decode.float)
    (Decode.field "translations" translationsDecoder)
    (Decode.field "conf" confDecoder)
    (Decode.field "result" initResultDecoder)
    (Decode.field "windowSize" sizeDecoder)