module JSDOM.Generated.RTCDataChannel
(send, sendView, sendBlob, sendString, close, getLabel, getOrdered,
getMaxPacketLifeTime, getMaxPacketLifeTimeUnsafe,
getMaxPacketLifeTimeUnchecked, getMaxRetransmits,
getMaxRetransmitsUnsafe, getMaxRetransmitsUnchecked, getProtocol,
getNegotiated, getId, getIdUnsafe, getIdUnchecked, getReadyState,
getBufferedAmount, setBufferedAmountLowThreshold,
getBufferedAmountLowThreshold, setBinaryType, getBinaryType, open,
error, closeEvent, message, bufferedamountlow, RTCDataChannel(..),
gTypeRTCDataChannel)
where
import Prelude ((.), (==), (>>=), return, IO, Int, Float, Double, Bool(..), Maybe, maybe, fromIntegral, round, realToFrac, fmap, Show, Read, Eq, Ord, Maybe(..))
import qualified Prelude (error)
import Data.Typeable (Typeable)
import Data.Traversable (mapM)
import Language.Javascript.JSaddle (JSM(..), JSVal(..), JSString, strictEqual, toJSVal, valToStr, valToNumber, valToBool, js, jss, jsf, jsg, function, asyncFunction, new, array, jsUndefined, (!), (!!))
import Data.Int (Int64)
import Data.Word (Word, Word64)
import JSDOM.Types
import Control.Applicative ((<$>))
import Control.Monad (void)
import Control.Lens.Operators ((^.))
import JSDOM.EventTargetClosures (EventName, unsafeEventName)
import JSDOM.Enums
send ::
(MonadDOM m, IsArrayBuffer data') =>
RTCDataChannel -> data' -> m ()
send self data'
= liftDOM (void (self ^. jsf "send" [toJSVal data']))
sendView ::
(MonadDOM m, IsArrayBufferView data') =>
RTCDataChannel -> data' -> m ()
sendView self data'
= liftDOM (void (self ^. jsf "send" [toJSVal data']))
sendBlob ::
(MonadDOM m, IsBlob data') => RTCDataChannel -> data' -> m ()
sendBlob self data'
= liftDOM (void (self ^. jsf "send" [toJSVal data']))
sendString ::
(MonadDOM m, ToJSString data') => RTCDataChannel -> data' -> m ()
sendString self data'
= liftDOM (void (self ^. jsf "send" [toJSVal data']))
close :: (MonadDOM m) => RTCDataChannel -> m ()
close self = liftDOM (void (self ^. jsf "close" ()))
getLabel ::
(MonadDOM m, FromJSString result) => RTCDataChannel -> m result
getLabel self
= liftDOM ((self ^. js "label") >>= fromJSValUnchecked)
getOrdered :: (MonadDOM m) => RTCDataChannel -> m Bool
getOrdered self = liftDOM ((self ^. js "ordered") >>= valToBool)
getMaxPacketLifeTime ::
(MonadDOM m) => RTCDataChannel -> m (Maybe Word)
getMaxPacketLifeTime self
= liftDOM ((self ^. js "maxPacketLifeTime") >>= fromJSVal)
getMaxPacketLifeTimeUnsafe ::
(MonadDOM m, HasCallStack) => RTCDataChannel -> m Word
getMaxPacketLifeTimeUnsafe self
= liftDOM
(((self ^. js "maxPacketLifeTime") >>= fromJSVal) >>=
maybe (Prelude.error "Nothing to return") return)
getMaxPacketLifeTimeUnchecked ::
(MonadDOM m) => RTCDataChannel -> m Word
getMaxPacketLifeTimeUnchecked self
= liftDOM ((self ^. js "maxPacketLifeTime") >>= fromJSValUnchecked)
getMaxRetransmits ::
(MonadDOM m) => RTCDataChannel -> m (Maybe Word)
getMaxRetransmits self
= liftDOM ((self ^. js "maxRetransmits") >>= fromJSVal)
getMaxRetransmitsUnsafe ::
(MonadDOM m, HasCallStack) => RTCDataChannel -> m Word
getMaxRetransmitsUnsafe self
= liftDOM
(((self ^. js "maxRetransmits") >>= fromJSVal) >>=
maybe (Prelude.error "Nothing to return") return)
getMaxRetransmitsUnchecked ::
(MonadDOM m) => RTCDataChannel -> m Word
getMaxRetransmitsUnchecked self
= liftDOM ((self ^. js "maxRetransmits") >>= fromJSValUnchecked)
getProtocol ::
(MonadDOM m, FromJSString result) => RTCDataChannel -> m result
getProtocol self
= liftDOM ((self ^. js "protocol") >>= fromJSValUnchecked)
getNegotiated :: (MonadDOM m) => RTCDataChannel -> m Bool
getNegotiated self
= liftDOM ((self ^. js "negotiated") >>= valToBool)
getId :: (MonadDOM m) => RTCDataChannel -> m (Maybe Word)
getId self = liftDOM ((self ^. js "id") >>= fromJSVal)
getIdUnsafe ::
(MonadDOM m, HasCallStack) => RTCDataChannel -> m Word
getIdUnsafe self
= liftDOM
(((self ^. js "id") >>= fromJSVal) >>=
maybe (Prelude.error "Nothing to return") return)
getIdUnchecked :: (MonadDOM m) => RTCDataChannel -> m Word
getIdUnchecked self
= liftDOM ((self ^. js "id") >>= fromJSValUnchecked)
getReadyState ::
(MonadDOM m) => RTCDataChannel -> m RTCDataChannelState
getReadyState self
= liftDOM ((self ^. js "readyState") >>= fromJSValUnchecked)
getBufferedAmount :: (MonadDOM m) => RTCDataChannel -> m Word
getBufferedAmount self
= liftDOM
(round <$> ((self ^. js "bufferedAmount") >>= valToNumber))
setBufferedAmountLowThreshold ::
(MonadDOM m) => RTCDataChannel -> Word -> m ()
setBufferedAmountLowThreshold self val
= liftDOM (self ^. jss "bufferedAmountLowThreshold" (toJSVal val))
getBufferedAmountLowThreshold ::
(MonadDOM m) => RTCDataChannel -> m Word
getBufferedAmountLowThreshold self
= liftDOM
(round <$>
((self ^. js "bufferedAmountLowThreshold") >>= valToNumber))
setBinaryType ::
(MonadDOM m, ToJSString val) => RTCDataChannel -> val -> m ()
setBinaryType self val
= liftDOM (self ^. jss "binaryType" (toJSVal val))
getBinaryType ::
(MonadDOM m, FromJSString result) => RTCDataChannel -> m result
getBinaryType self
= liftDOM ((self ^. js "binaryType") >>= fromJSValUnchecked)
open :: EventName RTCDataChannel Event
open = unsafeEventName (toJSString "open")
error :: EventName RTCDataChannel UIEvent
error = unsafeEventName (toJSString "error")
closeEvent :: EventName RTCDataChannel CloseEvent
closeEvent = unsafeEventName (toJSString "close")
message :: EventName RTCDataChannel MessageEvent
message = unsafeEventName (toJSString "message")
bufferedamountlow :: EventName RTCDataChannel onbufferedamountlow
bufferedamountlow
= unsafeEventName (toJSString "bufferedamountlow")