{-# LANGUAGE PatternSynonyms #-} -- For HasCallStack compatibility {-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} module JSDOM.Generated.DOMPointReadOnly (newDOMPointReadOnly, newDOMPointReadOnly', fromPoint, fromPoint_, getX, getY, getZ, getW, DOMPointReadOnly(..), gTypeDOMPointReadOnly, IsDOMPointReadOnly, toDOMPointReadOnly) 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) import JSDOM.Enums -- | newDOMPointReadOnly :: (MonadDOM m) => DOMPointInit -> m DOMPointReadOnly newDOMPointReadOnly point = liftDOM (DOMPointReadOnly <$> new (jsg "DOMPointReadOnly") [toJSVal point]) -- | newDOMPointReadOnly' :: (MonadDOM m) => Maybe Double -> Maybe Double -> Maybe Double -> Maybe Double -> m DOMPointReadOnly newDOMPointReadOnly' x y z w = liftDOM (DOMPointReadOnly <$> new (jsg "DOMPointReadOnly") [toJSVal x, toJSVal y, toJSVal z, toJSVal w]) -- | fromPoint :: (MonadDOM m, IsDOMPointReadOnly self) => self -> Maybe DOMPointInit -> m DOMPointReadOnly fromPoint self other = liftDOM (((toDOMPointReadOnly self) ^. jsf "fromPoint" [toJSVal other]) >>= fromJSValUnchecked) -- | fromPoint_ :: (MonadDOM m, IsDOMPointReadOnly self) => self -> Maybe DOMPointInit -> m () fromPoint_ self other = liftDOM (void ((toDOMPointReadOnly self) ^. jsf "fromPoint" [toJSVal other])) -- | getX :: (MonadDOM m, IsDOMPointReadOnly self) => self -> m Double getX self = liftDOM (((toDOMPointReadOnly self) ^. js "x") >>= valToNumber) -- | getY :: (MonadDOM m, IsDOMPointReadOnly self) => self -> m Double getY self = liftDOM (((toDOMPointReadOnly self) ^. js "y") >>= valToNumber) -- | getZ :: (MonadDOM m, IsDOMPointReadOnly self) => self -> m Double getZ self = liftDOM (((toDOMPointReadOnly self) ^. js "z") >>= valToNumber) -- | getW :: (MonadDOM m, IsDOMPointReadOnly self) => self -> m Double getW self = liftDOM (((toDOMPointReadOnly self) ^. js "w") >>= valToNumber)