jsaddle-dom-0.10.0.0: src/JSDOM/Generated/WebTransportConnectionStats.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from webtransport (webref). Do not edit.
module JSDOM.Generated.WebTransportConnectionStats
(newWebTransportConnectionStats, setBytesSent, getBytesSent, getBytesSentUnsafe, getBytesSentUnchecked, setBytesSentOverhead, getBytesSentOverhead, getBytesSentOverheadUnsafe, getBytesSentOverheadUnchecked, setBytesAcknowledged, getBytesAcknowledged, getBytesAcknowledgedUnsafe, getBytesAcknowledgedUnchecked, setPacketsSent, getPacketsSent, getPacketsSentUnsafe, getPacketsSentUnchecked, setBytesLost, getBytesLost, getBytesLostUnsafe, getBytesLostUnchecked, setPacketsLost, getPacketsLost, getPacketsLostUnsafe, getPacketsLostUnchecked, setBytesReceived, getBytesReceived, getBytesReceivedUnsafe, getBytesReceivedUnchecked, setPacketsReceived, getPacketsReceived, getPacketsReceivedUnsafe, getPacketsReceivedUnchecked, setSmoothedRtt, getSmoothedRtt, getSmoothedRttUnsafe, getSmoothedRttUnchecked, setRttVariation, getRttVariation, getRttVariationUnsafe, getRttVariationUnchecked, setMinRtt, getMinRtt, getMinRttUnsafe, getMinRttUnchecked, setDatagrams, getDatagrams, setEstimatedSendRate, getEstimatedSendRate, getEstimatedSendRateUnsafe, getEstimatedSendRateUnchecked, setAtSendCapacity, getAtSendCapacity, getAtSendCapacityUnsafe, getAtSendCapacityUnchecked, WebTransportConnectionStats(..), gTypeWebTransportConnectionStats)
where
import Prelude ((.), (==), (>>=), (<$>), (++), Bool(..), Maybe(..), IO, Int, Word, Double, Float)
import qualified Prelude as P
import Control.Monad (void)
import Control.Lens.Operators ((^.))
import Language.Javascript.JSaddle (JSM, JSVal, JSString, toJSVal, valToBool, valToNumber, js, jss, jsf, jsg, new, function, asyncFunction, jsUndefined, jsNull)
import JSDOM.Types
import qualified JSDOM.Types as Types
import JSDOM.EventTargetClosures (EventName, unsafeEventName, unsafeEventNameAsync)
import JSDOM.Generated.Enums
-- | <https://w3c.github.io/webtransport/#dictdef-webtransportconnectionstats WebTransportConnectionStats specification>
newWebTransportConnectionStats :: (MonadDOM m) => WebTransportDatagramStats -> m WebTransportConnectionStats
newWebTransportConnectionStats datagrams = liftDOM ((((new (jsg "Object") () >>= \o -> (o ^. jss "datagrams" (toJSVal datagrams)) P.>> P.return o)) >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-bytessent WebTransportConnectionStats.bytesSent specification>
setBytesSent :: (MonadDOM m) => WebTransportConnectionStats -> Word53 -> m ()
setBytesSent self val = liftDOM (void (self ^. jss "bytesSent" (toJSVal val)))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-bytessent WebTransportConnectionStats.bytesSent specification>
getBytesSent :: (MonadDOM m) => WebTransportConnectionStats -> m (Maybe Word53)
getBytesSent self = liftDOM (((self ^. js "bytesSent") >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-bytessent WebTransportConnectionStats.bytesSent specification>
getBytesSentUnsafe :: (MonadDOM m, HasCallStack) => WebTransportConnectionStats -> m Word53
getBytesSentUnsafe self = liftDOM ((((self ^. js "bytesSent") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-bytessent WebTransportConnectionStats.bytesSent specification>
getBytesSentUnchecked :: (MonadDOM m) => WebTransportConnectionStats -> m Word53
getBytesSentUnchecked self = liftDOM (((self ^. js "bytesSent") >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-bytessentoverhead WebTransportConnectionStats.bytesSentOverhead specification>
setBytesSentOverhead :: (MonadDOM m) => WebTransportConnectionStats -> Word53 -> m ()
setBytesSentOverhead self val = liftDOM (void (self ^. jss "bytesSentOverhead" (toJSVal val)))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-bytessentoverhead WebTransportConnectionStats.bytesSentOverhead specification>
getBytesSentOverhead :: (MonadDOM m) => WebTransportConnectionStats -> m (Maybe Word53)
getBytesSentOverhead self = liftDOM (((self ^. js "bytesSentOverhead") >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-bytessentoverhead WebTransportConnectionStats.bytesSentOverhead specification>
getBytesSentOverheadUnsafe :: (MonadDOM m, HasCallStack) => WebTransportConnectionStats -> m Word53
getBytesSentOverheadUnsafe self = liftDOM ((((self ^. js "bytesSentOverhead") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-bytessentoverhead WebTransportConnectionStats.bytesSentOverhead specification>
getBytesSentOverheadUnchecked :: (MonadDOM m) => WebTransportConnectionStats -> m Word53
getBytesSentOverheadUnchecked self = liftDOM (((self ^. js "bytesSentOverhead") >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-bytesacknowledged WebTransportConnectionStats.bytesAcknowledged specification>
setBytesAcknowledged :: (MonadDOM m) => WebTransportConnectionStats -> Word53 -> m ()
setBytesAcknowledged self val = liftDOM (void (self ^. jss "bytesAcknowledged" (toJSVal val)))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-bytesacknowledged WebTransportConnectionStats.bytesAcknowledged specification>
getBytesAcknowledged :: (MonadDOM m) => WebTransportConnectionStats -> m (Maybe Word53)
getBytesAcknowledged self = liftDOM (((self ^. js "bytesAcknowledged") >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-bytesacknowledged WebTransportConnectionStats.bytesAcknowledged specification>
getBytesAcknowledgedUnsafe :: (MonadDOM m, HasCallStack) => WebTransportConnectionStats -> m Word53
getBytesAcknowledgedUnsafe self = liftDOM ((((self ^. js "bytesAcknowledged") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-bytesacknowledged WebTransportConnectionStats.bytesAcknowledged specification>
getBytesAcknowledgedUnchecked :: (MonadDOM m) => WebTransportConnectionStats -> m Word53
getBytesAcknowledgedUnchecked self = liftDOM (((self ^. js "bytesAcknowledged") >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-packetssent WebTransportConnectionStats.packetsSent specification>
setPacketsSent :: (MonadDOM m) => WebTransportConnectionStats -> Word53 -> m ()
setPacketsSent self val = liftDOM (void (self ^. jss "packetsSent" (toJSVal val)))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-packetssent WebTransportConnectionStats.packetsSent specification>
getPacketsSent :: (MonadDOM m) => WebTransportConnectionStats -> m (Maybe Word53)
getPacketsSent self = liftDOM (((self ^. js "packetsSent") >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-packetssent WebTransportConnectionStats.packetsSent specification>
getPacketsSentUnsafe :: (MonadDOM m, HasCallStack) => WebTransportConnectionStats -> m Word53
getPacketsSentUnsafe self = liftDOM ((((self ^. js "packetsSent") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-packetssent WebTransportConnectionStats.packetsSent specification>
getPacketsSentUnchecked :: (MonadDOM m) => WebTransportConnectionStats -> m Word53
getPacketsSentUnchecked self = liftDOM (((self ^. js "packetsSent") >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-byteslost WebTransportConnectionStats.bytesLost specification>
setBytesLost :: (MonadDOM m) => WebTransportConnectionStats -> Word53 -> m ()
setBytesLost self val = liftDOM (void (self ^. jss "bytesLost" (toJSVal val)))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-byteslost WebTransportConnectionStats.bytesLost specification>
getBytesLost :: (MonadDOM m) => WebTransportConnectionStats -> m (Maybe Word53)
getBytesLost self = liftDOM (((self ^. js "bytesLost") >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-byteslost WebTransportConnectionStats.bytesLost specification>
getBytesLostUnsafe :: (MonadDOM m, HasCallStack) => WebTransportConnectionStats -> m Word53
getBytesLostUnsafe self = liftDOM ((((self ^. js "bytesLost") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-byteslost WebTransportConnectionStats.bytesLost specification>
getBytesLostUnchecked :: (MonadDOM m) => WebTransportConnectionStats -> m Word53
getBytesLostUnchecked self = liftDOM (((self ^. js "bytesLost") >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-packetslost WebTransportConnectionStats.packetsLost specification>
setPacketsLost :: (MonadDOM m) => WebTransportConnectionStats -> Word53 -> m ()
setPacketsLost self val = liftDOM (void (self ^. jss "packetsLost" (toJSVal val)))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-packetslost WebTransportConnectionStats.packetsLost specification>
getPacketsLost :: (MonadDOM m) => WebTransportConnectionStats -> m (Maybe Word53)
getPacketsLost self = liftDOM (((self ^. js "packetsLost") >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-packetslost WebTransportConnectionStats.packetsLost specification>
getPacketsLostUnsafe :: (MonadDOM m, HasCallStack) => WebTransportConnectionStats -> m Word53
getPacketsLostUnsafe self = liftDOM ((((self ^. js "packetsLost") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-packetslost WebTransportConnectionStats.packetsLost specification>
getPacketsLostUnchecked :: (MonadDOM m) => WebTransportConnectionStats -> m Word53
getPacketsLostUnchecked self = liftDOM (((self ^. js "packetsLost") >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-bytesreceived WebTransportConnectionStats.bytesReceived specification>
setBytesReceived :: (MonadDOM m) => WebTransportConnectionStats -> Word53 -> m ()
setBytesReceived self val = liftDOM (void (self ^. jss "bytesReceived" (toJSVal val)))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-bytesreceived WebTransportConnectionStats.bytesReceived specification>
getBytesReceived :: (MonadDOM m) => WebTransportConnectionStats -> m (Maybe Word53)
getBytesReceived self = liftDOM (((self ^. js "bytesReceived") >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-bytesreceived WebTransportConnectionStats.bytesReceived specification>
getBytesReceivedUnsafe :: (MonadDOM m, HasCallStack) => WebTransportConnectionStats -> m Word53
getBytesReceivedUnsafe self = liftDOM ((((self ^. js "bytesReceived") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-bytesreceived WebTransportConnectionStats.bytesReceived specification>
getBytesReceivedUnchecked :: (MonadDOM m) => WebTransportConnectionStats -> m Word53
getBytesReceivedUnchecked self = liftDOM (((self ^. js "bytesReceived") >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-packetsreceived WebTransportConnectionStats.packetsReceived specification>
setPacketsReceived :: (MonadDOM m) => WebTransportConnectionStats -> Word53 -> m ()
setPacketsReceived self val = liftDOM (void (self ^. jss "packetsReceived" (toJSVal val)))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-packetsreceived WebTransportConnectionStats.packetsReceived specification>
getPacketsReceived :: (MonadDOM m) => WebTransportConnectionStats -> m (Maybe Word53)
getPacketsReceived self = liftDOM (((self ^. js "packetsReceived") >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-packetsreceived WebTransportConnectionStats.packetsReceived specification>
getPacketsReceivedUnsafe :: (MonadDOM m, HasCallStack) => WebTransportConnectionStats -> m Word53
getPacketsReceivedUnsafe self = liftDOM ((((self ^. js "packetsReceived") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-packetsreceived WebTransportConnectionStats.packetsReceived specification>
getPacketsReceivedUnchecked :: (MonadDOM m) => WebTransportConnectionStats -> m Word53
getPacketsReceivedUnchecked self = liftDOM (((self ^. js "packetsReceived") >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-smoothedrtt WebTransportConnectionStats.smoothedRtt specification>
setSmoothedRtt :: (MonadDOM m) => WebTransportConnectionStats -> Double -> m ()
setSmoothedRtt self val = liftDOM (void (self ^. jss "smoothedRtt" (toJSVal val)))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-smoothedrtt WebTransportConnectionStats.smoothedRtt specification>
getSmoothedRtt :: (MonadDOM m) => WebTransportConnectionStats -> m (Maybe Double)
getSmoothedRtt self = liftDOM (((self ^. js "smoothedRtt") >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-smoothedrtt WebTransportConnectionStats.smoothedRtt specification>
getSmoothedRttUnsafe :: (MonadDOM m, HasCallStack) => WebTransportConnectionStats -> m Double
getSmoothedRttUnsafe self = liftDOM ((((self ^. js "smoothedRtt") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-smoothedrtt WebTransportConnectionStats.smoothedRtt specification>
getSmoothedRttUnchecked :: (MonadDOM m) => WebTransportConnectionStats -> m Double
getSmoothedRttUnchecked self = liftDOM (((self ^. js "smoothedRtt") >>= valToNumber))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-rttvariation WebTransportConnectionStats.rttVariation specification>
setRttVariation :: (MonadDOM m) => WebTransportConnectionStats -> Double -> m ()
setRttVariation self val = liftDOM (void (self ^. jss "rttVariation" (toJSVal val)))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-rttvariation WebTransportConnectionStats.rttVariation specification>
getRttVariation :: (MonadDOM m) => WebTransportConnectionStats -> m (Maybe Double)
getRttVariation self = liftDOM (((self ^. js "rttVariation") >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-rttvariation WebTransportConnectionStats.rttVariation specification>
getRttVariationUnsafe :: (MonadDOM m, HasCallStack) => WebTransportConnectionStats -> m Double
getRttVariationUnsafe self = liftDOM ((((self ^. js "rttVariation") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-rttvariation WebTransportConnectionStats.rttVariation specification>
getRttVariationUnchecked :: (MonadDOM m) => WebTransportConnectionStats -> m Double
getRttVariationUnchecked self = liftDOM (((self ^. js "rttVariation") >>= valToNumber))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-minrtt WebTransportConnectionStats.minRtt specification>
setMinRtt :: (MonadDOM m) => WebTransportConnectionStats -> Double -> m ()
setMinRtt self val = liftDOM (void (self ^. jss "minRtt" (toJSVal val)))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-minrtt WebTransportConnectionStats.minRtt specification>
getMinRtt :: (MonadDOM m) => WebTransportConnectionStats -> m (Maybe Double)
getMinRtt self = liftDOM (((self ^. js "minRtt") >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-minrtt WebTransportConnectionStats.minRtt specification>
getMinRttUnsafe :: (MonadDOM m, HasCallStack) => WebTransportConnectionStats -> m Double
getMinRttUnsafe self = liftDOM ((((self ^. js "minRtt") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-minrtt WebTransportConnectionStats.minRtt specification>
getMinRttUnchecked :: (MonadDOM m) => WebTransportConnectionStats -> m Double
getMinRttUnchecked self = liftDOM (((self ^. js "minRtt") >>= valToNumber))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-datagrams WebTransportConnectionStats.datagrams specification>
setDatagrams :: (MonadDOM m) => WebTransportConnectionStats -> WebTransportDatagramStats -> m ()
setDatagrams self val = liftDOM (void (self ^. jss "datagrams" (toJSVal val)))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-datagrams WebTransportConnectionStats.datagrams specification>
getDatagrams :: (MonadDOM m) => WebTransportConnectionStats -> m WebTransportDatagramStats
getDatagrams self = liftDOM (((self ^. js "datagrams") >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-estimatedsendrate WebTransportConnectionStats.estimatedSendRate specification>
setEstimatedSendRate :: (MonadDOM m) => WebTransportConnectionStats -> Maybe Word53 -> m ()
setEstimatedSendRate self val = liftDOM (void (self ^. jss "estimatedSendRate" (toJSVal val)))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-estimatedsendrate WebTransportConnectionStats.estimatedSendRate specification>
getEstimatedSendRate :: (MonadDOM m) => WebTransportConnectionStats -> m (Maybe Word53)
getEstimatedSendRate self = liftDOM (((self ^. js "estimatedSendRate") >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-estimatedsendrate WebTransportConnectionStats.estimatedSendRate specification>
getEstimatedSendRateUnsafe :: (MonadDOM m, HasCallStack) => WebTransportConnectionStats -> m Word53
getEstimatedSendRateUnsafe self = liftDOM ((((self ^. js "estimatedSendRate") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-estimatedsendrate WebTransportConnectionStats.estimatedSendRate specification>
getEstimatedSendRateUnchecked :: (MonadDOM m) => WebTransportConnectionStats -> m Word53
getEstimatedSendRateUnchecked self = liftDOM (((self ^. js "estimatedSendRate") >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-atsendcapacity WebTransportConnectionStats.atSendCapacity specification>
setAtSendCapacity :: (MonadDOM m) => WebTransportConnectionStats -> Bool -> m ()
setAtSendCapacity self val = liftDOM (void (self ^. jss "atSendCapacity" (toJSVal val)))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-atsendcapacity WebTransportConnectionStats.atSendCapacity specification>
getAtSendCapacity :: (MonadDOM m) => WebTransportConnectionStats -> m (Maybe Bool)
getAtSendCapacity self = liftDOM (((self ^. js "atSendCapacity") >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-atsendcapacity WebTransportConnectionStats.atSendCapacity specification>
getAtSendCapacityUnsafe :: (MonadDOM m, HasCallStack) => WebTransportConnectionStats -> m Bool
getAtSendCapacityUnsafe self = liftDOM ((((self ^. js "atSendCapacity") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webtransport/#dom-webtransportconnectionstats-atsendcapacity WebTransportConnectionStats.atSendCapacity specification>
getAtSendCapacityUnchecked :: (MonadDOM m) => WebTransportConnectionStats -> m Bool
getAtSendCapacityUnchecked self = liftDOM (((self ^. js "atSendCapacity") >>= valToBool))