jsaddle-dom-0.10.0.0: src/JSDOM/Generated/PerformanceServerTiming.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from server-timing (webref). Do not edit.
module JSDOM.Generated.PerformanceServerTiming
(toJSON, toJSON_, getName, getDuration, getDescription, PerformanceServerTiming(..), gTypePerformanceServerTiming)
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://developer.mozilla.org/docs/Web/API/PerformanceServerTiming/toJSON MDN PerformanceServerTiming.toJSON documentation>
toJSON :: (MonadDOM m) => PerformanceServerTiming -> m GObject
toJSON self = liftDOM (((self ^. jsf "toJSON" ()) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/PerformanceServerTiming/toJSON MDN PerformanceServerTiming.toJSON documentation>
toJSON_ :: (MonadDOM m) => PerformanceServerTiming -> m ()
toJSON_ self = liftDOM (void (self ^. jsf "toJSON" ()))
-- | <https://developer.mozilla.org/docs/Web/API/PerformanceServerTiming/name MDN PerformanceServerTiming.name documentation>
getName :: (MonadDOM m, FromJSString result) => PerformanceServerTiming -> m result
getName self = liftDOM (((self ^. js "name") >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/PerformanceServerTiming/duration MDN PerformanceServerTiming.duration documentation>
getDuration :: (MonadDOM m) => PerformanceServerTiming -> m Double
getDuration self = liftDOM (((self ^. js "duration") >>= valToNumber))
-- | <https://developer.mozilla.org/docs/Web/API/PerformanceServerTiming/description MDN PerformanceServerTiming.description documentation>
getDescription :: (MonadDOM m, FromJSString result) => PerformanceServerTiming -> m result
getDescription self = liftDOM (((self ^. js "description") >>= fromJSValUnchecked))