packages feed

ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/DeviceMotionEventRotationRate.hs

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from orientation-event (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.DeviceMotionEventRotationRate
       (js_getAlpha, js_getBeta, js_getGamma, getAlpha, getAlphaUnsafe, getAlphaUnchecked, getBeta, getBetaUnsafe, getBetaUnchecked, getGamma, getGammaUnsafe, getGammaUnchecked, DeviceMotionEventRotationRate(..), gTypeDeviceMotionEventRotationRate)
       where
import Prelude ((.), (==), (>>=), (<$>), (++), Bool(..), Maybe(..), IO, Int, Word, Double, Float)
import qualified Prelude as P
import Control.Monad (void)
import GHCJS.Types (JSVal, JSString)
import GHCJS.Foreign (jsUndefined, jsNull)
import GHCJS.DOM.Types
import qualified GHCJS.DOM.Types as Types
import GHCJS.DOM.EventTargetClosures (EventName, unsafeEventName, unsafeEventNameAsync)
import GHCJS.DOM.JSFFI.Generated.Enums

foreign import javascript unsafe "(($1) => { return $1[\"alpha\"]; })"
        js_getAlpha :: DeviceMotionEventRotationRate -> IO JSVal
-- | <https://developer.mozilla.org/docs/Web/API/DeviceMotionEventRotationRate/alpha MDN DeviceMotionEventRotationRate.alpha documentation>
getAlpha :: (MonadDOM m) => DeviceMotionEventRotationRate -> m (Maybe Double)
getAlpha self = liftDOM (((js_getAlpha (self)) >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/DeviceMotionEventRotationRate/alpha MDN DeviceMotionEventRotationRate.alpha documentation>
getAlphaUnsafe :: (MonadDOM m, HasCallStack) => DeviceMotionEventRotationRate -> m Double
getAlphaUnsafe self = liftDOM ((((js_getAlpha (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://developer.mozilla.org/docs/Web/API/DeviceMotionEventRotationRate/alpha MDN DeviceMotionEventRotationRate.alpha documentation>
getAlphaUnchecked :: (MonadDOM m) => DeviceMotionEventRotationRate -> m Double
getAlphaUnchecked self = liftDOM ((pFromJSVal <$> (js_getAlpha (self))))

foreign import javascript unsafe "(($1) => { return $1[\"beta\"]; })"
        js_getBeta :: DeviceMotionEventRotationRate -> IO JSVal
-- | <https://developer.mozilla.org/docs/Web/API/DeviceMotionEventRotationRate/beta MDN DeviceMotionEventRotationRate.beta documentation>
getBeta :: (MonadDOM m) => DeviceMotionEventRotationRate -> m (Maybe Double)
getBeta self = liftDOM (((js_getBeta (self)) >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/DeviceMotionEventRotationRate/beta MDN DeviceMotionEventRotationRate.beta documentation>
getBetaUnsafe :: (MonadDOM m, HasCallStack) => DeviceMotionEventRotationRate -> m Double
getBetaUnsafe self = liftDOM ((((js_getBeta (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://developer.mozilla.org/docs/Web/API/DeviceMotionEventRotationRate/beta MDN DeviceMotionEventRotationRate.beta documentation>
getBetaUnchecked :: (MonadDOM m) => DeviceMotionEventRotationRate -> m Double
getBetaUnchecked self = liftDOM ((pFromJSVal <$> (js_getBeta (self))))

foreign import javascript unsafe "(($1) => { return $1[\"gamma\"]; })"
        js_getGamma :: DeviceMotionEventRotationRate -> IO JSVal
-- | <https://developer.mozilla.org/docs/Web/API/DeviceMotionEventRotationRate/gamma MDN DeviceMotionEventRotationRate.gamma documentation>
getGamma :: (MonadDOM m) => DeviceMotionEventRotationRate -> m (Maybe Double)
getGamma self = liftDOM (((js_getGamma (self)) >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/DeviceMotionEventRotationRate/gamma MDN DeviceMotionEventRotationRate.gamma documentation>
getGammaUnsafe :: (MonadDOM m, HasCallStack) => DeviceMotionEventRotationRate -> m Double
getGammaUnsafe self = liftDOM ((((js_getGamma (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://developer.mozilla.org/docs/Web/API/DeviceMotionEventRotationRate/gamma MDN DeviceMotionEventRotationRate.gamma documentation>
getGammaUnchecked :: (MonadDOM m) => DeviceMotionEventRotationRate -> m Double
getGammaUnchecked self = liftDOM ((pFromJSVal <$> (js_getGamma (self))))