packages feed

jsaddle-dom-0.10.0.0: src/JSDOM/Generated/GPUBlendComponent.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.GPUBlendComponent
       (newGPUBlendComponent, setOperation, getOperation, getOperationUnsafe, getOperationUnchecked, setSrcFactor, getSrcFactor, getSrcFactorUnsafe, getSrcFactorUnchecked, setDstFactor, getDstFactor, getDstFactorUnsafe, getDstFactorUnchecked, GPUBlendComponent(..), gTypeGPUBlendComponent)
       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-gpublendcomponent GPUBlendComponent specification>
newGPUBlendComponent :: (MonadDOM m) => m GPUBlendComponent
newGPUBlendComponent = liftDOM ((((new (jsg "Object") () >>= \o -> P.return o)) >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpublendcomponent-operation GPUBlendComponent.operation specification>
setOperation :: (MonadDOM m) => GPUBlendComponent -> GPUBlendOperation -> m ()
setOperation self val = liftDOM (void (self ^. jss "operation" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpublendcomponent-operation GPUBlendComponent.operation specification>
getOperation :: (MonadDOM m) => GPUBlendComponent -> m (Maybe GPUBlendOperation)
getOperation self = liftDOM (((self ^. js "operation") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpublendcomponent-operation GPUBlendComponent.operation specification>
getOperationUnsafe :: (MonadDOM m, HasCallStack) => GPUBlendComponent -> m GPUBlendOperation
getOperationUnsafe self = liftDOM ((((self ^. js "operation") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpublendcomponent-operation GPUBlendComponent.operation specification>
getOperationUnchecked :: (MonadDOM m) => GPUBlendComponent -> m GPUBlendOperation
getOperationUnchecked self = liftDOM (((self ^. js "operation") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpublendcomponent-srcfactor GPUBlendComponent.srcFactor specification>
setSrcFactor :: (MonadDOM m) => GPUBlendComponent -> GPUBlendFactor -> m ()
setSrcFactor self val = liftDOM (void (self ^. jss "srcFactor" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpublendcomponent-srcfactor GPUBlendComponent.srcFactor specification>
getSrcFactor :: (MonadDOM m) => GPUBlendComponent -> m (Maybe GPUBlendFactor)
getSrcFactor self = liftDOM (((self ^. js "srcFactor") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpublendcomponent-srcfactor GPUBlendComponent.srcFactor specification>
getSrcFactorUnsafe :: (MonadDOM m, HasCallStack) => GPUBlendComponent -> m GPUBlendFactor
getSrcFactorUnsafe self = liftDOM ((((self ^. js "srcFactor") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpublendcomponent-srcfactor GPUBlendComponent.srcFactor specification>
getSrcFactorUnchecked :: (MonadDOM m) => GPUBlendComponent -> m GPUBlendFactor
getSrcFactorUnchecked self = liftDOM (((self ^. js "srcFactor") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpublendcomponent-dstfactor GPUBlendComponent.dstFactor specification>
setDstFactor :: (MonadDOM m) => GPUBlendComponent -> GPUBlendFactor -> m ()
setDstFactor self val = liftDOM (void (self ^. jss "dstFactor" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpublendcomponent-dstfactor GPUBlendComponent.dstFactor specification>
getDstFactor :: (MonadDOM m) => GPUBlendComponent -> m (Maybe GPUBlendFactor)
getDstFactor self = liftDOM (((self ^. js "dstFactor") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpublendcomponent-dstfactor GPUBlendComponent.dstFactor specification>
getDstFactorUnsafe :: (MonadDOM m, HasCallStack) => GPUBlendComponent -> m GPUBlendFactor
getDstFactorUnsafe self = liftDOM ((((self ^. js "dstFactor") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpublendcomponent-dstfactor GPUBlendComponent.dstFactor specification>
getDstFactorUnchecked :: (MonadDOM m) => GPUBlendComponent -> m GPUBlendFactor
getDstFactorUnchecked self = liftDOM (((self ^. js "dstFactor") >>= fromJSValUnchecked))