ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/RTCPeerConnectionIceErrorEvent.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.RTCPeerConnectionIceErrorEvent
(js_newRTCPeerConnectionIceErrorEvent, js_getAddress, js_getPort, js_getUrl, js_getErrorCode, js_getErrorText, newRTCPeerConnectionIceErrorEvent, getAddress, getAddressUnsafe, getAddressUnchecked, getPort, getPortUnsafe, getPortUnchecked, getUrl, getErrorCode, getErrorText, RTCPeerConnectionIceErrorEvent(..), gTypeRTCPeerConnectionIceErrorEvent)
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, $2) => { return new globalThis[\"RTCPeerConnectionIceErrorEvent\"]($1, $2); })"
js_newRTCPeerConnectionIceErrorEvent :: JSString -> RTCPeerConnectionIceErrorEventInit -> IO RTCPeerConnectionIceErrorEvent
-- | <https://developer.mozilla.org/docs/Web/API/RTCPeerConnectionIceErrorEvent/RTCPeerConnectionIceErrorEvent MDN RTCPeerConnectionIceErrorEvent. documentation>
newRTCPeerConnectionIceErrorEvent :: (MonadDOM m, ToJSString type') => type' -> RTCPeerConnectionIceErrorEventInit -> m RTCPeerConnectionIceErrorEvent
newRTCPeerConnectionIceErrorEvent type' eventInitDict = liftDOM ((js_newRTCPeerConnectionIceErrorEvent (toJSString type') (eventInitDict)))
foreign import javascript unsafe "(($1) => { return $1[\"address\"]; })"
js_getAddress :: RTCPeerConnectionIceErrorEvent -> IO JSVal
-- | <https://developer.mozilla.org/docs/Web/API/RTCPeerConnectionIceErrorEvent/address MDN RTCPeerConnectionIceErrorEvent.address documentation>
getAddress :: (MonadDOM m, FromJSString result) => RTCPeerConnectionIceErrorEvent -> m (Maybe result)
getAddress self = liftDOM (((fromMaybeJSString . Nullable) <$> (js_getAddress (self))))
-- | <https://developer.mozilla.org/docs/Web/API/RTCPeerConnectionIceErrorEvent/address MDN RTCPeerConnectionIceErrorEvent.address documentation>
getAddressUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => RTCPeerConnectionIceErrorEvent -> m result
getAddressUnsafe self = liftDOM ((((fromMaybeJSString . Nullable) <$> (js_getAddress (self))) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://developer.mozilla.org/docs/Web/API/RTCPeerConnectionIceErrorEvent/address MDN RTCPeerConnectionIceErrorEvent.address documentation>
getAddressUnchecked :: (MonadDOM m, FromJSString result) => RTCPeerConnectionIceErrorEvent -> m result
getAddressUnchecked self = liftDOM ((pFromJSVal <$> (js_getAddress (self))))
foreign import javascript unsafe "(($1) => { return $1[\"port\"]; })"
js_getPort :: RTCPeerConnectionIceErrorEvent -> IO JSVal
-- | <https://developer.mozilla.org/docs/Web/API/RTCPeerConnectionIceErrorEvent/port MDN RTCPeerConnectionIceErrorEvent.port documentation>
getPort :: (MonadDOM m) => RTCPeerConnectionIceErrorEvent -> m (Maybe Word)
getPort self = liftDOM (((js_getPort (self)) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/RTCPeerConnectionIceErrorEvent/port MDN RTCPeerConnectionIceErrorEvent.port documentation>
getPortUnsafe :: (MonadDOM m, HasCallStack) => RTCPeerConnectionIceErrorEvent -> m Word
getPortUnsafe self = liftDOM ((((js_getPort (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://developer.mozilla.org/docs/Web/API/RTCPeerConnectionIceErrorEvent/port MDN RTCPeerConnectionIceErrorEvent.port documentation>
getPortUnchecked :: (MonadDOM m) => RTCPeerConnectionIceErrorEvent -> m Word
getPortUnchecked self = liftDOM ((pFromJSVal <$> (js_getPort (self))))
foreign import javascript unsafe "(($1) => { return $1[\"url\"]; })"
js_getUrl :: RTCPeerConnectionIceErrorEvent -> IO JSString
-- | <https://developer.mozilla.org/docs/Web/API/RTCPeerConnectionIceErrorEvent/url MDN RTCPeerConnectionIceErrorEvent.url documentation>
getUrl :: (MonadDOM m, FromJSString result) => RTCPeerConnectionIceErrorEvent -> m result
getUrl self = liftDOM ((fromJSString <$> (js_getUrl (self))))
foreign import javascript unsafe "(($1) => { return $1[\"errorCode\"]; })"
js_getErrorCode :: RTCPeerConnectionIceErrorEvent -> IO Word
-- | <https://developer.mozilla.org/docs/Web/API/RTCPeerConnectionIceErrorEvent/errorCode MDN RTCPeerConnectionIceErrorEvent.errorCode documentation>
getErrorCode :: (MonadDOM m) => RTCPeerConnectionIceErrorEvent -> m Word
getErrorCode self = liftDOM ((js_getErrorCode (self)))
foreign import javascript unsafe "(($1) => { return $1[\"errorText\"]; })"
js_getErrorText :: RTCPeerConnectionIceErrorEvent -> IO JSString
-- | <https://developer.mozilla.org/docs/Web/API/RTCPeerConnectionIceErrorEvent/errorText MDN RTCPeerConnectionIceErrorEvent.errorText documentation>
getErrorText :: (MonadDOM m, FromJSString result) => RTCPeerConnectionIceErrorEvent -> m result
getErrorText self = liftDOM ((fromJSString <$> (js_getErrorText (self))))