ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/PerformanceMark.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from user-timing (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.PerformanceMark
(js_newPerformanceMark, js_getDetail, newPerformanceMark, getDetail, PerformanceMark(..), gTypePerformanceMark)
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 "(($1, $2) => { return new globalThis[\"PerformanceMark\"]($1, $2); })"
js_newPerformanceMark :: JSString -> JSVal -> IO PerformanceMark
-- | <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 (((P.maybe (P.return jsUndefined) toJSVal markOptions) >>= \a2' -> js_newPerformanceMark (toJSString markName) a2'))
foreign import javascript unsafe "(($1) => { return $1[\"detail\"]; })"
js_getDetail :: PerformanceMark -> IO JSVal
-- | <https://developer.mozilla.org/docs/Web/API/PerformanceMark/detail MDN PerformanceMark.detail documentation>
getDetail :: (MonadDOM m) => PerformanceMark -> m JSVal
getDetail self = liftDOM ((js_getDetail (self)))