jsaddle-dom-0.10.0.0: src/JSDOM/Generated/RTCEncodedVideoFrameMetadata.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from webrtc-encoded-transform (webref). Do not edit.
module JSDOM.Generated.RTCEncodedVideoFrameMetadata
(newRTCEncodedVideoFrameMetadata, setFrameId, getFrameId, getFrameIdUnsafe, getFrameIdUnchecked, setDependencies, getDependencies, getDependenciesUnsafe, getDependenciesUnchecked, setWidth, getWidth, getWidthUnsafe, getWidthUnchecked, setHeight, getHeight, getHeightUnsafe, getHeightUnchecked, setSpatialIndex, getSpatialIndex, getSpatialIndexUnsafe, getSpatialIndexUnchecked, setTemporalIndex, getTemporalIndex, getTemporalIndexUnsafe, getTemporalIndexUnchecked, setTimestamp, getTimestamp, getTimestampUnsafe, getTimestampUnchecked, RTCEncodedVideoFrameMetadata(..), gTypeRTCEncodedVideoFrameMetadata)
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://w3c.github.io/webrtc-encoded-transform/#dictdef-rtcencodedvideoframemetadata RTCEncodedVideoFrameMetadata specification>
newRTCEncodedVideoFrameMetadata :: (MonadDOM m) => m RTCEncodedVideoFrameMetadata
newRTCEncodedVideoFrameMetadata = liftDOM ((((new (jsg "Object") () >>= \o -> P.return o)) >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webrtc-encoded-transform/#dom-rtcencodedvideoframemetadata-frameid RTCEncodedVideoFrameMetadata.frameId specification>
setFrameId :: (MonadDOM m) => RTCEncodedVideoFrameMetadata -> Word53 -> m ()
setFrameId self val = liftDOM (void (self ^. jss "frameId" (toJSVal val)))
-- | <https://w3c.github.io/webrtc-encoded-transform/#dom-rtcencodedvideoframemetadata-frameid RTCEncodedVideoFrameMetadata.frameId specification>
getFrameId :: (MonadDOM m) => RTCEncodedVideoFrameMetadata -> m (Maybe Word53)
getFrameId self = liftDOM (((self ^. js "frameId") >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webrtc-encoded-transform/#dom-rtcencodedvideoframemetadata-frameid RTCEncodedVideoFrameMetadata.frameId specification>
getFrameIdUnsafe :: (MonadDOM m, HasCallStack) => RTCEncodedVideoFrameMetadata -> m Word53
getFrameIdUnsafe self = liftDOM ((((self ^. js "frameId") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webrtc-encoded-transform/#dom-rtcencodedvideoframemetadata-frameid RTCEncodedVideoFrameMetadata.frameId specification>
getFrameIdUnchecked :: (MonadDOM m) => RTCEncodedVideoFrameMetadata -> m Word53
getFrameIdUnchecked self = liftDOM (((self ^. js "frameId") >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webrtc-encoded-transform/#dom-rtcencodedvideoframemetadata-dependencies RTCEncodedVideoFrameMetadata.dependencies specification>
setDependencies :: (MonadDOM m) => RTCEncodedVideoFrameMetadata -> [Word53] -> m ()
setDependencies self val = liftDOM (void (self ^. jss "dependencies" (toJSVal val)))
-- | <https://w3c.github.io/webrtc-encoded-transform/#dom-rtcencodedvideoframemetadata-dependencies RTCEncodedVideoFrameMetadata.dependencies specification>
getDependencies :: (MonadDOM m) => RTCEncodedVideoFrameMetadata -> m (Maybe [Word53])
getDependencies self = liftDOM (((self ^. js "dependencies") >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webrtc-encoded-transform/#dom-rtcencodedvideoframemetadata-dependencies RTCEncodedVideoFrameMetadata.dependencies specification>
getDependenciesUnsafe :: (MonadDOM m, HasCallStack) => RTCEncodedVideoFrameMetadata -> m [Word53]
getDependenciesUnsafe self = liftDOM ((((self ^. js "dependencies") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webrtc-encoded-transform/#dom-rtcencodedvideoframemetadata-dependencies RTCEncodedVideoFrameMetadata.dependencies specification>
getDependenciesUnchecked :: (MonadDOM m) => RTCEncodedVideoFrameMetadata -> m [Word53]
getDependenciesUnchecked self = liftDOM (((self ^. js "dependencies") >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webrtc-encoded-transform/#dom-rtcencodedvideoframemetadata-width RTCEncodedVideoFrameMetadata.width specification>
setWidth :: (MonadDOM m) => RTCEncodedVideoFrameMetadata -> Word -> m ()
setWidth self val = liftDOM (void (self ^. jss "width" (toJSVal val)))
-- | <https://w3c.github.io/webrtc-encoded-transform/#dom-rtcencodedvideoframemetadata-width RTCEncodedVideoFrameMetadata.width specification>
getWidth :: (MonadDOM m) => RTCEncodedVideoFrameMetadata -> m (Maybe Word)
getWidth self = liftDOM (((self ^. js "width") >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webrtc-encoded-transform/#dom-rtcencodedvideoframemetadata-width RTCEncodedVideoFrameMetadata.width specification>
getWidthUnsafe :: (MonadDOM m, HasCallStack) => RTCEncodedVideoFrameMetadata -> m Word
getWidthUnsafe self = liftDOM ((((self ^. js "width") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webrtc-encoded-transform/#dom-rtcencodedvideoframemetadata-width RTCEncodedVideoFrameMetadata.width specification>
getWidthUnchecked :: (MonadDOM m) => RTCEncodedVideoFrameMetadata -> m Word
getWidthUnchecked self = liftDOM ((P.round <$> ((self ^. js "width") >>= valToNumber)))
-- | <https://w3c.github.io/webrtc-encoded-transform/#dom-rtcencodedvideoframemetadata-height RTCEncodedVideoFrameMetadata.height specification>
setHeight :: (MonadDOM m) => RTCEncodedVideoFrameMetadata -> Word -> m ()
setHeight self val = liftDOM (void (self ^. jss "height" (toJSVal val)))
-- | <https://w3c.github.io/webrtc-encoded-transform/#dom-rtcencodedvideoframemetadata-height RTCEncodedVideoFrameMetadata.height specification>
getHeight :: (MonadDOM m) => RTCEncodedVideoFrameMetadata -> m (Maybe Word)
getHeight self = liftDOM (((self ^. js "height") >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webrtc-encoded-transform/#dom-rtcencodedvideoframemetadata-height RTCEncodedVideoFrameMetadata.height specification>
getHeightUnsafe :: (MonadDOM m, HasCallStack) => RTCEncodedVideoFrameMetadata -> m Word
getHeightUnsafe self = liftDOM ((((self ^. js "height") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webrtc-encoded-transform/#dom-rtcencodedvideoframemetadata-height RTCEncodedVideoFrameMetadata.height specification>
getHeightUnchecked :: (MonadDOM m) => RTCEncodedVideoFrameMetadata -> m Word
getHeightUnchecked self = liftDOM ((P.round <$> ((self ^. js "height") >>= valToNumber)))
-- | <https://w3c.github.io/webrtc-encoded-transform/#dom-rtcencodedvideoframemetadata-spatialindex RTCEncodedVideoFrameMetadata.spatialIndex specification>
setSpatialIndex :: (MonadDOM m) => RTCEncodedVideoFrameMetadata -> Word -> m ()
setSpatialIndex self val = liftDOM (void (self ^. jss "spatialIndex" (toJSVal val)))
-- | <https://w3c.github.io/webrtc-encoded-transform/#dom-rtcencodedvideoframemetadata-spatialindex RTCEncodedVideoFrameMetadata.spatialIndex specification>
getSpatialIndex :: (MonadDOM m) => RTCEncodedVideoFrameMetadata -> m (Maybe Word)
getSpatialIndex self = liftDOM (((self ^. js "spatialIndex") >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webrtc-encoded-transform/#dom-rtcencodedvideoframemetadata-spatialindex RTCEncodedVideoFrameMetadata.spatialIndex specification>
getSpatialIndexUnsafe :: (MonadDOM m, HasCallStack) => RTCEncodedVideoFrameMetadata -> m Word
getSpatialIndexUnsafe self = liftDOM ((((self ^. js "spatialIndex") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webrtc-encoded-transform/#dom-rtcencodedvideoframemetadata-spatialindex RTCEncodedVideoFrameMetadata.spatialIndex specification>
getSpatialIndexUnchecked :: (MonadDOM m) => RTCEncodedVideoFrameMetadata -> m Word
getSpatialIndexUnchecked self = liftDOM ((P.round <$> ((self ^. js "spatialIndex") >>= valToNumber)))
-- | <https://w3c.github.io/webrtc-encoded-transform/#dom-rtcencodedvideoframemetadata-temporalindex RTCEncodedVideoFrameMetadata.temporalIndex specification>
setTemporalIndex :: (MonadDOM m) => RTCEncodedVideoFrameMetadata -> Word -> m ()
setTemporalIndex self val = liftDOM (void (self ^. jss "temporalIndex" (toJSVal val)))
-- | <https://w3c.github.io/webrtc-encoded-transform/#dom-rtcencodedvideoframemetadata-temporalindex RTCEncodedVideoFrameMetadata.temporalIndex specification>
getTemporalIndex :: (MonadDOM m) => RTCEncodedVideoFrameMetadata -> m (Maybe Word)
getTemporalIndex self = liftDOM (((self ^. js "temporalIndex") >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webrtc-encoded-transform/#dom-rtcencodedvideoframemetadata-temporalindex RTCEncodedVideoFrameMetadata.temporalIndex specification>
getTemporalIndexUnsafe :: (MonadDOM m, HasCallStack) => RTCEncodedVideoFrameMetadata -> m Word
getTemporalIndexUnsafe self = liftDOM ((((self ^. js "temporalIndex") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webrtc-encoded-transform/#dom-rtcencodedvideoframemetadata-temporalindex RTCEncodedVideoFrameMetadata.temporalIndex specification>
getTemporalIndexUnchecked :: (MonadDOM m) => RTCEncodedVideoFrameMetadata -> m Word
getTemporalIndexUnchecked self = liftDOM ((P.round <$> ((self ^. js "temporalIndex") >>= valToNumber)))
-- | <https://w3c.github.io/webrtc-encoded-transform/#dom-rtcencodedvideoframemetadata-timestamp RTCEncodedVideoFrameMetadata.timestamp specification>
setTimestamp :: (MonadDOM m) => RTCEncodedVideoFrameMetadata -> Int53 -> m ()
setTimestamp self val = liftDOM (void (self ^. jss "timestamp" (toJSVal val)))
-- | <https://w3c.github.io/webrtc-encoded-transform/#dom-rtcencodedvideoframemetadata-timestamp RTCEncodedVideoFrameMetadata.timestamp specification>
getTimestamp :: (MonadDOM m) => RTCEncodedVideoFrameMetadata -> m (Maybe Int53)
getTimestamp self = liftDOM (((self ^. js "timestamp") >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webrtc-encoded-transform/#dom-rtcencodedvideoframemetadata-timestamp RTCEncodedVideoFrameMetadata.timestamp specification>
getTimestampUnsafe :: (MonadDOM m, HasCallStack) => RTCEncodedVideoFrameMetadata -> m Int53
getTimestampUnsafe self = liftDOM ((((self ^. js "timestamp") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webrtc-encoded-transform/#dom-rtcencodedvideoframemetadata-timestamp RTCEncodedVideoFrameMetadata.timestamp specification>
getTimestampUnchecked :: (MonadDOM m) => RTCEncodedVideoFrameMetadata -> m Int53
getTimestampUnchecked self = liftDOM (((self ^. js "timestamp") >>= fromJSValUnchecked))