ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/DocumentPictureInPicture.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from document-picture-in-picture (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.DocumentPictureInPicture
(js_requestWindow, js_getWindow, requestWindow, requestWindow_, getWindow, enter, DocumentPictureInPicture(..), gTypeDocumentPictureInPicture)
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 interruptible "(($1, $2, $c) => { return $1[\"requestWindow\"]($2).then(function(s) { $c(null, s);}, function(e) { $c(e, null);}); })"
js_requestWindow :: DocumentPictureInPicture -> JSVal -> IO (JSVal, Window)
-- | <https://developer.mozilla.org/docs/Web/API/DocumentPictureInPicture/requestWindow MDN DocumentPictureInPicture.requestWindow documentation>
requestWindow :: (MonadDOM m) => DocumentPictureInPicture -> Maybe DocumentPictureInPictureOptions -> m Window
requestWindow self options = liftDOM ((((P.maybe (P.return jsUndefined) toJSVal options) >>= \a2' -> js_requestWindow (self) a2') >>= checkPromiseResult))
-- | <https://developer.mozilla.org/docs/Web/API/DocumentPictureInPicture/requestWindow MDN DocumentPictureInPicture.requestWindow documentation>
requestWindow_ :: (MonadDOM m) => DocumentPictureInPicture -> Maybe DocumentPictureInPictureOptions -> m ()
requestWindow_ self options = liftDOM (void ((((P.maybe (P.return jsUndefined) toJSVal options) >>= \a2' -> js_requestWindow (self) a2') >>= checkPromiseResult)))
foreign import javascript unsafe "(($1) => { return $1[\"window\"]; })"
js_getWindow :: DocumentPictureInPicture -> IO Window
-- | <https://developer.mozilla.org/docs/Web/API/DocumentPictureInPicture/window MDN DocumentPictureInPicture.window documentation>
getWindow :: (MonadDOM m) => DocumentPictureInPicture -> m Window
getWindow self = liftDOM ((js_getWindow (self)))
-- | <https://wicg.github.io/document-picture-in-picture/#dom-documentpictureinpicture-onenter enter event>
enter :: EventName DocumentPictureInPicture DocumentPictureInPictureEvent
enter = unsafeEventName (toJSString "enter")