packages feed

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

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from dom (webref). Do not edit.
module JSDOM.Generated.DocumentOrShadowRoot
       (getAnimations, getAnimations_, getCustomElementRegistry, getCustomElementRegistryUnsafe, getCustomElementRegistryUnchecked, getStyleSheets, setAdoptedStyleSheets, getAdoptedStyleSheets, getFullscreenElement, getFullscreenElementUnsafe, getFullscreenElementUnchecked, getActiveElement, getActiveElementUnsafe, getActiveElementUnchecked, getPictureInPictureElement, getPictureInPictureElementUnsafe, getPictureInPictureElementUnchecked, getPointerLockElement, getPointerLockElementUnsafe, getPointerLockElementUnchecked, DocumentOrShadowRoot(..), gTypeDocumentOrShadowRoot, IsDocumentOrShadowRoot, toDocumentOrShadowRoot)
       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/Document/getAnimations MDN DocumentOrShadowRoot.getAnimations documentation>
getAnimations :: (MonadDOM m, IsDocumentOrShadowRoot self) => self -> m [Animation]
getAnimations self = liftDOM ((((Types.toDocumentOrShadowRoot self) ^. jsf "getAnimations" ()) >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/Document/getAnimations MDN DocumentOrShadowRoot.getAnimations documentation>
getAnimations_ :: (MonadDOM m, IsDocumentOrShadowRoot self) => self -> m ()
getAnimations_ self = liftDOM (void ((Types.toDocumentOrShadowRoot self) ^. jsf "getAnimations" ()))

-- | <https://developer.mozilla.org/docs/Web/API/Document/customElementRegistry MDN DocumentOrShadowRoot.customElementRegistry documentation>
getCustomElementRegistry :: (MonadDOM m, IsDocumentOrShadowRoot self) => self -> m (Maybe CustomElementRegistry)
getCustomElementRegistry self = liftDOM ((((Types.toDocumentOrShadowRoot self) ^. js "customElementRegistry") >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/Document/customElementRegistry MDN DocumentOrShadowRoot.customElementRegistry documentation>
getCustomElementRegistryUnsafe :: (MonadDOM m, IsDocumentOrShadowRoot self, HasCallStack) => self -> m CustomElementRegistry
getCustomElementRegistryUnsafe self = liftDOM (((((Types.toDocumentOrShadowRoot self) ^. js "customElementRegistry") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://developer.mozilla.org/docs/Web/API/Document/customElementRegistry MDN DocumentOrShadowRoot.customElementRegistry documentation>
getCustomElementRegistryUnchecked :: (MonadDOM m, IsDocumentOrShadowRoot self) => self -> m CustomElementRegistry
getCustomElementRegistryUnchecked self = liftDOM ((((Types.toDocumentOrShadowRoot self) ^. js "customElementRegistry") >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/Document/styleSheets MDN DocumentOrShadowRoot.styleSheets documentation>
getStyleSheets :: (MonadDOM m, IsDocumentOrShadowRoot self) => self -> m StyleSheetList
getStyleSheets self = liftDOM ((((Types.toDocumentOrShadowRoot self) ^. js "styleSheets") >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/Document/adoptedStyleSheets MDN DocumentOrShadowRoot.adoptedStyleSheets documentation>
setAdoptedStyleSheets :: (MonadDOM m, IsDocumentOrShadowRoot self) => self -> [CSSStyleSheet] -> m ()
setAdoptedStyleSheets self val = liftDOM (void ((Types.toDocumentOrShadowRoot self) ^. jss "adoptedStyleSheets" (toJSVal val)))

-- | <https://developer.mozilla.org/docs/Web/API/Document/adoptedStyleSheets MDN DocumentOrShadowRoot.adoptedStyleSheets documentation>
getAdoptedStyleSheets :: (MonadDOM m, IsDocumentOrShadowRoot self) => self -> m [CSSStyleSheet]
getAdoptedStyleSheets self = liftDOM ((((Types.toDocumentOrShadowRoot self) ^. js "adoptedStyleSheets") >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/Document/fullscreenElement MDN DocumentOrShadowRoot.fullscreenElement documentation>
getFullscreenElement :: (MonadDOM m, IsDocumentOrShadowRoot self) => self -> m (Maybe Element)
getFullscreenElement self = liftDOM ((((Types.toDocumentOrShadowRoot self) ^. js "fullscreenElement") >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/Document/fullscreenElement MDN DocumentOrShadowRoot.fullscreenElement documentation>
getFullscreenElementUnsafe :: (MonadDOM m, IsDocumentOrShadowRoot self, HasCallStack) => self -> m Element
getFullscreenElementUnsafe self = liftDOM (((((Types.toDocumentOrShadowRoot self) ^. js "fullscreenElement") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://developer.mozilla.org/docs/Web/API/Document/fullscreenElement MDN DocumentOrShadowRoot.fullscreenElement documentation>
getFullscreenElementUnchecked :: (MonadDOM m, IsDocumentOrShadowRoot self) => self -> m Element
getFullscreenElementUnchecked self = liftDOM ((((Types.toDocumentOrShadowRoot self) ^. js "fullscreenElement") >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/Document/activeElement MDN DocumentOrShadowRoot.activeElement documentation>
getActiveElement :: (MonadDOM m, IsDocumentOrShadowRoot self) => self -> m (Maybe Element)
getActiveElement self = liftDOM ((((Types.toDocumentOrShadowRoot self) ^. js "activeElement") >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/Document/activeElement MDN DocumentOrShadowRoot.activeElement documentation>
getActiveElementUnsafe :: (MonadDOM m, IsDocumentOrShadowRoot self, HasCallStack) => self -> m Element
getActiveElementUnsafe self = liftDOM (((((Types.toDocumentOrShadowRoot self) ^. js "activeElement") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://developer.mozilla.org/docs/Web/API/Document/activeElement MDN DocumentOrShadowRoot.activeElement documentation>
getActiveElementUnchecked :: (MonadDOM m, IsDocumentOrShadowRoot self) => self -> m Element
getActiveElementUnchecked self = liftDOM ((((Types.toDocumentOrShadowRoot self) ^. js "activeElement") >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/Document/pictureInPictureElement MDN DocumentOrShadowRoot.pictureInPictureElement documentation>
getPictureInPictureElement :: (MonadDOM m, IsDocumentOrShadowRoot self) => self -> m (Maybe Element)
getPictureInPictureElement self = liftDOM ((((Types.toDocumentOrShadowRoot self) ^. js "pictureInPictureElement") >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/Document/pictureInPictureElement MDN DocumentOrShadowRoot.pictureInPictureElement documentation>
getPictureInPictureElementUnsafe :: (MonadDOM m, IsDocumentOrShadowRoot self, HasCallStack) => self -> m Element
getPictureInPictureElementUnsafe self = liftDOM (((((Types.toDocumentOrShadowRoot self) ^. js "pictureInPictureElement") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://developer.mozilla.org/docs/Web/API/Document/pictureInPictureElement MDN DocumentOrShadowRoot.pictureInPictureElement documentation>
getPictureInPictureElementUnchecked :: (MonadDOM m, IsDocumentOrShadowRoot self) => self -> m Element
getPictureInPictureElementUnchecked self = liftDOM ((((Types.toDocumentOrShadowRoot self) ^. js "pictureInPictureElement") >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/Document/pointerLockElement MDN DocumentOrShadowRoot.pointerLockElement documentation>
getPointerLockElement :: (MonadDOM m, IsDocumentOrShadowRoot self) => self -> m (Maybe Element)
getPointerLockElement self = liftDOM ((((Types.toDocumentOrShadowRoot self) ^. js "pointerLockElement") >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/Document/pointerLockElement MDN DocumentOrShadowRoot.pointerLockElement documentation>
getPointerLockElementUnsafe :: (MonadDOM m, IsDocumentOrShadowRoot self, HasCallStack) => self -> m Element
getPointerLockElementUnsafe self = liftDOM (((((Types.toDocumentOrShadowRoot self) ^. js "pointerLockElement") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://developer.mozilla.org/docs/Web/API/Document/pointerLockElement MDN DocumentOrShadowRoot.pointerLockElement documentation>
getPointerLockElementUnchecked :: (MonadDOM m, IsDocumentOrShadowRoot self) => self -> m Element
getPointerLockElementUnchecked self = liftDOM ((((Types.toDocumentOrShadowRoot self) ^. js "pointerLockElement") >>= fromJSValUnchecked))