packages feed

jsaddle-dom-0.10.0.0: src/JSDOM/Generated/DOMRectReadOnly.hs

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from geometry-1 (webref). Do not edit.
module JSDOM.Generated.DOMRectReadOnly
       (newDOMRectReadOnly, toJSON, toJSON_, fromRect, fromRect_, getX, getY, getWidth, getHeight, getTop, getRight, getBottom, getLeft, DOMRectReadOnly(..), gTypeDOMRectReadOnly, IsDOMRectReadOnly, toDOMRectReadOnly)
       where
import Prelude ((.), (==), (>>=), (<$>), (++), Bool(..), Maybe(..), IO, Int, Word, Double, Float)
import qualified Prelude as P
import Control.Monad (void)
import Control.Lens.Operators ((^.))
import Language.Javascript.JSaddle (JSM, JSVal, JSString, toJSVal, valToBool, valToNumber, js, jss, jsf, jsg, new, function, asyncFunction, jsUndefined, jsNull)
import JSDOM.Types
import qualified JSDOM.Types as Types
import JSDOM.EventTargetClosures (EventName, unsafeEventName, unsafeEventNameAsync)
import JSDOM.Generated.Enums

-- | <https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/DOMRectReadOnly MDN DOMRectReadOnly. documentation>
newDOMRectReadOnly :: (MonadDOM m) => Maybe Double -> Maybe Double -> Maybe Double -> Maybe Double -> m DOMRectReadOnly
newDOMRectReadOnly x y width height = liftDOM (((new (jsg "DOMRectReadOnly") [P.maybe (P.return jsUndefined) toJSVal x, P.maybe (P.return jsUndefined) toJSVal y, P.maybe (P.return jsUndefined) toJSVal width, P.maybe (P.return jsUndefined) toJSVal height]) >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/toJSON MDN DOMRectReadOnly.toJSON documentation>
toJSON :: (MonadDOM m, IsDOMRectReadOnly self) => self -> m GObject
toJSON self = liftDOM ((((Types.toDOMRectReadOnly self) ^. jsf "toJSON" ()) >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/toJSON MDN DOMRectReadOnly.toJSON documentation>
toJSON_ :: (MonadDOM m, IsDOMRectReadOnly self) => self -> m ()
toJSON_ self = liftDOM (void ((Types.toDOMRectReadOnly self) ^. jsf "toJSON" ()))

-- | <https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/fromRect_static MDN DOMRectReadOnly.fromRect documentation>
fromRect :: (MonadDOM m) => Maybe DOMRectInit -> m DOMRectReadOnly
fromRect other = liftDOM ((((jsg "DOMRectReadOnly") ^. jsf "fromRect" [P.maybe (P.return jsUndefined) toJSVal other]) >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/fromRect_static MDN DOMRectReadOnly.fromRect documentation>
fromRect_ :: (MonadDOM m) => Maybe DOMRectInit -> m ()
fromRect_ other = liftDOM (void ((jsg "DOMRectReadOnly") ^. jsf "fromRect" [P.maybe (P.return jsUndefined) toJSVal other]))

-- | <https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/x MDN DOMRectReadOnly.x documentation>
getX :: (MonadDOM m, IsDOMRectReadOnly self) => self -> m Double
getX self = liftDOM ((((Types.toDOMRectReadOnly self) ^. js "x") >>= valToNumber))

-- | <https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/y MDN DOMRectReadOnly.y documentation>
getY :: (MonadDOM m, IsDOMRectReadOnly self) => self -> m Double
getY self = liftDOM ((((Types.toDOMRectReadOnly self) ^. js "y") >>= valToNumber))

-- | <https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/width MDN DOMRectReadOnly.width documentation>
getWidth :: (MonadDOM m, IsDOMRectReadOnly self) => self -> m Double
getWidth self = liftDOM ((((Types.toDOMRectReadOnly self) ^. js "width") >>= valToNumber))

-- | <https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/height MDN DOMRectReadOnly.height documentation>
getHeight :: (MonadDOM m, IsDOMRectReadOnly self) => self -> m Double
getHeight self = liftDOM ((((Types.toDOMRectReadOnly self) ^. js "height") >>= valToNumber))

-- | <https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/top MDN DOMRectReadOnly.top documentation>
getTop :: (MonadDOM m, IsDOMRectReadOnly self) => self -> m Double
getTop self = liftDOM ((((Types.toDOMRectReadOnly self) ^. js "top") >>= valToNumber))

-- | <https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/right MDN DOMRectReadOnly.right documentation>
getRight :: (MonadDOM m, IsDOMRectReadOnly self) => self -> m Double
getRight self = liftDOM ((((Types.toDOMRectReadOnly self) ^. js "right") >>= valToNumber))

-- | <https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/bottom MDN DOMRectReadOnly.bottom documentation>
getBottom :: (MonadDOM m, IsDOMRectReadOnly self) => self -> m Double
getBottom self = liftDOM ((((Types.toDOMRectReadOnly self) ^. js "bottom") >>= valToNumber))

-- | <https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/left MDN DOMRectReadOnly.left documentation>
getLeft :: (MonadDOM m, IsDOMRectReadOnly self) => self -> m Double
getLeft self = liftDOM ((((Types.toDOMRectReadOnly self) ^. js "left") >>= valToNumber))