ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/PerformanceObserverInit.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.PerformanceObserverInit
(js_newPerformanceObserverInit, js_setEntryTypes, js_getEntryTypes, js_setType, js_getType, js_setBuffered, js_getBuffered, js_setDurationThreshold, js_getDurationThreshold, newPerformanceObserverInit, setEntryTypes, getEntryTypes, getEntryTypesUnsafe, getEntryTypesUnchecked, setType, getType, getTypeUnsafe, getTypeUnchecked, setBuffered, getBuffered, getBufferedUnsafe, getBufferedUnchecked, setDurationThreshold, getDurationThreshold, getDurationThresholdUnsafe, getDurationThresholdUnchecked, PerformanceObserverInit(..), gTypePerformanceObserverInit)
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_newPerformanceObserverInit :: IO PerformanceObserverInit
-- | <https://w3c.github.io/performance-timeline/#dictdef-performanceobserverinit PerformanceObserverInit specification>
newPerformanceObserverInit :: (MonadDOM m) => m PerformanceObserverInit
newPerformanceObserverInit = liftDOM ((js_newPerformanceObserverInit))
foreign import javascript safe "(($1, $2) => { $1[\"entryTypes\"] = $2; })"
js_setEntryTypes :: PerformanceObserverInit -> JSVal -> IO ()
-- | <https://w3c.github.io/performance-timeline/#dom-performanceobserverinit-entrytypes PerformanceObserverInit.entryTypes specification>
setEntryTypes :: (MonadDOM m, ToJSString val) => PerformanceObserverInit -> [val] -> m ()
setEntryTypes self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setEntryTypes (self) a2')))
foreign import javascript unsafe "(($1) => { return $1[\"entryTypes\"]; })"
js_getEntryTypes :: PerformanceObserverInit -> IO JSVal
-- | <https://w3c.github.io/performance-timeline/#dom-performanceobserverinit-entrytypes PerformanceObserverInit.entryTypes specification>
getEntryTypes :: (MonadDOM m, FromJSString result) => PerformanceObserverInit -> m (Maybe [result])
getEntryTypes self = liftDOM (((js_getEntryTypes (self)) >>= fromJSValUnchecked))
-- | <https://w3c.github.io/performance-timeline/#dom-performanceobserverinit-entrytypes PerformanceObserverInit.entryTypes specification>
getEntryTypesUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => PerformanceObserverInit -> m [result]
getEntryTypesUnsafe self = liftDOM ((((js_getEntryTypes (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/performance-timeline/#dom-performanceobserverinit-entrytypes PerformanceObserverInit.entryTypes specification>
getEntryTypesUnchecked :: (MonadDOM m, FromJSString result) => PerformanceObserverInit -> m [result]
getEntryTypesUnchecked self = liftDOM (((js_getEntryTypes (self)) >>= fromJSValUnchecked))
foreign import javascript safe "(($1, $2) => { $1[\"type\"] = $2; })"
js_setType :: PerformanceObserverInit -> JSString -> IO ()
-- | <https://w3c.github.io/performance-timeline/#dom-performanceobserverinit-type PerformanceObserverInit.type specification>
setType :: (MonadDOM m, ToJSString val) => PerformanceObserverInit -> val -> m ()
setType self val = liftDOM (void ((js_setType (self) (toJSString val))))
foreign import javascript unsafe "(($1) => { return $1[\"type\"]; })"
js_getType :: PerformanceObserverInit -> IO JSVal
-- | <https://w3c.github.io/performance-timeline/#dom-performanceobserverinit-type PerformanceObserverInit.type specification>
getType :: (MonadDOM m, FromJSString result) => PerformanceObserverInit -> m (Maybe result)
getType self = liftDOM (((fromMaybeJSString . Nullable) <$> (js_getType (self))))
-- | <https://w3c.github.io/performance-timeline/#dom-performanceobserverinit-type PerformanceObserverInit.type specification>
getTypeUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => PerformanceObserverInit -> m result
getTypeUnsafe self = liftDOM ((((fromMaybeJSString . Nullable) <$> (js_getType (self))) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/performance-timeline/#dom-performanceobserverinit-type PerformanceObserverInit.type specification>
getTypeUnchecked :: (MonadDOM m, FromJSString result) => PerformanceObserverInit -> m result
getTypeUnchecked self = liftDOM ((pFromJSVal <$> (js_getType (self))))
foreign import javascript safe "(($1, $2) => { $1[\"buffered\"] = $2; })"
js_setBuffered :: PerformanceObserverInit -> Bool -> IO ()
-- | <https://w3c.github.io/performance-timeline/#dom-performanceobserverinit-buffered PerformanceObserverInit.buffered specification>
setBuffered :: (MonadDOM m) => PerformanceObserverInit -> Bool -> m ()
setBuffered self val = liftDOM (void ((js_setBuffered (self) (val))))
foreign import javascript unsafe "(($1) => { return $1[\"buffered\"]; })"
js_getBuffered :: PerformanceObserverInit -> IO JSVal
-- | <https://w3c.github.io/performance-timeline/#dom-performanceobserverinit-buffered PerformanceObserverInit.buffered specification>
getBuffered :: (MonadDOM m) => PerformanceObserverInit -> m (Maybe Bool)
getBuffered self = liftDOM (((js_getBuffered (self)) >>= fromJSValUnchecked))
-- | <https://w3c.github.io/performance-timeline/#dom-performanceobserverinit-buffered PerformanceObserverInit.buffered specification>
getBufferedUnsafe :: (MonadDOM m, HasCallStack) => PerformanceObserverInit -> m Bool
getBufferedUnsafe self = liftDOM ((((js_getBuffered (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/performance-timeline/#dom-performanceobserverinit-buffered PerformanceObserverInit.buffered specification>
getBufferedUnchecked :: (MonadDOM m) => PerformanceObserverInit -> m Bool
getBufferedUnchecked self = liftDOM ((pFromJSVal <$> (js_getBuffered (self))))
foreign import javascript safe "(($1, $2) => { $1[\"durationThreshold\"] = $2; })"
js_setDurationThreshold :: PerformanceObserverInit -> Double -> IO ()
-- | <https://w3c.github.io/event-timing/#dom-performanceobserverinit-durationthreshold PerformanceObserverInit.durationThreshold specification>
setDurationThreshold :: (MonadDOM m) => PerformanceObserverInit -> Double -> m ()
setDurationThreshold self val = liftDOM (void ((js_setDurationThreshold (self) (val))))
foreign import javascript unsafe "(($1) => { return $1[\"durationThreshold\"]; })"
js_getDurationThreshold :: PerformanceObserverInit -> IO JSVal
-- | <https://w3c.github.io/event-timing/#dom-performanceobserverinit-durationthreshold PerformanceObserverInit.durationThreshold specification>
getDurationThreshold :: (MonadDOM m) => PerformanceObserverInit -> m (Maybe Double)
getDurationThreshold self = liftDOM (((js_getDurationThreshold (self)) >>= fromJSValUnchecked))
-- | <https://w3c.github.io/event-timing/#dom-performanceobserverinit-durationthreshold PerformanceObserverInit.durationThreshold specification>
getDurationThresholdUnsafe :: (MonadDOM m, HasCallStack) => PerformanceObserverInit -> m Double
getDurationThresholdUnsafe self = liftDOM ((((js_getDurationThreshold (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/event-timing/#dom-performanceobserverinit-durationthreshold PerformanceObserverInit.durationThreshold specification>
getDurationThresholdUnchecked :: (MonadDOM m) => PerformanceObserverInit -> m Double
getDurationThresholdUnchecked self = liftDOM ((pFromJSVal <$> (js_getDurationThreshold (self))))