packages feed

jsaddle-dom-0.10.0.0: src/JSDOM/Generated/CSSMatrixComponent.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.CSSMatrixComponent
       (newCSSMatrixComponent, setMatrix, getMatrix, CSSMatrixComponent(..), gTypeCSSMatrixComponent)
       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/CSSMatrixComponent/CSSMatrixComponent MDN CSSMatrixComponent. documentation>
newCSSMatrixComponent :: (MonadDOM m, IsDOMMatrixReadOnly matrix) => matrix -> Maybe CSSMatrixComponentOptions -> m CSSMatrixComponent
newCSSMatrixComponent matrix options = liftDOM (((new (jsg "CSSMatrixComponent") [toJSVal matrix, P.maybe (P.return jsUndefined) toJSVal options]) >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/CSSMatrixComponent/matrix MDN CSSMatrixComponent.matrix documentation>
setMatrix :: (MonadDOM m) => CSSMatrixComponent -> DOMMatrix -> m ()
setMatrix self val = liftDOM (void (self ^. jss "matrix" (toJSVal val)))

-- | <https://developer.mozilla.org/docs/Web/API/CSSMatrixComponent/matrix MDN CSSMatrixComponent.matrix documentation>
getMatrix :: (MonadDOM m) => CSSMatrixComponent -> m DOMMatrix
getMatrix self = liftDOM (((self ^. js "matrix") >>= fromJSValUnchecked))