packages feed

ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/DocumentOrShadowRoot.hs

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from dom (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.DocumentOrShadowRoot
       (js_getAnimations, js_getCustomElementRegistry, js_getStyleSheets, js_setAdoptedStyleSheets, js_getAdoptedStyleSheets, js_getFullscreenElement, js_getActiveElement, js_getPictureInPictureElement, js_getPointerLockElement, 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 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 $1[\"getAnimations\"](); })"
        js_getAnimations :: DocumentOrShadowRoot -> IO JSVal
-- | <https://developer.mozilla.org/docs/Web/API/Document/getAnimations MDN DocumentOrShadowRoot.getAnimations documentation>
getAnimations :: (MonadDOM m, IsDocumentOrShadowRoot self) => self -> m [Animation]
getAnimations self = liftDOM (((js_getAnimations ((Types.toDocumentOrShadowRoot self))) >>= 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 ((js_getAnimations ((Types.toDocumentOrShadowRoot self)))))

foreign import javascript unsafe "(($1) => { return $1[\"customElementRegistry\"]; })"
        js_getCustomElementRegistry :: DocumentOrShadowRoot -> IO JSVal
-- | <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 (((js_getCustomElementRegistry ((Types.toDocumentOrShadowRoot self))) >>= 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 ((((js_getCustomElementRegistry ((Types.toDocumentOrShadowRoot self))) >>= 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 ((pFromJSVal <$> (js_getCustomElementRegistry ((Types.toDocumentOrShadowRoot self)))))

foreign import javascript unsafe "(($1) => { return $1[\"styleSheets\"]; })"
        js_getStyleSheets :: DocumentOrShadowRoot -> IO StyleSheetList
-- | <https://developer.mozilla.org/docs/Web/API/Document/styleSheets MDN DocumentOrShadowRoot.styleSheets documentation>
getStyleSheets :: (MonadDOM m, IsDocumentOrShadowRoot self) => self -> m StyleSheetList
getStyleSheets self = liftDOM ((js_getStyleSheets ((Types.toDocumentOrShadowRoot self))))

foreign import javascript safe "(($1, $2) => { $1[\"adoptedStyleSheets\"] = $2; })"
        js_setAdoptedStyleSheets :: DocumentOrShadowRoot -> JSVal -> IO ()
-- | <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 (((toJSVal val) >>= \a2' -> js_setAdoptedStyleSheets ((Types.toDocumentOrShadowRoot self)) a2')))

foreign import javascript unsafe "(($1) => { return $1[\"adoptedStyleSheets\"]; })"
        js_getAdoptedStyleSheets :: DocumentOrShadowRoot -> IO JSVal
-- | <https://developer.mozilla.org/docs/Web/API/Document/adoptedStyleSheets MDN DocumentOrShadowRoot.adoptedStyleSheets documentation>
getAdoptedStyleSheets :: (MonadDOM m, IsDocumentOrShadowRoot self) => self -> m [CSSStyleSheet]
getAdoptedStyleSheets self = liftDOM (((js_getAdoptedStyleSheets ((Types.toDocumentOrShadowRoot self))) >>= fromJSValUnchecked))

foreign import javascript unsafe "(($1) => { return $1[\"fullscreenElement\"]; })"
        js_getFullscreenElement :: DocumentOrShadowRoot -> IO JSVal
-- | <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 (((js_getFullscreenElement ((Types.toDocumentOrShadowRoot self))) >>= 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 ((((js_getFullscreenElement ((Types.toDocumentOrShadowRoot self))) >>= 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 ((pFromJSVal <$> (js_getFullscreenElement ((Types.toDocumentOrShadowRoot self)))))

foreign import javascript unsafe "(($1) => { return $1[\"activeElement\"]; })"
        js_getActiveElement :: DocumentOrShadowRoot -> IO JSVal
-- | <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 (((js_getActiveElement ((Types.toDocumentOrShadowRoot self))) >>= 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 ((((js_getActiveElement ((Types.toDocumentOrShadowRoot self))) >>= 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 ((pFromJSVal <$> (js_getActiveElement ((Types.toDocumentOrShadowRoot self)))))

foreign import javascript unsafe "(($1) => { return $1[\"pictureInPictureElement\"]; })"
        js_getPictureInPictureElement :: DocumentOrShadowRoot -> IO JSVal
-- | <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 (((js_getPictureInPictureElement ((Types.toDocumentOrShadowRoot self))) >>= 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 ((((js_getPictureInPictureElement ((Types.toDocumentOrShadowRoot self))) >>= 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 ((pFromJSVal <$> (js_getPictureInPictureElement ((Types.toDocumentOrShadowRoot self)))))

foreign import javascript unsafe "(($1) => { return $1[\"pointerLockElement\"]; })"
        js_getPointerLockElement :: DocumentOrShadowRoot -> IO JSVal
-- | <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 (((js_getPointerLockElement ((Types.toDocumentOrShadowRoot self))) >>= 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 ((((js_getPointerLockElement ((Types.toDocumentOrShadowRoot self))) >>= 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 ((pFromJSVal <$> (js_getPointerLockElement ((Types.toDocumentOrShadowRoot self)))))