miso-1.8.5.0: A tasty Haskell front-end web framework

Copyright(C) 2016-2018 David M. Johnson
LicenseBSD3-style (see the file LICENSE)
MaintainerDavid M. Johnson <djohnson.m@gmail.com>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Miso.Event.Decoder

Contents

Description

 
Synopsis

Decoder

data Decoder a Source #

Decoder data type for parsing events

Constructors

Decoder 

Fields

data DecodeTarget Source #

Data type representing path (consisting of field names) within event object, where a decoder should be applied.

Constructors

DecodeTarget [MisoString]

Specify single path within Event object, where a decoder should be applied.

DecodeTargets [[MisoString]]

Specify multiple paths withing Event object, where decoding should be attempted. The first path where decoding suceeds is the one taken.

at :: [MisoString] -> (Value -> Parser a) -> Decoder a Source #

Smart constructor for building a Decoder.

Decoders

emptyDecoder :: Decoder () Source #

Empty decoder for use with events like "click" that do not return any meaningful values

keycodeDecoder :: Decoder KeyCode Source #

Retrieves either "keyCode", "which" or "charCode" field in Decoder

keyInfoDecoder :: Decoder KeyInfo Source #

Retrieves either "keyCode", "which" or "charCode" field in Decoder, along with shift, ctrl, meta and alt.

checkedDecoder :: Decoder Checked Source #

Retrieves "checked" field in Decoder

valueDecoder :: Decoder MisoString Source #

Retrieves "value" field in Decoder