packages feed

jsaddle-dom-0.10.0.0: src/JSDOM/Generated/PerformanceEntry.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.PerformanceEntry
       (toJSON, toJSON_, getName, getEntryType, getStartTime, getDuration, PerformanceEntry(..), gTypePerformanceEntry, IsPerformanceEntry, toPerformanceEntry)
       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/PerformanceEntry/toJSON MDN PerformanceEntry.toJSON documentation>
toJSON :: (MonadDOM m, IsPerformanceEntry self) => self -> m GObject
toJSON self = liftDOM ((((Types.toPerformanceEntry self) ^. jsf "toJSON" ()) >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/PerformanceEntry/toJSON MDN PerformanceEntry.toJSON documentation>
toJSON_ :: (MonadDOM m, IsPerformanceEntry self) => self -> m ()
toJSON_ self = liftDOM (void ((Types.toPerformanceEntry self) ^. jsf "toJSON" ()))

-- | <https://developer.mozilla.org/docs/Web/API/PerformanceEntry/name MDN PerformanceEntry.name documentation>
getName :: (MonadDOM m, IsPerformanceEntry self, FromJSString result) => self -> m result
getName self = liftDOM ((((Types.toPerformanceEntry self) ^. js "name") >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/PerformanceEntry/entryType MDN PerformanceEntry.entryType documentation>
getEntryType :: (MonadDOM m, IsPerformanceEntry self, FromJSString result) => self -> m result
getEntryType self = liftDOM ((((Types.toPerformanceEntry self) ^. js "entryType") >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/PerformanceEntry/startTime MDN PerformanceEntry.startTime documentation>
getStartTime :: (MonadDOM m, IsPerformanceEntry self) => self -> m Double
getStartTime self = liftDOM ((((Types.toPerformanceEntry self) ^. js "startTime") >>= valToNumber))

-- | <https://developer.mozilla.org/docs/Web/API/PerformanceEntry/duration MDN PerformanceEntry.duration documentation>
getDuration :: (MonadDOM m, IsPerformanceEntry self) => self -> m Double
getDuration self = liftDOM ((((Types.toPerformanceEntry self) ^. js "duration") >>= valToNumber))