ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/IntersectionObserverEntry.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from intersection-observer (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.IntersectionObserverEntry
(js_newIntersectionObserverEntry, js_getTime, js_getRootBounds, js_getBoundingClientRect, js_getIntersectionRect, js_getIsIntersecting, js_getIntersectionRatio, js_getTarget, newIntersectionObserverEntry, getTime, getRootBounds, getRootBoundsUnsafe, getRootBoundsUnchecked, getBoundingClientRect, getIntersectionRect, getIsIntersecting, getIntersectionRatio, getTarget, IntersectionObserverEntry(..), gTypeIntersectionObserverEntry)
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 safe "(($1) => { return new globalThis[\"IntersectionObserverEntry\"]($1); })"
js_newIntersectionObserverEntry :: IntersectionObserverEntryInit -> IO IntersectionObserverEntry
-- | <https://developer.mozilla.org/docs/Web/API/IntersectionObserverEntry/IntersectionObserverEntry MDN IntersectionObserverEntry. documentation>
newIntersectionObserverEntry :: (MonadDOM m) => IntersectionObserverEntryInit -> m IntersectionObserverEntry
newIntersectionObserverEntry intersectionObserverEntryInit = liftDOM ((js_newIntersectionObserverEntry (intersectionObserverEntryInit)))
foreign import javascript unsafe "(($1) => { return $1[\"time\"]; })"
js_getTime :: IntersectionObserverEntry -> IO Double
-- | <https://developer.mozilla.org/docs/Web/API/IntersectionObserverEntry/time MDN IntersectionObserverEntry.time documentation>
getTime :: (MonadDOM m) => IntersectionObserverEntry -> m Double
getTime self = liftDOM ((js_getTime (self)))
foreign import javascript unsafe "(($1) => { return $1[\"rootBounds\"]; })"
js_getRootBounds :: IntersectionObserverEntry -> IO JSVal
-- | <https://developer.mozilla.org/docs/Web/API/IntersectionObserverEntry/rootBounds MDN IntersectionObserverEntry.rootBounds documentation>
getRootBounds :: (MonadDOM m) => IntersectionObserverEntry -> m (Maybe DOMRectReadOnly)
getRootBounds self = liftDOM (((js_getRootBounds (self)) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/IntersectionObserverEntry/rootBounds MDN IntersectionObserverEntry.rootBounds documentation>
getRootBoundsUnsafe :: (MonadDOM m, HasCallStack) => IntersectionObserverEntry -> m DOMRectReadOnly
getRootBoundsUnsafe self = liftDOM ((((js_getRootBounds (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://developer.mozilla.org/docs/Web/API/IntersectionObserverEntry/rootBounds MDN IntersectionObserverEntry.rootBounds documentation>
getRootBoundsUnchecked :: (MonadDOM m) => IntersectionObserverEntry -> m DOMRectReadOnly
getRootBoundsUnchecked self = liftDOM ((pFromJSVal <$> (js_getRootBounds (self))))
foreign import javascript unsafe "(($1) => { return $1[\"boundingClientRect\"]; })"
js_getBoundingClientRect :: IntersectionObserverEntry -> IO DOMRectReadOnly
-- | <https://developer.mozilla.org/docs/Web/API/IntersectionObserverEntry/boundingClientRect MDN IntersectionObserverEntry.boundingClientRect documentation>
getBoundingClientRect :: (MonadDOM m) => IntersectionObserverEntry -> m DOMRectReadOnly
getBoundingClientRect self = liftDOM ((js_getBoundingClientRect (self)))
foreign import javascript unsafe "(($1) => { return $1[\"intersectionRect\"]; })"
js_getIntersectionRect :: IntersectionObserverEntry -> IO DOMRectReadOnly
-- | <https://developer.mozilla.org/docs/Web/API/IntersectionObserverEntry/intersectionRect MDN IntersectionObserverEntry.intersectionRect documentation>
getIntersectionRect :: (MonadDOM m) => IntersectionObserverEntry -> m DOMRectReadOnly
getIntersectionRect self = liftDOM ((js_getIntersectionRect (self)))
foreign import javascript unsafe "(($1) => { return $1[\"isIntersecting\"]; })"
js_getIsIntersecting :: IntersectionObserverEntry -> IO Bool
-- | <https://developer.mozilla.org/docs/Web/API/IntersectionObserverEntry/isIntersecting MDN IntersectionObserverEntry.isIntersecting documentation>
getIsIntersecting :: (MonadDOM m) => IntersectionObserverEntry -> m Bool
getIsIntersecting self = liftDOM ((js_getIsIntersecting (self)))
foreign import javascript unsafe "(($1) => { return $1[\"intersectionRatio\"]; })"
js_getIntersectionRatio :: IntersectionObserverEntry -> IO Double
-- | <https://developer.mozilla.org/docs/Web/API/IntersectionObserverEntry/intersectionRatio MDN IntersectionObserverEntry.intersectionRatio documentation>
getIntersectionRatio :: (MonadDOM m) => IntersectionObserverEntry -> m Double
getIntersectionRatio self = liftDOM ((js_getIntersectionRatio (self)))
foreign import javascript unsafe "(($1) => { return $1[\"target\"]; })"
js_getTarget :: IntersectionObserverEntry -> IO Element
-- | <https://developer.mozilla.org/docs/Web/API/IntersectionObserverEntry/target MDN IntersectionObserverEntry.target documentation>
getTarget :: (MonadDOM m) => IntersectionObserverEntry -> m Element
getTarget self = liftDOM ((js_getTarget (self)))