Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tiziano88 committed Mar 12, 2017
1 parent c1df5e0 commit faced29
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion elm-package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.0.1",
"version": "2.0.0",
"summary": "Google Protocol Buffers runtime library",
"repository": "https://github.com/tiziano88/elm-protobuf.git",
"license": "MIT",
Expand Down
29 changes: 29 additions & 0 deletions src/Protobuf.elm
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ Buffer compiler](https://github.com/tiziano88/elm-protobuf).
@docs Timestamp, timestampDecoder, timestampEncoder
@docs intValueDecoder, intValueEncoder
@docs stringValueDecoder, stringValueEncoder
@docs boolValueDecoder, boolValueEncoder
@docs bytesValueDecoder, bytesValueEncoder
@docs floatValueDecoder, floatValueEncoder
-}

import Date
Expand Down Expand Up @@ -166,51 +175,71 @@ timestampEncoder v =
JE.string <| ISO8601.toString <| ISO8601.fromTime <| round <| Time.inMilliseconds <| Date.toTime <| v


{-| Decodes an IntValue.
-}
intValueDecoder : JD.Decoder Int
intValueDecoder =
JD.int


{-| Encodes an IntValue.
-}
intValueEncoder : Int -> JE.Value
intValueEncoder =
JE.int


{-| Decodes a StringValue.
-}
stringValueDecoder : JD.Decoder String
stringValueDecoder =
JD.string


{-| Encodes a StringValue.
-}
stringValueEncoder : String -> JE.Value
stringValueEncoder =
JE.string


{-| Encodes a BoolValue.
-}
boolValueDecoder : JD.Decoder Bool
boolValueDecoder =
JD.bool


{-| Encodes a BoolValue.
-}
boolValueEncoder : Bool -> JE.Value
boolValueEncoder =
JE.bool


{-| Decodes a BytesValue.
-}
bytesValueDecoder : JD.Decoder Bytes
bytesValueDecoder =
bytesFieldDecoder


{-| Encodes a BytesValue.
-}
bytesValueEncoder : Bytes -> JE.Value
bytesValueEncoder =
bytesFieldEncoder


{-| Decodes a FloatValue.
-}
floatValueDecoder : JD.Decoder Float
floatValueDecoder =
JD.float


{-| Encodes a FloatValue.
-}
floatValueEncoder : Float -> JE.Value
floatValueEncoder =
JE.float

0 comments on commit faced29

Please sign in to comment.