jsaddle-dom-0.10.0.0: src/JSDOM/Generated/SVGAnimationElement.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from svg-animations (webref). Do not edit.
module JSDOM.Generated.SVGAnimationElement
(beginElement, beginElementAt, endElement, endElementAt, getCurrentTime, getCurrentTime_, getSimpleDuration, getSimpleDuration_, getStartTime, getStartTime_, getTargetElement, getTargetElementUnsafe, getTargetElementUnchecked, SVGAnimationElement(..), gTypeSVGAnimationElement, IsSVGAnimationElement, toSVGAnimationElement)
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://developer.mozilla.org/docs/Web/API/SVGAnimationElement/beginElement MDN SVGAnimationElement.beginElement documentation>
beginElement :: (MonadDOM m, IsSVGAnimationElement self) => self -> m ()
beginElement self = liftDOM (void ((Types.toSVGAnimationElement self) ^. jsf "beginElement" ()))
-- | <https://developer.mozilla.org/docs/Web/API/SVGAnimationElement/beginElementAt MDN SVGAnimationElement.beginElementAt documentation>
beginElementAt :: (MonadDOM m, IsSVGAnimationElement self) => self -> Float -> m ()
beginElementAt self offset = liftDOM (void ((Types.toSVGAnimationElement self) ^. jsf "beginElementAt" [toJSVal offset]))
-- | <https://developer.mozilla.org/docs/Web/API/SVGAnimationElement/endElement MDN SVGAnimationElement.endElement documentation>
endElement :: (MonadDOM m, IsSVGAnimationElement self) => self -> m ()
endElement self = liftDOM (void ((Types.toSVGAnimationElement self) ^. jsf "endElement" ()))
-- | <https://developer.mozilla.org/docs/Web/API/SVGAnimationElement/endElementAt MDN SVGAnimationElement.endElementAt documentation>
endElementAt :: (MonadDOM m, IsSVGAnimationElement self) => self -> Float -> m ()
endElementAt self offset = liftDOM (void ((Types.toSVGAnimationElement self) ^. jsf "endElementAt" [toJSVal offset]))
-- | <https://developer.mozilla.org/docs/Web/API/SVGAnimationElement/getCurrentTime MDN SVGAnimationElement.getCurrentTime documentation>
getCurrentTime :: (MonadDOM m, IsSVGAnimationElement self) => self -> m Float
getCurrentTime self = liftDOM ((P.realToFrac <$> (((Types.toSVGAnimationElement self) ^. jsf "getCurrentTime" ()) >>= valToNumber)))
-- | <https://developer.mozilla.org/docs/Web/API/SVGAnimationElement/getCurrentTime MDN SVGAnimationElement.getCurrentTime documentation>
getCurrentTime_ :: (MonadDOM m, IsSVGAnimationElement self) => self -> m ()
getCurrentTime_ self = liftDOM (void ((Types.toSVGAnimationElement self) ^. jsf "getCurrentTime" ()))
-- | <https://developer.mozilla.org/docs/Web/API/SVGAnimationElement/getSimpleDuration MDN SVGAnimationElement.getSimpleDuration documentation>
getSimpleDuration :: (MonadDOM m, IsSVGAnimationElement self) => self -> m Float
getSimpleDuration self = liftDOM ((P.realToFrac <$> (((Types.toSVGAnimationElement self) ^. jsf "getSimpleDuration" ()) >>= valToNumber)))
-- | <https://developer.mozilla.org/docs/Web/API/SVGAnimationElement/getSimpleDuration MDN SVGAnimationElement.getSimpleDuration documentation>
getSimpleDuration_ :: (MonadDOM m, IsSVGAnimationElement self) => self -> m ()
getSimpleDuration_ self = liftDOM (void ((Types.toSVGAnimationElement self) ^. jsf "getSimpleDuration" ()))
-- | <https://developer.mozilla.org/docs/Web/API/SVGAnimationElement/getStartTime MDN SVGAnimationElement.getStartTime documentation>
getStartTime :: (MonadDOM m, IsSVGAnimationElement self) => self -> m Float
getStartTime self = liftDOM ((P.realToFrac <$> (((Types.toSVGAnimationElement self) ^. jsf "getStartTime" ()) >>= valToNumber)))
-- | <https://developer.mozilla.org/docs/Web/API/SVGAnimationElement/getStartTime MDN SVGAnimationElement.getStartTime documentation>
getStartTime_ :: (MonadDOM m, IsSVGAnimationElement self) => self -> m ()
getStartTime_ self = liftDOM (void ((Types.toSVGAnimationElement self) ^. jsf "getStartTime" ()))
-- | <https://developer.mozilla.org/docs/Web/API/SVGAnimationElement/targetElement MDN SVGAnimationElement.targetElement documentation>
getTargetElement :: (MonadDOM m, IsSVGAnimationElement self) => self -> m (Maybe SVGElement)
getTargetElement self = liftDOM ((((Types.toSVGAnimationElement self) ^. js "targetElement") >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/SVGAnimationElement/targetElement MDN SVGAnimationElement.targetElement documentation>
getTargetElementUnsafe :: (MonadDOM m, IsSVGAnimationElement self, HasCallStack) => self -> m SVGElement
getTargetElementUnsafe self = liftDOM (((((Types.toSVGAnimationElement self) ^. js "targetElement") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://developer.mozilla.org/docs/Web/API/SVGAnimationElement/targetElement MDN SVGAnimationElement.targetElement documentation>
getTargetElementUnchecked :: (MonadDOM m, IsSVGAnimationElement self) => self -> m SVGElement
getTargetElementUnchecked self = liftDOM ((((Types.toSVGAnimationElement self) ^. js "targetElement") >>= fromJSValUnchecked))