jsaddle-dom-0.10.0.0: src/JSDOM/Generated/PerformanceObserverCallbackOptions.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from performance-timeline (webref). Do not edit.
module JSDOM.Generated.PerformanceObserverCallbackOptions
(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 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/performance-timeline/#dictdef-performanceobservercallbackoptions PerformanceObserverCallbackOptions specification>
newPerformanceObserverCallbackOptions :: (MonadDOM m) => m PerformanceObserverCallbackOptions
newPerformanceObserverCallbackOptions = liftDOM ((((new (jsg "Object") () >>= \o -> P.return o)) >>= fromJSValUnchecked))
-- | <https://w3c.github.io/performance-timeline/#dom-performanceobservercallbackoptions-droppedentriescount PerformanceObserverCallbackOptions.droppedEntriesCount specification>
setDroppedEntriesCount :: (MonadDOM m) => PerformanceObserverCallbackOptions -> Word53 -> m ()
setDroppedEntriesCount self val = liftDOM (void (self ^. jss "droppedEntriesCount" (toJSVal val)))
-- | <https://w3c.github.io/performance-timeline/#dom-performanceobservercallbackoptions-droppedentriescount PerformanceObserverCallbackOptions.droppedEntriesCount specification>
getDroppedEntriesCount :: (MonadDOM m) => PerformanceObserverCallbackOptions -> m (Maybe Word53)
getDroppedEntriesCount self = liftDOM (((self ^. js "droppedEntriesCount") >>= fromJSValUnchecked))
-- | <https://w3c.github.io/performance-timeline/#dom-performanceobservercallbackoptions-droppedentriescount PerformanceObserverCallbackOptions.droppedEntriesCount specification>
getDroppedEntriesCountUnsafe :: (MonadDOM m, HasCallStack) => PerformanceObserverCallbackOptions -> m Word53
getDroppedEntriesCountUnsafe self = liftDOM ((((self ^. js "droppedEntriesCount") >>= 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 (((self ^. js "droppedEntriesCount") >>= fromJSValUnchecked))