mirror of
https://github.com/BrianHicks/elm-duet.git
synced 2024-09-19 09:28:05 +03:00
regenerate examples
This commit is contained in:
parent
7d69db1f7b
commit
7bb12c8e5b
15
README.md
15
README.md
@ -102,6 +102,11 @@ flagsDecoder =
|
||||
Decode.map Flags
|
||||
(Decode.field "currentJwt" (Decode.nullable Decode.string))
|
||||
|
||||
|
||||
encodeFlags : Flags -> Encode.Value
|
||||
encodeFlags flags =
|
||||
{- TODO -}
|
||||
|
||||
```
|
||||
|
||||
And these for the ports:
|
||||
@ -122,6 +127,11 @@ logoutDecoder =
|
||||
Decode.null ()
|
||||
|
||||
|
||||
encodeLogout : Logout -> Encode.Value
|
||||
encodeLogout logout =
|
||||
{- TODO -}
|
||||
|
||||
|
||||
type alias NewJwt =
|
||||
String
|
||||
|
||||
@ -130,6 +140,11 @@ newJwtDecoder : Decoder NewJwt
|
||||
newJwtDecoder =
|
||||
Decode.string
|
||||
|
||||
|
||||
encodeNewJwt : NewJwt -> Encode.Value
|
||||
encodeNewJwt newJwt =
|
||||
{- TODO -}
|
||||
|
||||
```
|
||||
|
||||
Here's the full help to give you an idea of what you can do with the tool:
|
||||
|
@ -13,3 +13,8 @@ flagsDecoder : Decoder Flags
|
||||
flagsDecoder =
|
||||
Decode.map Flags
|
||||
(Decode.field "currentJwt" (Decode.nullable Decode.string))
|
||||
|
||||
|
||||
encodeFlags : Flags -> Encode.Value
|
||||
encodeFlags flags =
|
||||
{- TODO -}
|
||||
|
@ -13,6 +13,11 @@ logoutDecoder =
|
||||
Decode.null ()
|
||||
|
||||
|
||||
encodeLogout : Logout -> Encode.Value
|
||||
encodeLogout logout =
|
||||
{- TODO -}
|
||||
|
||||
|
||||
type alias NewJwt =
|
||||
String
|
||||
|
||||
@ -20,3 +25,8 @@ type alias NewJwt =
|
||||
newJwtDecoder : Decoder NewJwt
|
||||
newJwtDecoder =
|
||||
Decode.string
|
||||
|
||||
|
||||
encodeNewJwt : NewJwt -> Encode.Value
|
||||
encodeNewJwt newJwt =
|
||||
{- TODO -}
|
||||
|
@ -29,6 +29,19 @@ notificationPermissionDecoder =
|
||||
Decode.string
|
||||
|
||||
|
||||
encodeNotificationPermission : NotificationPermission -> Encode.Value
|
||||
encodeNotificationPermission notificationPermission =
|
||||
case notificationPermission of
|
||||
Default ->
|
||||
Encode.string "default"
|
||||
|
||||
Denied ->
|
||||
Encode.string "denied"
|
||||
|
||||
Granted ->
|
||||
Encode.string "granted"
|
||||
|
||||
|
||||
type alias Flags =
|
||||
{ currentTimeMillis : Float
|
||||
, notificationPermission : NotificationPermission
|
||||
@ -40,3 +53,8 @@ flagsDecoder =
|
||||
Decode.map2 Flags
|
||||
(Decode.field "currentTimeMillis" Decode.float)
|
||||
(Decode.field "notificationPermission" notificationPermissionDecoder)
|
||||
|
||||
|
||||
encodeFlags : Flags -> Encode.Value
|
||||
encodeFlags flags =
|
||||
{- TODO -}
|
||||
|
@ -15,6 +15,11 @@ addNewPingAtDecoder =
|
||||
(Decode.field "value" Decode.float)
|
||||
|
||||
|
||||
encodeAddNewPingAt : AddNewPingAt -> Encode.Value
|
||||
encodeAddNewPingAt addNewPingAt =
|
||||
{- TODO -}
|
||||
|
||||
|
||||
type alias SetMinutesPerPing =
|
||||
{ value : Float
|
||||
}
|
||||
@ -26,6 +31,11 @@ setMinutesPerPingDecoder =
|
||||
(Decode.field "value" Decode.float)
|
||||
|
||||
|
||||
encodeSetMinutesPerPing : SetMinutesPerPing -> Encode.Value
|
||||
encodeSetMinutesPerPing setMinutesPerPing =
|
||||
{- TODO -}
|
||||
|
||||
|
||||
type alias SetTagForPing =
|
||||
{ index : Float
|
||||
, value : Maybe String
|
||||
@ -39,6 +49,11 @@ setTagForPingDecoder =
|
||||
(Decode.field "value" (Decode.nullable Decode.string))
|
||||
|
||||
|
||||
encodeSetTagForPing : SetTagForPing -> Encode.Value
|
||||
encodeSetTagForPing setTagForPing =
|
||||
{- TODO -}
|
||||
|
||||
|
||||
type ChangeDocument
|
||||
= AddNewPingAt AddNewPingAt
|
||||
| SetMinutesPerPing SetMinutesPerPing
|
||||
@ -64,6 +79,19 @@ changeDocumentDecoder =
|
||||
(Decode.field "tag" Decode.string)
|
||||
|
||||
|
||||
encodeChangeDocument : ChangeDocument -> Encode.Value
|
||||
encodeChangeDocument changeDocument =
|
||||
case changeDocument of
|
||||
AddNewPingAt addNewPingAt ->
|
||||
{- TODO -}
|
||||
|
||||
SetMinutesPerPing setMinutesPerPing ->
|
||||
{- TODO -}
|
||||
|
||||
SetTagForPing setTagForPing ->
|
||||
{- TODO -}
|
||||
|
||||
|
||||
type alias PingV1 =
|
||||
{ custom : Dict String String
|
||||
, tag : Maybe String
|
||||
@ -79,6 +107,11 @@ pingV1Decoder =
|
||||
(Decode.field "time" Decode.int)
|
||||
|
||||
|
||||
encodePingV1 : PingV1 -> Encode.Value
|
||||
encodePingV1 pingV1 =
|
||||
{- TODO -}
|
||||
|
||||
|
||||
type PingsElements
|
||||
= PingV1 PingV1
|
||||
|
||||
@ -96,6 +129,13 @@ pingsElementsDecoder =
|
||||
(Decode.field "version" Decode.string)
|
||||
|
||||
|
||||
encodePingsElements : PingsElements -> Encode.Value
|
||||
encodePingsElements pingsElements =
|
||||
case pingsElements of
|
||||
PingV1 pingV1 ->
|
||||
{- TODO -}
|
||||
|
||||
|
||||
type alias SettingsV1 =
|
||||
{ minutesPerPing : Int
|
||||
}
|
||||
@ -107,6 +147,11 @@ settingsV1Decoder =
|
||||
(Decode.field "minutesPerPing" Decode.int)
|
||||
|
||||
|
||||
encodeSettingsV1 : SettingsV1 -> Encode.Value
|
||||
encodeSettingsV1 settingsV1 =
|
||||
{- TODO -}
|
||||
|
||||
|
||||
type Settings
|
||||
= SettingsV1 SettingsV1
|
||||
|
||||
@ -124,6 +169,13 @@ settingsDecoder =
|
||||
(Decode.field "version" Decode.string)
|
||||
|
||||
|
||||
encodeSettings : Settings -> Encode.Value
|
||||
encodeSettings settings =
|
||||
case settings of
|
||||
SettingsV1 settingsV1 ->
|
||||
{- TODO -}
|
||||
|
||||
|
||||
type alias DocV1 =
|
||||
{ pings : List PingsElements
|
||||
, settings : Settings
|
||||
@ -137,6 +189,11 @@ docV1Decoder =
|
||||
(Decode.field "settings" settingsDecoder)
|
||||
|
||||
|
||||
encodeDocV1 : DocV1 -> Encode.Value
|
||||
encodeDocV1 docV1 =
|
||||
{- TODO -}
|
||||
|
||||
|
||||
type DocFromAutomerge
|
||||
= DocV1 DocV1
|
||||
|
||||
@ -154,6 +211,13 @@ docFromAutomergeDecoder =
|
||||
(Decode.field "version" Decode.string)
|
||||
|
||||
|
||||
encodeDocFromAutomerge : DocFromAutomerge -> Encode.Value
|
||||
encodeDocFromAutomerge docFromAutomerge =
|
||||
case docFromAutomerge of
|
||||
DocV1 docV1 ->
|
||||
{- TODO -}
|
||||
|
||||
|
||||
type NotificationPermission
|
||||
= Default
|
||||
| Denied
|
||||
@ -179,6 +243,19 @@ notificationPermissionDecoder =
|
||||
Decode.string
|
||||
|
||||
|
||||
encodeNotificationPermission : NotificationPermission -> Encode.Value
|
||||
encodeNotificationPermission notificationPermission =
|
||||
case notificationPermission of
|
||||
Default ->
|
||||
Encode.string "default"
|
||||
|
||||
Denied ->
|
||||
Encode.string "denied"
|
||||
|
||||
Granted ->
|
||||
Encode.string "granted"
|
||||
|
||||
|
||||
type alias RequestNotificationPermission =
|
||||
()
|
||||
|
||||
@ -188,6 +265,11 @@ requestNotificationPermissionDecoder =
|
||||
Decode.null ()
|
||||
|
||||
|
||||
encodeRequestNotificationPermission : RequestNotificationPermission -> Encode.Value
|
||||
encodeRequestNotificationPermission requestNotificationPermission =
|
||||
{- TODO -}
|
||||
|
||||
|
||||
type alias NotificationOptions =
|
||||
{ badge : Maybe String
|
||||
, body : Maybe String
|
||||
@ -211,6 +293,11 @@ notificationOptionsDecoder =
|
||||
(Decode.field "tag" (Decode.nullable Decode.string))
|
||||
|
||||
|
||||
encodeNotificationOptions : NotificationOptions -> Encode.Value
|
||||
encodeNotificationOptions notificationOptions =
|
||||
{- TODO -}
|
||||
|
||||
|
||||
type alias SendNotification =
|
||||
{ options : NotificationOptions
|
||||
, title : String
|
||||
@ -222,3 +309,8 @@ sendNotificationDecoder =
|
||||
Decode.map2 SendNotification
|
||||
(Decode.field "options" notificationOptionsDecoder)
|
||||
(Decode.field "title" Decode.string)
|
||||
|
||||
|
||||
encodeSendNotification : SendNotification -> Encode.Value
|
||||
encodeSendNotification sendNotification =
|
||||
{- TODO -}
|
||||
|
Loading…
Reference in New Issue
Block a user