packages feed

ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/AnimationTimeline.hs

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from web-animations-1 (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.AnimationTimeline
       (js_getCurrentTime, js_getDuration, getCurrentTime, getCurrentTimeUnsafe, getCurrentTimeUnchecked, getDuration, getDurationUnsafe, getDurationUnchecked, AnimationTimeline(..), gTypeAnimationTimeline, IsAnimationTimeline, toAnimationTimeline)
       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 unsafe "(($1) => { return $1[\"currentTime\"]; })"
        js_getCurrentTime :: AnimationTimeline -> IO JSVal
-- | <https://developer.mozilla.org/docs/Web/API/AnimationTimeline/currentTime MDN AnimationTimeline.currentTime documentation>
getCurrentTime :: (MonadDOM m, IsAnimationTimeline self) => self -> m (Maybe CSSNumberish)
getCurrentTime self = liftDOM (((js_getCurrentTime ((Types.toAnimationTimeline self))) >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/AnimationTimeline/currentTime MDN AnimationTimeline.currentTime documentation>
getCurrentTimeUnsafe :: (MonadDOM m, IsAnimationTimeline self, HasCallStack) => self -> m CSSNumberish
getCurrentTimeUnsafe self = liftDOM ((((js_getCurrentTime ((Types.toAnimationTimeline self))) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://developer.mozilla.org/docs/Web/API/AnimationTimeline/currentTime MDN AnimationTimeline.currentTime documentation>
getCurrentTimeUnchecked :: (MonadDOM m, IsAnimationTimeline self) => self -> m CSSNumberish
getCurrentTimeUnchecked self = liftDOM ((pFromJSVal <$> (js_getCurrentTime ((Types.toAnimationTimeline self)))))

foreign import javascript unsafe "(($1) => { return $1[\"duration\"]; })"
        js_getDuration :: AnimationTimeline -> IO JSVal
-- | <https://developer.mozilla.org/docs/Web/API/AnimationTimeline/duration MDN AnimationTimeline.duration documentation>
getDuration :: (MonadDOM m, IsAnimationTimeline self) => self -> m (Maybe CSSNumberish)
getDuration self = liftDOM (((js_getDuration ((Types.toAnimationTimeline self))) >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/AnimationTimeline/duration MDN AnimationTimeline.duration documentation>
getDurationUnsafe :: (MonadDOM m, IsAnimationTimeline self, HasCallStack) => self -> m CSSNumberish
getDurationUnsafe self = liftDOM ((((js_getDuration ((Types.toAnimationTimeline self))) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://developer.mozilla.org/docs/Web/API/AnimationTimeline/duration MDN AnimationTimeline.duration documentation>
getDurationUnchecked :: (MonadDOM m, IsAnimationTimeline self) => self -> m CSSNumberish
getDurationUnchecked self = liftDOM ((pFromJSVal <$> (js_getDuration ((Types.toAnimationTimeline self)))))