ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/ScrollTimeline.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from scroll-animations-1 (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.ScrollTimeline
(js_newScrollTimeline, js_getSource, js_getAxis, newScrollTimeline, getSource, getSourceUnsafe, getSourceUnchecked, getAxis, ScrollTimeline(..), gTypeScrollTimeline, IsScrollTimeline, toScrollTimeline)
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) => { return new globalThis[\"ScrollTimeline\"]($1); })"
js_newScrollTimeline :: JSVal -> IO ScrollTimeline
-- | <https://developer.mozilla.org/docs/Web/API/ScrollTimeline/ScrollTimeline MDN ScrollTimeline. documentation>
newScrollTimeline :: (MonadDOM m) => Maybe ScrollTimelineOptions -> m ScrollTimeline
newScrollTimeline options = liftDOM (((P.maybe (P.return jsUndefined) toJSVal options) >>= \a1' -> js_newScrollTimeline a1'))
foreign import javascript unsafe "(($1) => { return $1[\"source\"]; })"
js_getSource :: ScrollTimeline -> IO JSVal
-- | <https://developer.mozilla.org/docs/Web/API/ScrollTimeline/source MDN ScrollTimeline.source documentation>
getSource :: (MonadDOM m, IsScrollTimeline self) => self -> m (Maybe Element)
getSource self = liftDOM (((js_getSource ((Types.toScrollTimeline self))) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/ScrollTimeline/source MDN ScrollTimeline.source documentation>
getSourceUnsafe :: (MonadDOM m, IsScrollTimeline self, HasCallStack) => self -> m Element
getSourceUnsafe self = liftDOM ((((js_getSource ((Types.toScrollTimeline self))) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://developer.mozilla.org/docs/Web/API/ScrollTimeline/source MDN ScrollTimeline.source documentation>
getSourceUnchecked :: (MonadDOM m, IsScrollTimeline self) => self -> m Element
getSourceUnchecked self = liftDOM ((pFromJSVal <$> (js_getSource ((Types.toScrollTimeline self)))))
foreign import javascript unsafe "(($1) => { return $1[\"axis\"]; })"
js_getAxis :: ScrollTimeline -> IO JSVal
-- | <https://developer.mozilla.org/docs/Web/API/ScrollTimeline/axis MDN ScrollTimeline.axis documentation>
getAxis :: (MonadDOM m, IsScrollTimeline self) => self -> m ScrollAxis
getAxis self = liftDOM (((js_getAxis ((Types.toScrollTimeline self))) >>= fromJSValUnchecked))