packages feed

ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/PerformanceMarkOptions.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.PerformanceMarkOptions
       (js_newPerformanceMarkOptions, js_setDetail, js_getDetail, js_setStartTime, js_getStartTime, newPerformanceMarkOptions, setDetail, getDetail, setStartTime, getStartTime, getStartTimeUnsafe, getStartTimeUnchecked, PerformanceMarkOptions(..), gTypePerformanceMarkOptions)
       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_newPerformanceMarkOptions :: IO PerformanceMarkOptions
-- | <https://w3c.github.io/user-timing/#dictdef-performancemarkoptions PerformanceMarkOptions specification>
newPerformanceMarkOptions :: (MonadDOM m) => m PerformanceMarkOptions
newPerformanceMarkOptions = liftDOM ((js_newPerformanceMarkOptions))

foreign import javascript safe "(($1, $2) => { $1[\"detail\"] = $2; })"
        js_setDetail :: PerformanceMarkOptions -> JSVal -> IO ()
-- | <https://w3c.github.io/user-timing/#dom-performancemarkoptions-detail PerformanceMarkOptions.detail specification>
setDetail :: (MonadDOM m) => PerformanceMarkOptions -> JSVal -> m ()
setDetail self val = liftDOM (void ((js_setDetail (self) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"detail\"]; })"
        js_getDetail :: PerformanceMarkOptions -> IO JSVal
-- | <https://w3c.github.io/user-timing/#dom-performancemarkoptions-detail PerformanceMarkOptions.detail specification>
getDetail :: (MonadDOM m) => PerformanceMarkOptions -> m JSVal
getDetail self = liftDOM ((js_getDetail (self)))

foreign import javascript safe "(($1, $2) => { $1[\"startTime\"] = $2; })"
        js_setStartTime :: PerformanceMarkOptions -> Double -> IO ()
-- | <https://w3c.github.io/user-timing/#dom-performancemarkoptions-starttime PerformanceMarkOptions.startTime specification>
setStartTime :: (MonadDOM m) => PerformanceMarkOptions -> Double -> m ()
setStartTime self val = liftDOM (void ((js_setStartTime (self) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"startTime\"]; })"
        js_getStartTime :: PerformanceMarkOptions -> IO JSVal
-- | <https://w3c.github.io/user-timing/#dom-performancemarkoptions-starttime PerformanceMarkOptions.startTime specification>
getStartTime :: (MonadDOM m) => PerformanceMarkOptions -> m (Maybe Double)
getStartTime self = liftDOM (((js_getStartTime (self)) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/user-timing/#dom-performancemarkoptions-starttime PerformanceMarkOptions.startTime specification>
getStartTimeUnsafe :: (MonadDOM m, HasCallStack) => PerformanceMarkOptions -> m Double
getStartTimeUnsafe self = liftDOM ((((js_getStartTime (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/user-timing/#dom-performancemarkoptions-starttime PerformanceMarkOptions.startTime specification>
getStartTimeUnchecked :: (MonadDOM m) => PerformanceMarkOptions -> m Double
getStartTimeUnchecked self = liftDOM ((pFromJSVal <$> (js_getStartTime (self))))