packages feed

ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/PerformanceObserverCallbackOptions.hs

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from performance-timeline (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.PerformanceObserverCallbackOptions
       (js_newPerformanceObserverCallbackOptions, js_setDroppedEntriesCount, js_getDroppedEntriesCount, newPerformanceObserverCallbackOptions, setDroppedEntriesCount, getDroppedEntriesCount, getDroppedEntriesCountUnsafe, getDroppedEntriesCountUnchecked, PerformanceObserverCallbackOptions(..), gTypePerformanceObserverCallbackOptions)
       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_newPerformanceObserverCallbackOptions :: IO PerformanceObserverCallbackOptions
-- | <https://w3c.github.io/performance-timeline/#dictdef-performanceobservercallbackoptions PerformanceObserverCallbackOptions specification>
newPerformanceObserverCallbackOptions :: (MonadDOM m) => m PerformanceObserverCallbackOptions
newPerformanceObserverCallbackOptions = liftDOM ((js_newPerformanceObserverCallbackOptions))

foreign import javascript safe "(($1, $2) => { $1[\"droppedEntriesCount\"] = $2; })"
        js_setDroppedEntriesCount :: PerformanceObserverCallbackOptions -> JSVal -> IO ()
-- | <https://w3c.github.io/performance-timeline/#dom-performanceobservercallbackoptions-droppedentriescount PerformanceObserverCallbackOptions.droppedEntriesCount specification>
setDroppedEntriesCount :: (MonadDOM m) => PerformanceObserverCallbackOptions -> Word53 -> m ()
setDroppedEntriesCount self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setDroppedEntriesCount (self) a2')))

foreign import javascript unsafe "(($1) => { return $1[\"droppedEntriesCount\"]; })"
        js_getDroppedEntriesCount :: PerformanceObserverCallbackOptions -> IO JSVal
-- | <https://w3c.github.io/performance-timeline/#dom-performanceobservercallbackoptions-droppedentriescount PerformanceObserverCallbackOptions.droppedEntriesCount specification>
getDroppedEntriesCount :: (MonadDOM m) => PerformanceObserverCallbackOptions -> m (Maybe Word53)
getDroppedEntriesCount self = liftDOM (((js_getDroppedEntriesCount (self)) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/performance-timeline/#dom-performanceobservercallbackoptions-droppedentriescount PerformanceObserverCallbackOptions.droppedEntriesCount specification>
getDroppedEntriesCountUnsafe :: (MonadDOM m, HasCallStack) => PerformanceObserverCallbackOptions -> m Word53
getDroppedEntriesCountUnsafe self = liftDOM ((((js_getDroppedEntriesCount (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/performance-timeline/#dom-performanceobservercallbackoptions-droppedentriescount PerformanceObserverCallbackOptions.droppedEntriesCount specification>
getDroppedEntriesCountUnchecked :: (MonadDOM m) => PerformanceObserverCallbackOptions -> m Word53
getDroppedEntriesCountUnchecked self = liftDOM ((pFromJSVal <$> (js_getDroppedEntriesCount (self))))