packages feed

jsaddle-dom-0.10.0.0: src/JSDOM/Generated/RTCEncodedVideoFrame.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.RTCEncodedVideoFrame
       (newRTCEncodedVideoFrame, getMetadata, getMetadata_, getType, setData, getData, RTCEncodedVideoFrame(..), gTypeRTCEncodedVideoFrame)
       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/RTCEncodedVideoFrame/RTCEncodedVideoFrame MDN RTCEncodedVideoFrame. documentation>
newRTCEncodedVideoFrame :: (MonadDOM m) => RTCEncodedVideoFrame -> Maybe RTCEncodedVideoFrameOptions -> m RTCEncodedVideoFrame
newRTCEncodedVideoFrame originalFrame options = liftDOM (((new (jsg "RTCEncodedVideoFrame") [toJSVal originalFrame, P.maybe (P.return jsUndefined) toJSVal options]) >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/RTCEncodedVideoFrame/getMetadata MDN RTCEncodedVideoFrame.getMetadata documentation>
getMetadata :: (MonadDOM m) => RTCEncodedVideoFrame -> m RTCEncodedVideoFrameMetadata
getMetadata self = liftDOM (((self ^. jsf "getMetadata" ()) >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/RTCEncodedVideoFrame/getMetadata MDN RTCEncodedVideoFrame.getMetadata documentation>
getMetadata_ :: (MonadDOM m) => RTCEncodedVideoFrame -> m ()
getMetadata_ self = liftDOM (void (self ^. jsf "getMetadata" ()))

-- | <https://developer.mozilla.org/docs/Web/API/RTCEncodedVideoFrame/type MDN RTCEncodedVideoFrame.type documentation>
getType :: (MonadDOM m) => RTCEncodedVideoFrame -> m EncodedVideoChunkType
getType self = liftDOM (((self ^. js "type") >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/RTCEncodedVideoFrame/data MDN RTCEncodedVideoFrame.data documentation>
setData :: (MonadDOM m, IsArrayBuffer val) => RTCEncodedVideoFrame -> val -> m ()
setData self val = liftDOM (void (self ^. jss "data" (toJSVal val)))

-- | <https://developer.mozilla.org/docs/Web/API/RTCEncodedVideoFrame/data MDN RTCEncodedVideoFrame.data documentation>
getData :: (MonadDOM m) => RTCEncodedVideoFrame -> m ArrayBuffer
getData self = liftDOM (((self ^. js "data") >>= fromJSValUnchecked))