jsaddle-dom-0.10.0.0: src/JSDOM/Generated/PictureInPictureWindow.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from picture-in-picture (webref). Do not edit.
module JSDOM.Generated.PictureInPictureWindow
(getWidth, getHeight, resize, PictureInPictureWindow(..), gTypePictureInPictureWindow)
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/PictureInPictureWindow/width MDN PictureInPictureWindow.width documentation>
getWidth :: (MonadDOM m) => PictureInPictureWindow -> m Int
getWidth self = liftDOM ((P.round <$> ((self ^. js "width") >>= valToNumber)))
-- | <https://developer.mozilla.org/docs/Web/API/PictureInPictureWindow/height MDN PictureInPictureWindow.height documentation>
getHeight :: (MonadDOM m) => PictureInPictureWindow -> m Int
getHeight self = liftDOM ((P.round <$> ((self ^. js "height") >>= valToNumber)))
-- | <https://w3c.github.io/picture-in-picture/#dom-pictureinpicturewindow-onresize resize event>
resize :: EventName PictureInPictureWindow Event
resize = unsafeEventName (toJSString "resize")