packages feed

jsaddle-dom-0.10.0.0: src/JSDOM/Generated/RTCSessionDescription.hs

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from webrtc (webref). Do not edit.
module JSDOM.Generated.RTCSessionDescription
       (newRTCSessionDescription, toJSON, toJSON_, getType, getSdp, RTCSessionDescription(..), gTypeRTCSessionDescription)
       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/RTCSessionDescription/RTCSessionDescription MDN RTCSessionDescription. documentation>
newRTCSessionDescription :: (MonadDOM m) => RTCSessionDescriptionInit -> m RTCSessionDescription
newRTCSessionDescription descriptionInitDict = liftDOM (((new (jsg "RTCSessionDescription") [toJSVal descriptionInitDict]) >>= fromJSValUnchecked))

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

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

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

-- | <https://developer.mozilla.org/docs/Web/API/RTCSessionDescription/sdp MDN RTCSessionDescription.sdp documentation>
getSdp :: (MonadDOM m, FromJSString result) => RTCSessionDescription -> m result
getSdp self = liftDOM (((self ^. js "sdp") >>= fromJSValUnchecked))