packages feed

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

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from css-typed-om-1 (webref). Do not edit.
module JSDOM.Generated.CSSTransformValue
       (newCSSTransformValue, toMatrix, toMatrix_, getLength, getIs2D, CSSTransformValue(..), gTypeCSSTransformValue)
       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/CSSTransformValue/CSSTransformValue MDN CSSTransformValue. documentation>
newCSSTransformValue :: (MonadDOM m, IsCSSTransformComponent transforms) => [transforms] -> m CSSTransformValue
newCSSTransformValue transforms = liftDOM (((new (jsg "CSSTransformValue") [toJSVal transforms]) >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/CSSTransformValue/toMatrix MDN CSSTransformValue.toMatrix documentation>
toMatrix :: (MonadDOM m) => CSSTransformValue -> m DOMMatrix
toMatrix self = liftDOM (((self ^. jsf "toMatrix" ()) >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/CSSTransformValue/toMatrix MDN CSSTransformValue.toMatrix documentation>
toMatrix_ :: (MonadDOM m) => CSSTransformValue -> m ()
toMatrix_ self = liftDOM (void (self ^. jsf "toMatrix" ()))

-- | <https://developer.mozilla.org/docs/Web/API/CSSTransformValue/length MDN CSSTransformValue.length documentation>
getLength :: (MonadDOM m) => CSSTransformValue -> m Word
getLength self = liftDOM ((P.round <$> ((self ^. js "length") >>= valToNumber)))

-- | <https://developer.mozilla.org/docs/Web/API/CSSTransformValue/is2D MDN CSSTransformValue.is2D documentation>
getIs2D :: (MonadDOM m) => CSSTransformValue -> m Bool
getIs2D self = liftDOM (((self ^. js "is2D") >>= valToBool))