JustinLove / elm-twitch-api / Twitch.Helix

Types and JSON Decoders for common Helix types

Most ids are numbers as strings; the library uses an aliased string with a custom name for documentation purposes, but treats the ids as opaque tokens.

Id aliases


type alias UserId =
String

User id

userId : Json.Decode.Decoder UserId

User id decoder


type alias ClipId =
String

Clip id Unlike most ids, these are not numbers but slugs witha couple of words.

clipId : Json.Decode.Decoder ClipId

Clip id decoder


type alias VideoId =
String

Video id

videoId : Json.Decode.Decoder VideoId

Video id decoder


type alias GameId =
String

Game id

gameId : Json.Decode.Decoder GameId

Game id decoder


type alias StreamId =
String

Stream id

streamId : Json.Decode.Decoder StreamId

Stream id decoder

Time decoders

timeStamp : Json.Decode.Decoder Time.Posix

Decode a timestamp value Twitch timestamps are ISO 8601 values, we decode them as Time.Posix

duration : Json.Decode.Decoder Basics.Int

Decode a duration value of the form 1h23m45s