{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module JSDOM.Generated.DataCue
(newDataCue, newDataCue', setData, getData, setValue, getValue,
getType, DataCue(..), gTypeDataCue)
where
import Prelude ((.), (==), (>>=), return, IO, Int, Float, Double, Bool(..), Maybe, maybe, fromIntegral, round, realToFrac, fmap, Show, Read, Eq, Ord, Maybe(..))
import qualified Prelude (error)
import Data.Typeable (Typeable)
import Data.Traversable (mapM)
import Language.Javascript.JSaddle (JSM(..), JSVal(..), JSString, strictEqual, toJSVal, valToStr, valToNumber, valToBool, js, jss, jsf, jsg, function, asyncFunction, new, array, jsUndefined, (!), (!!))
import Data.Int (Int64)
import Data.Word (Word, Word64)
import JSDOM.Types
import Control.Applicative ((<$>))
import Control.Monad (void)
import Control.Lens.Operators ((^.))
import JSDOM.EventTargetClosures (EventName, unsafeEventName, unsafeEventNameAsync)
import JSDOM.Enums
newDataCue ::
(MonadDOM m, IsArrayBuffer data') =>
Double -> Double -> data' -> m DataCue
newDataCue startTime endTime data'
= liftDOM
(DataCue <$>
new (jsg "DataCue")
[toJSVal startTime, toJSVal endTime, toJSVal data'])
newDataCue' ::
(MonadDOM m, ToJSVal value, ToJSString type') =>
Double -> Double -> value -> Maybe type' -> m DataCue
newDataCue' startTime endTime value type'
= liftDOM
(DataCue <$>
new (jsg "DataCue")
[toJSVal startTime, toJSVal endTime, toJSVal value, toJSVal type'])
setData ::
(MonadDOM m, IsArrayBuffer val) => DataCue -> val -> m ()
setData self val = liftDOM (self ^. jss "data" (toJSVal val))
getData :: (MonadDOM m) => DataCue -> m ArrayBuffer
getData self = liftDOM ((self ^. js "data") >>= fromJSValUnchecked)
setValue :: (MonadDOM m, ToJSVal val) => DataCue -> val -> m ()
setValue self val = liftDOM (self ^. jss "value" (toJSVal val))
getValue :: (MonadDOM m) => DataCue -> m JSVal
getValue self = liftDOM ((self ^. js "value") >>= toJSVal)
getType :: (MonadDOM m, FromJSString result) => DataCue -> m result
getType self = liftDOM ((self ^. js "type") >>= fromJSValUnchecked)