{-# LANGUAGE PatternSynonyms #-}
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module JSDOM.Generated.ByteLengthQueuingStrategy
       (newByteLengthQueuingStrategy, size, size_,
        ByteLengthQueuingStrategy(..), gTypeByteLengthQueuingStrategy)
       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, unsafeEventNameAsync)
import JSDOM.Enums

-- | <https://developer.mozilla.org/en-US/docs/Web/API/ByteLengthQueuingStrategy Mozilla ByteLengthQueuingStrategy documentation> 
newByteLengthQueuingStrategy ::
                             (MonadDOM m) => m ByteLengthQueuingStrategy
newByteLengthQueuingStrategy :: forall (m :: * -> *). MonadDOM m => m ByteLengthQueuingStrategy
newByteLengthQueuingStrategy
  = DOM ByteLengthQueuingStrategy -> m ByteLengthQueuingStrategy
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM
      (JSVal -> ByteLengthQueuingStrategy
ByteLengthQueuingStrategy (JSVal -> ByteLengthQueuingStrategy)
-> JSM JSVal -> DOM ByteLengthQueuingStrategy
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$>
         JSM JSVal -> () -> JSM JSVal
forall constructor args.
(MakeObject constructor, MakeArgs args) =>
constructor -> args -> JSM JSVal
new (String -> JSM JSVal
forall a. ToJSString a => a -> JSM JSVal
jsg String
"ByteLengthQueuingStrategy") ())

-- | <https://developer.mozilla.org/en-US/docs/Web/API/ByteLengthQueuingStrategy.size Mozilla ByteLengthQueuingStrategy.size documentation> 
size :: (MonadDOM m) => ByteLengthQueuingStrategy -> m Double
size :: forall (m :: * -> *).
MonadDOM m =>
ByteLengthQueuingStrategy -> m Double
size ByteLengthQueuingStrategy
self = DOM Double -> m Double
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM ((ByteLengthQueuingStrategy
self ByteLengthQueuingStrategy
-> Getting (JSM JSVal) ByteLengthQueuingStrategy (JSM JSVal)
-> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> () -> JSF
forall name args.
(ToJSString name, MakeArgs args) =>
name -> args -> JSF
jsf String
"size" ()) JSM JSVal -> (JSVal -> DOM Double) -> DOM Double
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> DOM Double
forall value. ToJSVal value => value -> DOM Double
valToNumber)

-- | <https://developer.mozilla.org/en-US/docs/Web/API/ByteLengthQueuingStrategy.size Mozilla ByteLengthQueuingStrategy.size documentation> 
size_ :: (MonadDOM m) => ByteLengthQueuingStrategy -> m ()
size_ :: forall (m :: * -> *).
MonadDOM m =>
ByteLengthQueuingStrategy -> m ()
size_ ByteLengthQueuingStrategy
self = DOM () -> m ()
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM (JSM JSVal -> DOM ()
forall (f :: * -> *) a. Functor f => f a -> f ()
void (ByteLengthQueuingStrategy
self ByteLengthQueuingStrategy
-> Getting (JSM JSVal) ByteLengthQueuingStrategy (JSM JSVal)
-> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> () -> JSF
forall name args.
(ToJSString name, MakeArgs args) =>
name -> args -> JSF
jsf String
"size" ()))