{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module JSDOM.Generated.DOMRectReadOnly
(newDOMRectReadOnly, fromRect, fromRect_, getX, getY, getWidth,
getHeight, getTop, getRight, getBottom, getLeft,
DOMRectReadOnly(..), gTypeDOMRectReadOnly, IsDOMRectReadOnly,
toDOMRectReadOnly)
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
newDOMRectReadOnly ::
(MonadDOM m) =>
Maybe Double ->
Maybe Double -> Maybe Double -> Maybe Double -> m DOMRectReadOnly
newDOMRectReadOnly x y width height
= liftDOM
(DOMRectReadOnly <$>
new (jsg "DOMRectReadOnly")
[toJSVal x, toJSVal y, toJSVal width, toJSVal height])
fromRect :: (MonadDOM m) => Maybe DOMRectInit -> m DOMRectReadOnly
fromRect other
= liftDOM
(((jsg "DOMRectReadOnly") ^. jsf "fromRect" [toJSVal other]) >>=
fromJSValUnchecked)
fromRect_ :: (MonadDOM m) => Maybe DOMRectInit -> m ()
fromRect_ other
= liftDOM
(void ((jsg "DOMRectReadOnly") ^. jsf "fromRect" [toJSVal other]))
getX :: (MonadDOM m, IsDOMRectReadOnly self) => self -> m Double
getX self
= liftDOM (((toDOMRectReadOnly self) ^. js "x") >>= valToNumber)
getY :: (MonadDOM m, IsDOMRectReadOnly self) => self -> m Double
getY self
= liftDOM (((toDOMRectReadOnly self) ^. js "y") >>= valToNumber)
getWidth ::
(MonadDOM m, IsDOMRectReadOnly self) => self -> m Double
getWidth self
= liftDOM
(((toDOMRectReadOnly self) ^. js "width") >>= valToNumber)
getHeight ::
(MonadDOM m, IsDOMRectReadOnly self) => self -> m Double
getHeight self
= liftDOM
(((toDOMRectReadOnly self) ^. js "height") >>= valToNumber)
getTop :: (MonadDOM m, IsDOMRectReadOnly self) => self -> m Double
getTop self
= liftDOM (((toDOMRectReadOnly self) ^. js "top") >>= valToNumber)
getRight ::
(MonadDOM m, IsDOMRectReadOnly self) => self -> m Double
getRight self
= liftDOM
(((toDOMRectReadOnly self) ^. js "right") >>= valToNumber)
getBottom ::
(MonadDOM m, IsDOMRectReadOnly self) => self -> m Double
getBottom self
= liftDOM
(((toDOMRectReadOnly self) ^. js "bottom") >>= valToNumber)
getLeft :: (MonadDOM m, IsDOMRectReadOnly self) => self -> m Double
getLeft self
= liftDOM (((toDOMRectReadOnly self) ^. js "left") >>= valToNumber)