{-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE ForeignFunctionInterface #-} {-# LANGUAGE JavaScriptFFI #-} -- For HasCallStack compatibility {-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-} module GHCJS.DOM.JSFFI.Generated.RTCRtpTransceiver (js_setDirection, setDirection, js_stop, stop, js_getMid, getMid, getMidUnsafe, getMidUnchecked, js_getSender, getSender, js_getReceiver, getReceiver, js_getStopped, getStopped, js_getDirection, getDirection, RTCRtpTransceiver(..), gTypeRTCRtpTransceiver) where import Prelude ((.), (==), (>>=), return, IO, Int, Float, Double, Bool(..), Maybe, maybe, fromIntegral, round, fmap, Show, Read, Eq, Ord) import qualified Prelude (error) import Data.Typeable (Typeable) import GHCJS.Types (JSVal(..), JSString) import GHCJS.Foreign (jsNull, jsUndefined) import GHCJS.Foreign.Callback (syncCallback, asyncCallback, syncCallback1, asyncCallback1, syncCallback2, asyncCallback2, OnBlocked(..)) import GHCJS.Marshal (ToJSVal(..), FromJSVal(..)) import GHCJS.Marshal.Pure (PToJSVal(..), PFromJSVal(..)) import Control.Monad (void) import Control.Monad.IO.Class (MonadIO(..)) import Data.Int (Int64) import Data.Word (Word, Word64) import Data.Maybe (fromJust) import Data.Traversable (mapM) import GHCJS.DOM.Types import Control.Applicative ((<$>)) import GHCJS.DOM.EventTargetClosures (EventName, unsafeEventName, unsafeEventNameAsync) import GHCJS.DOM.JSFFI.Generated.Enums foreign import javascript unsafe "$1[\"setDirection\"]($2)" js_setDirection :: RTCRtpTransceiver -> JSVal -> IO () -- | setDirection :: (MonadIO m) => RTCRtpTransceiver -> RTCRtpTransceiverDirection -> m () setDirection self direction = liftIO (js_setDirection self (pToJSVal direction)) foreign import javascript unsafe "$1[\"stop\"]()" js_stop :: RTCRtpTransceiver -> IO () -- | stop :: (MonadIO m) => RTCRtpTransceiver -> m () stop self = liftIO (js_stop self) foreign import javascript unsafe "$1[\"mid\"]" js_getMid :: RTCRtpTransceiver -> IO (Nullable JSString) -- | getMid :: (MonadIO m, FromJSString result) => RTCRtpTransceiver -> m (Maybe result) getMid self = liftIO (fromMaybeJSString <$> (js_getMid self)) -- | getMidUnsafe :: (MonadIO m, HasCallStack, FromJSString result) => RTCRtpTransceiver -> m result getMidUnsafe self = liftIO ((fromMaybeJSString <$> (js_getMid self)) >>= maybe (Prelude.error "Nothing to return") return) -- | getMidUnchecked :: (MonadIO m, FromJSString result) => RTCRtpTransceiver -> m result getMidUnchecked self = liftIO (fromJust . fromMaybeJSString <$> (js_getMid self)) foreign import javascript unsafe "$1[\"sender\"]" js_getSender :: RTCRtpTransceiver -> IO RTCRtpSender -- | getSender :: (MonadIO m) => RTCRtpTransceiver -> m RTCRtpSender getSender self = liftIO (js_getSender self) foreign import javascript unsafe "$1[\"receiver\"]" js_getReceiver :: RTCRtpTransceiver -> IO RTCRtpReceiver -- | getReceiver :: (MonadIO m) => RTCRtpTransceiver -> m RTCRtpReceiver getReceiver self = liftIO (js_getReceiver self) foreign import javascript unsafe "($1[\"stopped\"] ? 1 : 0)" js_getStopped :: RTCRtpTransceiver -> IO Bool -- | getStopped :: (MonadIO m) => RTCRtpTransceiver -> m Bool getStopped self = liftIO (js_getStopped self) foreign import javascript unsafe "$1[\"direction\"]" js_getDirection :: RTCRtpTransceiver -> IO JSVal -- | getDirection :: (MonadIO m) => RTCRtpTransceiver -> m RTCRtpTransceiverDirection getDirection self = liftIO ((js_getDirection self) >>= fromJSValUnchecked)