ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/AnimationPlaybackEventInit.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from web-animations-2 (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.AnimationPlaybackEventInit
(js_newAnimationPlaybackEventInit, js_setCurrentTime, js_getCurrentTime, js_setTimelineTime, js_getTimelineTime, newAnimationPlaybackEventInit, setCurrentTime, getCurrentTime, getCurrentTimeUnsafe, getCurrentTimeUnchecked, setTimelineTime, getTimelineTime, getTimelineTimeUnsafe, getTimelineTimeUnchecked, AnimationPlaybackEventInit(..), gTypeAnimationPlaybackEventInit)
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_newAnimationPlaybackEventInit :: IO AnimationPlaybackEventInit
-- | <https://drafts.csswg.org/web-animations-2/#dictdef-animationplaybackeventinit AnimationPlaybackEventInit specification>
newAnimationPlaybackEventInit :: (MonadDOM m) => m AnimationPlaybackEventInit
newAnimationPlaybackEventInit = liftDOM ((js_newAnimationPlaybackEventInit))
foreign import javascript safe "(($1, $2) => { $1[\"currentTime\"] = $2; })"
js_setCurrentTime :: AnimationPlaybackEventInit -> JSVal -> IO ()
-- | <https://drafts.csswg.org/web-animations-2/#dom-animationplaybackeventinit-currenttime AnimationPlaybackEventInit.currentTime specification>
setCurrentTime :: (MonadDOM m, IsCSSNumberish val) => AnimationPlaybackEventInit -> Maybe val -> m ()
setCurrentTime self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setCurrentTime (self) a2')))
foreign import javascript unsafe "(($1) => { return $1[\"currentTime\"]; })"
js_getCurrentTime :: AnimationPlaybackEventInit -> IO JSVal
-- | <https://drafts.csswg.org/web-animations-2/#dom-animationplaybackeventinit-currenttime AnimationPlaybackEventInit.currentTime specification>
getCurrentTime :: (MonadDOM m) => AnimationPlaybackEventInit -> m (Maybe CSSNumberish)
getCurrentTime self = liftDOM (((js_getCurrentTime (self)) >>= fromJSValUnchecked))
-- | <https://drafts.csswg.org/web-animations-2/#dom-animationplaybackeventinit-currenttime AnimationPlaybackEventInit.currentTime specification>
getCurrentTimeUnsafe :: (MonadDOM m, HasCallStack) => AnimationPlaybackEventInit -> m CSSNumberish
getCurrentTimeUnsafe self = liftDOM ((((js_getCurrentTime (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://drafts.csswg.org/web-animations-2/#dom-animationplaybackeventinit-currenttime AnimationPlaybackEventInit.currentTime specification>
getCurrentTimeUnchecked :: (MonadDOM m) => AnimationPlaybackEventInit -> m CSSNumberish
getCurrentTimeUnchecked self = liftDOM ((pFromJSVal <$> (js_getCurrentTime (self))))
foreign import javascript safe "(($1, $2) => { $1[\"timelineTime\"] = $2; })"
js_setTimelineTime :: AnimationPlaybackEventInit -> JSVal -> IO ()
-- | <https://drafts.csswg.org/web-animations-2/#dom-animationplaybackeventinit-timelinetime AnimationPlaybackEventInit.timelineTime specification>
setTimelineTime :: (MonadDOM m, IsCSSNumberish val) => AnimationPlaybackEventInit -> Maybe val -> m ()
setTimelineTime self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setTimelineTime (self) a2')))
foreign import javascript unsafe "(($1) => { return $1[\"timelineTime\"]; })"
js_getTimelineTime :: AnimationPlaybackEventInit -> IO JSVal
-- | <https://drafts.csswg.org/web-animations-2/#dom-animationplaybackeventinit-timelinetime AnimationPlaybackEventInit.timelineTime specification>
getTimelineTime :: (MonadDOM m) => AnimationPlaybackEventInit -> m (Maybe CSSNumberish)
getTimelineTime self = liftDOM (((js_getTimelineTime (self)) >>= fromJSValUnchecked))
-- | <https://drafts.csswg.org/web-animations-2/#dom-animationplaybackeventinit-timelinetime AnimationPlaybackEventInit.timelineTime specification>
getTimelineTimeUnsafe :: (MonadDOM m, HasCallStack) => AnimationPlaybackEventInit -> m CSSNumberish
getTimelineTimeUnsafe self = liftDOM ((((js_getTimelineTime (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://drafts.csswg.org/web-animations-2/#dom-animationplaybackeventinit-timelinetime AnimationPlaybackEventInit.timelineTime specification>
getTimelineTimeUnchecked :: (MonadDOM m) => AnimationPlaybackEventInit -> m CSSNumberish
getTimelineTimeUnchecked self = liftDOM ((pFromJSVal <$> (js_getTimelineTime (self))))