ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/RTCDataChannelInit.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.RTCDataChannelInit
(js_newRTCDataChannelInit, js_setOrdered, js_getOrdered, js_setMaxPacketLifeTime, js_getMaxPacketLifeTime, js_setMaxRetransmits, js_getMaxRetransmits, js_setProtocol, js_getProtocol, js_setNegotiated, js_getNegotiated, js_setId, js_getId, js_setPriority, js_getPriority, newRTCDataChannelInit, setOrdered, getOrdered, getOrderedUnsafe, getOrderedUnchecked, setMaxPacketLifeTime, getMaxPacketLifeTime, getMaxPacketLifeTimeUnsafe, getMaxPacketLifeTimeUnchecked, setMaxRetransmits, getMaxRetransmits, getMaxRetransmitsUnsafe, getMaxRetransmitsUnchecked, setProtocol, getProtocol, getProtocolUnsafe, getProtocolUnchecked, setNegotiated, getNegotiated, getNegotiatedUnsafe, getNegotiatedUnchecked, setId, getId, getIdUnsafe, getIdUnchecked, setPriority, getPriority, getPriorityUnsafe, getPriorityUnchecked, RTCDataChannelInit(..), gTypeRTCDataChannelInit)
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 "(() => { return ({}); })"
js_newRTCDataChannelInit :: IO RTCDataChannelInit
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcdatachannelinit RTCDataChannelInit specification>
newRTCDataChannelInit :: (MonadDOM m) => m RTCDataChannelInit
newRTCDataChannelInit = liftDOM ((js_newRTCDataChannelInit))
foreign import javascript safe "(($1, $2) => { $1[\"ordered\"] = $2; })"
js_setOrdered :: RTCDataChannelInit -> Bool -> IO ()
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcdatachannelinit-ordered RTCDataChannelInit.ordered specification>
setOrdered :: (MonadDOM m) => RTCDataChannelInit -> Bool -> m ()
setOrdered self val = liftDOM (void ((js_setOrdered (self) (val))))
foreign import javascript unsafe "(($1) => { return $1[\"ordered\"]; })"
js_getOrdered :: RTCDataChannelInit -> IO JSVal
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcdatachannelinit-ordered RTCDataChannelInit.ordered specification>
getOrdered :: (MonadDOM m) => RTCDataChannelInit -> m (Maybe Bool)
getOrdered self = liftDOM (((js_getOrdered (self)) >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcdatachannelinit-ordered RTCDataChannelInit.ordered specification>
getOrderedUnsafe :: (MonadDOM m, HasCallStack) => RTCDataChannelInit -> m Bool
getOrderedUnsafe self = liftDOM ((((js_getOrdered (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcdatachannelinit-ordered RTCDataChannelInit.ordered specification>
getOrderedUnchecked :: (MonadDOM m) => RTCDataChannelInit -> m Bool
getOrderedUnchecked self = liftDOM ((pFromJSVal <$> (js_getOrdered (self))))
foreign import javascript safe "(($1, $2) => { $1[\"maxPacketLifeTime\"] = $2; })"
js_setMaxPacketLifeTime :: RTCDataChannelInit -> Word -> IO ()
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcdatachannelinit-maxpacketlifetime RTCDataChannelInit.maxPacketLifeTime specification>
setMaxPacketLifeTime :: (MonadDOM m) => RTCDataChannelInit -> Word -> m ()
setMaxPacketLifeTime self val = liftDOM (void ((js_setMaxPacketLifeTime (self) (val))))
foreign import javascript unsafe "(($1) => { return $1[\"maxPacketLifeTime\"]; })"
js_getMaxPacketLifeTime :: RTCDataChannelInit -> IO JSVal
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcdatachannelinit-maxpacketlifetime RTCDataChannelInit.maxPacketLifeTime specification>
getMaxPacketLifeTime :: (MonadDOM m) => RTCDataChannelInit -> m (Maybe Word)
getMaxPacketLifeTime self = liftDOM (((js_getMaxPacketLifeTime (self)) >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcdatachannelinit-maxpacketlifetime RTCDataChannelInit.maxPacketLifeTime specification>
getMaxPacketLifeTimeUnsafe :: (MonadDOM m, HasCallStack) => RTCDataChannelInit -> m Word
getMaxPacketLifeTimeUnsafe self = liftDOM ((((js_getMaxPacketLifeTime (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcdatachannelinit-maxpacketlifetime RTCDataChannelInit.maxPacketLifeTime specification>
getMaxPacketLifeTimeUnchecked :: (MonadDOM m) => RTCDataChannelInit -> m Word
getMaxPacketLifeTimeUnchecked self = liftDOM ((pFromJSVal <$> (js_getMaxPacketLifeTime (self))))
foreign import javascript safe "(($1, $2) => { $1[\"maxRetransmits\"] = $2; })"
js_setMaxRetransmits :: RTCDataChannelInit -> Word -> IO ()
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcdatachannelinit-maxretransmits RTCDataChannelInit.maxRetransmits specification>
setMaxRetransmits :: (MonadDOM m) => RTCDataChannelInit -> Word -> m ()
setMaxRetransmits self val = liftDOM (void ((js_setMaxRetransmits (self) (val))))
foreign import javascript unsafe "(($1) => { return $1[\"maxRetransmits\"]; })"
js_getMaxRetransmits :: RTCDataChannelInit -> IO JSVal
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcdatachannelinit-maxretransmits RTCDataChannelInit.maxRetransmits specification>
getMaxRetransmits :: (MonadDOM m) => RTCDataChannelInit -> m (Maybe Word)
getMaxRetransmits self = liftDOM (((js_getMaxRetransmits (self)) >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcdatachannelinit-maxretransmits RTCDataChannelInit.maxRetransmits specification>
getMaxRetransmitsUnsafe :: (MonadDOM m, HasCallStack) => RTCDataChannelInit -> m Word
getMaxRetransmitsUnsafe self = liftDOM ((((js_getMaxRetransmits (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcdatachannelinit-maxretransmits RTCDataChannelInit.maxRetransmits specification>
getMaxRetransmitsUnchecked :: (MonadDOM m) => RTCDataChannelInit -> m Word
getMaxRetransmitsUnchecked self = liftDOM ((pFromJSVal <$> (js_getMaxRetransmits (self))))
foreign import javascript safe "(($1, $2) => { $1[\"protocol\"] = $2; })"
js_setProtocol :: RTCDataChannelInit -> JSString -> IO ()
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcdatachannelinit-protocol RTCDataChannelInit.protocol specification>
setProtocol :: (MonadDOM m, ToJSString val) => RTCDataChannelInit -> val -> m ()
setProtocol self val = liftDOM (void ((js_setProtocol (self) (toJSString val))))
foreign import javascript unsafe "(($1) => { return $1[\"protocol\"]; })"
js_getProtocol :: RTCDataChannelInit -> IO JSVal
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcdatachannelinit-protocol RTCDataChannelInit.protocol specification>
getProtocol :: (MonadDOM m, FromJSString result) => RTCDataChannelInit -> m (Maybe result)
getProtocol self = liftDOM (((fromMaybeJSString . Nullable) <$> (js_getProtocol (self))))
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcdatachannelinit-protocol RTCDataChannelInit.protocol specification>
getProtocolUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => RTCDataChannelInit -> m result
getProtocolUnsafe self = liftDOM ((((fromMaybeJSString . Nullable) <$> (js_getProtocol (self))) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcdatachannelinit-protocol RTCDataChannelInit.protocol specification>
getProtocolUnchecked :: (MonadDOM m, FromJSString result) => RTCDataChannelInit -> m result
getProtocolUnchecked self = liftDOM ((pFromJSVal <$> (js_getProtocol (self))))
foreign import javascript safe "(($1, $2) => { $1[\"negotiated\"] = $2; })"
js_setNegotiated :: RTCDataChannelInit -> Bool -> IO ()
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcdatachannelinit-negotiated RTCDataChannelInit.negotiated specification>
setNegotiated :: (MonadDOM m) => RTCDataChannelInit -> Bool -> m ()
setNegotiated self val = liftDOM (void ((js_setNegotiated (self) (val))))
foreign import javascript unsafe "(($1) => { return $1[\"negotiated\"]; })"
js_getNegotiated :: RTCDataChannelInit -> IO JSVal
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcdatachannelinit-negotiated RTCDataChannelInit.negotiated specification>
getNegotiated :: (MonadDOM m) => RTCDataChannelInit -> m (Maybe Bool)
getNegotiated self = liftDOM (((js_getNegotiated (self)) >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcdatachannelinit-negotiated RTCDataChannelInit.negotiated specification>
getNegotiatedUnsafe :: (MonadDOM m, HasCallStack) => RTCDataChannelInit -> m Bool
getNegotiatedUnsafe self = liftDOM ((((js_getNegotiated (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcdatachannelinit-negotiated RTCDataChannelInit.negotiated specification>
getNegotiatedUnchecked :: (MonadDOM m) => RTCDataChannelInit -> m Bool
getNegotiatedUnchecked self = liftDOM ((pFromJSVal <$> (js_getNegotiated (self))))
foreign import javascript safe "(($1, $2) => { $1[\"id\"] = $2; })"
js_setId :: RTCDataChannelInit -> Word -> IO ()
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcdatachannelinit-id RTCDataChannelInit.id specification>
setId :: (MonadDOM m) => RTCDataChannelInit -> Word -> m ()
setId self val = liftDOM (void ((js_setId (self) (val))))
foreign import javascript unsafe "(($1) => { return $1[\"id\"]; })"
js_getId :: RTCDataChannelInit -> IO JSVal
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcdatachannelinit-id RTCDataChannelInit.id specification>
getId :: (MonadDOM m) => RTCDataChannelInit -> m (Maybe Word)
getId self = liftDOM (((js_getId (self)) >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcdatachannelinit-id RTCDataChannelInit.id specification>
getIdUnsafe :: (MonadDOM m, HasCallStack) => RTCDataChannelInit -> m Word
getIdUnsafe self = liftDOM ((((js_getId (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcdatachannelinit-id RTCDataChannelInit.id specification>
getIdUnchecked :: (MonadDOM m) => RTCDataChannelInit -> m Word
getIdUnchecked self = liftDOM ((pFromJSVal <$> (js_getId (self))))
foreign import javascript safe "(($1, $2) => { $1[\"priority\"] = $2; })"
js_setPriority :: RTCDataChannelInit -> JSVal -> IO ()
-- | <https://w3c.github.io/webrtc-priority/#dom-rtcdatachannelinit-priority RTCDataChannelInit.priority specification>
setPriority :: (MonadDOM m) => RTCDataChannelInit -> RTCPriorityType -> m ()
setPriority self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setPriority (self) a2')))
foreign import javascript unsafe "(($1) => { return $1[\"priority\"]; })"
js_getPriority :: RTCDataChannelInit -> IO JSVal
-- | <https://w3c.github.io/webrtc-priority/#dom-rtcdatachannelinit-priority RTCDataChannelInit.priority specification>
getPriority :: (MonadDOM m) => RTCDataChannelInit -> m (Maybe RTCPriorityType)
getPriority self = liftDOM (((js_getPriority (self)) >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webrtc-priority/#dom-rtcdatachannelinit-priority RTCDataChannelInit.priority specification>
getPriorityUnsafe :: (MonadDOM m, HasCallStack) => RTCDataChannelInit -> m RTCPriorityType
getPriorityUnsafe self = liftDOM ((((js_getPriority (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webrtc-priority/#dom-rtcdatachannelinit-priority RTCDataChannelInit.priority specification>
getPriorityUnchecked :: (MonadDOM m) => RTCDataChannelInit -> m RTCPriorityType
getPriorityUnchecked self = liftDOM ((pFromJSVal <$> (js_getPriority (self))))