packages feed

ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/RTCSessionDescription.hs

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from webrtc (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.RTCSessionDescription
       (js_newRTCSessionDescription, js_toJSON, js_getType, js_getSdp, 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 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 safe "(($1) => { return new globalThis[\"RTCSessionDescription\"]($1); })"
        js_newRTCSessionDescription :: RTCSessionDescriptionInit -> IO RTCSessionDescription
-- | <https://developer.mozilla.org/docs/Web/API/RTCSessionDescription/RTCSessionDescription MDN RTCSessionDescription. documentation>
newRTCSessionDescription :: (MonadDOM m) => RTCSessionDescriptionInit -> m RTCSessionDescription
newRTCSessionDescription descriptionInitDict = liftDOM ((js_newRTCSessionDescription (descriptionInitDict)))

foreign import javascript safe "(($1) => { return $1[\"toJSON\"](); })"
        js_toJSON :: RTCSessionDescription -> IO RTCSessionDescriptionInit
-- | <https://developer.mozilla.org/docs/Web/API/RTCSessionDescription/toJSON MDN RTCSessionDescription.toJSON documentation>
toJSON :: (MonadDOM m) => RTCSessionDescription -> m RTCSessionDescriptionInit
toJSON self = liftDOM ((js_toJSON (self)))

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

foreign import javascript unsafe "(($1) => { return $1[\"type\"]; })"
        js_getType :: RTCSessionDescription -> IO JSVal
-- | <https://developer.mozilla.org/docs/Web/API/RTCSessionDescription/type MDN RTCSessionDescription.type documentation>
getType :: (MonadDOM m) => RTCSessionDescription -> m RTCSdpType
getType self = liftDOM (((js_getType (self)) >>= fromJSValUnchecked))

foreign import javascript unsafe "(($1) => { return $1[\"sdp\"]; })"
        js_getSdp :: RTCSessionDescription -> IO JSString
-- | <https://developer.mozilla.org/docs/Web/API/RTCSessionDescription/sdp MDN RTCSessionDescription.sdp documentation>
getSdp :: (MonadDOM m, FromJSString result) => RTCSessionDescription -> m result
getSdp self = liftDOM ((fromJSString <$> (js_getSdp (self))))