packages feed

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

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from web-animations-2 (webref). Do not edit.
module JSDOM.Generated.AnimationPlaybackEventInit
       (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 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://drafts.csswg.org/web-animations-2/#dictdef-animationplaybackeventinit AnimationPlaybackEventInit specification>
newAnimationPlaybackEventInit :: (MonadDOM m) => m AnimationPlaybackEventInit
newAnimationPlaybackEventInit = liftDOM ((((new (jsg "Object") () >>= \o -> P.return o)) >>= fromJSValUnchecked))

-- | <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 (self ^. jss "currentTime" (toJSVal val)))

-- | <https://drafts.csswg.org/web-animations-2/#dom-animationplaybackeventinit-currenttime AnimationPlaybackEventInit.currentTime specification>
getCurrentTime :: (MonadDOM m) => AnimationPlaybackEventInit -> m (Maybe CSSNumberish)
getCurrentTime self = liftDOM (((self ^. js "currentTime") >>= fromJSValUnchecked))

-- | <https://drafts.csswg.org/web-animations-2/#dom-animationplaybackeventinit-currenttime AnimationPlaybackEventInit.currentTime specification>
getCurrentTimeUnsafe :: (MonadDOM m, HasCallStack) => AnimationPlaybackEventInit -> m CSSNumberish
getCurrentTimeUnsafe self = liftDOM ((((self ^. js "currentTime") >>= 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 (((self ^. js "currentTime") >>= fromJSValUnchecked))

-- | <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 (self ^. jss "timelineTime" (toJSVal val)))

-- | <https://drafts.csswg.org/web-animations-2/#dom-animationplaybackeventinit-timelinetime AnimationPlaybackEventInit.timelineTime specification>
getTimelineTime :: (MonadDOM m) => AnimationPlaybackEventInit -> m (Maybe CSSNumberish)
getTimelineTime self = liftDOM (((self ^. js "timelineTime") >>= fromJSValUnchecked))

-- | <https://drafts.csswg.org/web-animations-2/#dom-animationplaybackeventinit-timelinetime AnimationPlaybackEventInit.timelineTime specification>
getTimelineTimeUnsafe :: (MonadDOM m, HasCallStack) => AnimationPlaybackEventInit -> m CSSNumberish
getTimelineTimeUnsafe self = liftDOM ((((self ^. js "timelineTime") >>= 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 (((self ^. js "timelineTime") >>= fromJSValUnchecked))