packages feed

jsaddle-dom-0.10.0.0: src/JSDOM/Generated/PerformanceMark.hs

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from user-timing (webref). Do not edit.
module JSDOM.Generated.PerformanceMark
       (newPerformanceMark, getDetail, PerformanceMark(..), gTypePerformanceMark)
       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/PerformanceMark/PerformanceMark MDN PerformanceMark. documentation>
newPerformanceMark :: (MonadDOM m, ToJSString markName) => markName -> Maybe PerformanceMarkOptions -> m PerformanceMark
newPerformanceMark markName markOptions = liftDOM (((new (jsg "PerformanceMark") [toJSVal markName, P.maybe (P.return jsUndefined) toJSVal markOptions]) >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/PerformanceMark/detail MDN PerformanceMark.detail documentation>
getDetail :: (MonadDOM m) => PerformanceMark -> m JSVal
getDetail self = liftDOM (self ^. js "detail")