jsaddle-dom-0.10.0.0: src/JSDOM/Generated/GPUStencilFaceState.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.GPUStencilFaceState
(newGPUStencilFaceState, setCompare, getCompare, getCompareUnsafe, getCompareUnchecked, setFailOp, getFailOp, getFailOpUnsafe, getFailOpUnchecked, setDepthFailOp, getDepthFailOp, getDepthFailOpUnsafe, getDepthFailOpUnchecked, setPassOp, getPassOp, getPassOpUnsafe, getPassOpUnchecked, GPUStencilFaceState(..), gTypeGPUStencilFaceState)
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-gpustencilfacestate GPUStencilFaceState specification>
newGPUStencilFaceState :: (MonadDOM m) => m GPUStencilFaceState
newGPUStencilFaceState = liftDOM ((((new (jsg "Object") () >>= \o -> P.return o)) >>= fromJSValUnchecked))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpustencilfacestate-compare GPUStencilFaceState.compare specification>
setCompare :: (MonadDOM m) => GPUStencilFaceState -> GPUCompareFunction -> m ()
setCompare self val = liftDOM (void (self ^. jss "compare" (toJSVal val)))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpustencilfacestate-compare GPUStencilFaceState.compare specification>
getCompare :: (MonadDOM m) => GPUStencilFaceState -> m (Maybe GPUCompareFunction)
getCompare self = liftDOM (((self ^. js "compare") >>= fromJSValUnchecked))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpustencilfacestate-compare GPUStencilFaceState.compare specification>
getCompareUnsafe :: (MonadDOM m, HasCallStack) => GPUStencilFaceState -> m GPUCompareFunction
getCompareUnsafe self = liftDOM ((((self ^. js "compare") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpustencilfacestate-compare GPUStencilFaceState.compare specification>
getCompareUnchecked :: (MonadDOM m) => GPUStencilFaceState -> m GPUCompareFunction
getCompareUnchecked self = liftDOM (((self ^. js "compare") >>= fromJSValUnchecked))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpustencilfacestate-failop GPUStencilFaceState.failOp specification>
setFailOp :: (MonadDOM m) => GPUStencilFaceState -> GPUStencilOperation -> m ()
setFailOp self val = liftDOM (void (self ^. jss "failOp" (toJSVal val)))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpustencilfacestate-failop GPUStencilFaceState.failOp specification>
getFailOp :: (MonadDOM m) => GPUStencilFaceState -> m (Maybe GPUStencilOperation)
getFailOp self = liftDOM (((self ^. js "failOp") >>= fromJSValUnchecked))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpustencilfacestate-failop GPUStencilFaceState.failOp specification>
getFailOpUnsafe :: (MonadDOM m, HasCallStack) => GPUStencilFaceState -> m GPUStencilOperation
getFailOpUnsafe self = liftDOM ((((self ^. js "failOp") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpustencilfacestate-failop GPUStencilFaceState.failOp specification>
getFailOpUnchecked :: (MonadDOM m) => GPUStencilFaceState -> m GPUStencilOperation
getFailOpUnchecked self = liftDOM (((self ^. js "failOp") >>= fromJSValUnchecked))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpustencilfacestate-depthfailop GPUStencilFaceState.depthFailOp specification>
setDepthFailOp :: (MonadDOM m) => GPUStencilFaceState -> GPUStencilOperation -> m ()
setDepthFailOp self val = liftDOM (void (self ^. jss "depthFailOp" (toJSVal val)))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpustencilfacestate-depthfailop GPUStencilFaceState.depthFailOp specification>
getDepthFailOp :: (MonadDOM m) => GPUStencilFaceState -> m (Maybe GPUStencilOperation)
getDepthFailOp self = liftDOM (((self ^. js "depthFailOp") >>= fromJSValUnchecked))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpustencilfacestate-depthfailop GPUStencilFaceState.depthFailOp specification>
getDepthFailOpUnsafe :: (MonadDOM m, HasCallStack) => GPUStencilFaceState -> m GPUStencilOperation
getDepthFailOpUnsafe self = liftDOM ((((self ^. js "depthFailOp") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpustencilfacestate-depthfailop GPUStencilFaceState.depthFailOp specification>
getDepthFailOpUnchecked :: (MonadDOM m) => GPUStencilFaceState -> m GPUStencilOperation
getDepthFailOpUnchecked self = liftDOM (((self ^. js "depthFailOp") >>= fromJSValUnchecked))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpustencilfacestate-passop GPUStencilFaceState.passOp specification>
setPassOp :: (MonadDOM m) => GPUStencilFaceState -> GPUStencilOperation -> m ()
setPassOp self val = liftDOM (void (self ^. jss "passOp" (toJSVal val)))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpustencilfacestate-passop GPUStencilFaceState.passOp specification>
getPassOp :: (MonadDOM m) => GPUStencilFaceState -> m (Maybe GPUStencilOperation)
getPassOp self = liftDOM (((self ^. js "passOp") >>= fromJSValUnchecked))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpustencilfacestate-passop GPUStencilFaceState.passOp specification>
getPassOpUnsafe :: (MonadDOM m, HasCallStack) => GPUStencilFaceState -> m GPUStencilOperation
getPassOpUnsafe self = liftDOM ((((self ^. js "passOp") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpustencilfacestate-passop GPUStencilFaceState.passOp specification>
getPassOpUnchecked :: (MonadDOM m) => GPUStencilFaceState -> m GPUStencilOperation
getPassOpUnchecked self = liftDOM (((self ^. js "passOp") >>= fromJSValUnchecked))