packages feed

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

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from webgpu (webref). Do not edit.
module JSDOM.Generated.GPUBlendState
       (newGPUBlendState, setColor, getColor, setAlpha, getAlpha, GPUBlendState(..), gTypeGPUBlendState)
       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://gpuweb.github.io/gpuweb/#dictdef-gpublendstate GPUBlendState specification>
newGPUBlendState :: (MonadDOM m) => GPUBlendComponent -> GPUBlendComponent -> m GPUBlendState
newGPUBlendState color alpha = liftDOM ((((new (jsg "Object") () >>= \o -> (o ^. jss "color" (toJSVal color)) P.>> (o ^. jss "alpha" (toJSVal alpha)) P.>> P.return o)) >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpublendstate-color GPUBlendState.color specification>
setColor :: (MonadDOM m) => GPUBlendState -> GPUBlendComponent -> m ()
setColor self val = liftDOM (void (self ^. jss "color" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpublendstate-color GPUBlendState.color specification>
getColor :: (MonadDOM m) => GPUBlendState -> m GPUBlendComponent
getColor self = liftDOM (((self ^. js "color") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpublendstate-alpha GPUBlendState.alpha specification>
setAlpha :: (MonadDOM m) => GPUBlendState -> GPUBlendComponent -> m ()
setAlpha self val = liftDOM (void (self ^. jss "alpha" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpublendstate-alpha GPUBlendState.alpha specification>
getAlpha :: (MonadDOM m) => GPUBlendState -> m GPUBlendComponent
getAlpha self = liftDOM (((self ^. js "alpha") >>= fromJSValUnchecked))