{-# LANGUAGE PatternSynonyms #-}
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module JSDOM.Generated.Rect
       (getTop, getRight, getBottom, getLeft, Rect(..), gTypeRect) 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

-- | <https://developer.mozilla.org/en-US/docs/Web/API/Rect.top Mozilla Rect.top documentation> 
getTop :: (MonadDOM m) => Rect -> m CSSPrimitiveValue
getTop :: Rect -> m CSSPrimitiveValue
getTop Rect
self = DOM CSSPrimitiveValue -> m CSSPrimitiveValue
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM ((Rect
self Rect -> Getting (JSM JSVal) Rect (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. [Char] -> IndexPreservingGetter Rect (JSM JSVal)
forall s name.
(MakeObject s, ToJSString name) =>
name -> IndexPreservingGetter s (JSM JSVal)
js [Char]
"top") JSM JSVal
-> (JSVal -> DOM CSSPrimitiveValue) -> DOM CSSPrimitiveValue
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> DOM CSSPrimitiveValue
forall a. FromJSVal a => JSVal -> JSM a
fromJSValUnchecked)

-- | <https://developer.mozilla.org/en-US/docs/Web/API/Rect.right Mozilla Rect.right documentation> 
getRight :: (MonadDOM m) => Rect -> m CSSPrimitiveValue
getRight :: Rect -> m CSSPrimitiveValue
getRight Rect
self
  = DOM CSSPrimitiveValue -> m CSSPrimitiveValue
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM ((Rect
self Rect -> Getting (JSM JSVal) Rect (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. [Char] -> IndexPreservingGetter Rect (JSM JSVal)
forall s name.
(MakeObject s, ToJSString name) =>
name -> IndexPreservingGetter s (JSM JSVal)
js [Char]
"right") JSM JSVal
-> (JSVal -> DOM CSSPrimitiveValue) -> DOM CSSPrimitiveValue
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> DOM CSSPrimitiveValue
forall a. FromJSVal a => JSVal -> JSM a
fromJSValUnchecked)

-- | <https://developer.mozilla.org/en-US/docs/Web/API/Rect.bottom Mozilla Rect.bottom documentation> 
getBottom :: (MonadDOM m) => Rect -> m CSSPrimitiveValue
getBottom :: Rect -> m CSSPrimitiveValue
getBottom Rect
self
  = DOM CSSPrimitiveValue -> m CSSPrimitiveValue
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM ((Rect
self Rect -> Getting (JSM JSVal) Rect (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. [Char] -> IndexPreservingGetter Rect (JSM JSVal)
forall s name.
(MakeObject s, ToJSString name) =>
name -> IndexPreservingGetter s (JSM JSVal)
js [Char]
"bottom") JSM JSVal
-> (JSVal -> DOM CSSPrimitiveValue) -> DOM CSSPrimitiveValue
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> DOM CSSPrimitiveValue
forall a. FromJSVal a => JSVal -> JSM a
fromJSValUnchecked)

-- | <https://developer.mozilla.org/en-US/docs/Web/API/Rect.left Mozilla Rect.left documentation> 
getLeft :: (MonadDOM m) => Rect -> m CSSPrimitiveValue
getLeft :: Rect -> m CSSPrimitiveValue
getLeft Rect
self = DOM CSSPrimitiveValue -> m CSSPrimitiveValue
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM ((Rect
self Rect -> Getting (JSM JSVal) Rect (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. [Char] -> IndexPreservingGetter Rect (JSM JSVal)
forall s name.
(MakeObject s, ToJSString name) =>
name -> IndexPreservingGetter s (JSM JSVal)
js [Char]
"left") JSM JSVal
-> (JSVal -> DOM CSSPrimitiveValue) -> DOM CSSPrimitiveValue
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> DOM CSSPrimitiveValue
forall a. FromJSVal a => JSVal -> JSM a
fromJSValUnchecked)