packages feed

jsaddle-dom-0.10.0.0: src/JSDOM/Generated/GPUPrimitiveState.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.GPUPrimitiveState
       (newGPUPrimitiveState, setTopology, getTopology, getTopologyUnsafe, getTopologyUnchecked, setStripIndexFormat, getStripIndexFormat, getStripIndexFormatUnsafe, getStripIndexFormatUnchecked, setFrontFace, getFrontFace, getFrontFaceUnsafe, getFrontFaceUnchecked, setCullMode, getCullMode, getCullModeUnsafe, getCullModeUnchecked, setUnclippedDepth, getUnclippedDepth, getUnclippedDepthUnsafe, getUnclippedDepthUnchecked, GPUPrimitiveState(..), gTypeGPUPrimitiveState)
       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-gpuprimitivestate GPUPrimitiveState specification>
newGPUPrimitiveState :: (MonadDOM m) => m GPUPrimitiveState
newGPUPrimitiveState = liftDOM ((((new (jsg "Object") () >>= \o -> P.return o)) >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpuprimitivestate-topology GPUPrimitiveState.topology specification>
setTopology :: (MonadDOM m) => GPUPrimitiveState -> GPUPrimitiveTopology -> m ()
setTopology self val = liftDOM (void (self ^. jss "topology" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpuprimitivestate-topology GPUPrimitiveState.topology specification>
getTopology :: (MonadDOM m) => GPUPrimitiveState -> m (Maybe GPUPrimitiveTopology)
getTopology self = liftDOM (((self ^. js "topology") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpuprimitivestate-topology GPUPrimitiveState.topology specification>
getTopologyUnsafe :: (MonadDOM m, HasCallStack) => GPUPrimitiveState -> m GPUPrimitiveTopology
getTopologyUnsafe self = liftDOM ((((self ^. js "topology") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpuprimitivestate-topology GPUPrimitiveState.topology specification>
getTopologyUnchecked :: (MonadDOM m) => GPUPrimitiveState -> m GPUPrimitiveTopology
getTopologyUnchecked self = liftDOM (((self ^. js "topology") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpuprimitivestate-stripindexformat GPUPrimitiveState.stripIndexFormat specification>
setStripIndexFormat :: (MonadDOM m) => GPUPrimitiveState -> GPUIndexFormat -> m ()
setStripIndexFormat self val = liftDOM (void (self ^. jss "stripIndexFormat" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpuprimitivestate-stripindexformat GPUPrimitiveState.stripIndexFormat specification>
getStripIndexFormat :: (MonadDOM m) => GPUPrimitiveState -> m (Maybe GPUIndexFormat)
getStripIndexFormat self = liftDOM (((self ^. js "stripIndexFormat") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpuprimitivestate-stripindexformat GPUPrimitiveState.stripIndexFormat specification>
getStripIndexFormatUnsafe :: (MonadDOM m, HasCallStack) => GPUPrimitiveState -> m GPUIndexFormat
getStripIndexFormatUnsafe self = liftDOM ((((self ^. js "stripIndexFormat") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpuprimitivestate-stripindexformat GPUPrimitiveState.stripIndexFormat specification>
getStripIndexFormatUnchecked :: (MonadDOM m) => GPUPrimitiveState -> m GPUIndexFormat
getStripIndexFormatUnchecked self = liftDOM (((self ^. js "stripIndexFormat") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpuprimitivestate-frontface GPUPrimitiveState.frontFace specification>
setFrontFace :: (MonadDOM m) => GPUPrimitiveState -> GPUFrontFace -> m ()
setFrontFace self val = liftDOM (void (self ^. jss "frontFace" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpuprimitivestate-frontface GPUPrimitiveState.frontFace specification>
getFrontFace :: (MonadDOM m) => GPUPrimitiveState -> m (Maybe GPUFrontFace)
getFrontFace self = liftDOM (((self ^. js "frontFace") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpuprimitivestate-frontface GPUPrimitiveState.frontFace specification>
getFrontFaceUnsafe :: (MonadDOM m, HasCallStack) => GPUPrimitiveState -> m GPUFrontFace
getFrontFaceUnsafe self = liftDOM ((((self ^. js "frontFace") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpuprimitivestate-frontface GPUPrimitiveState.frontFace specification>
getFrontFaceUnchecked :: (MonadDOM m) => GPUPrimitiveState -> m GPUFrontFace
getFrontFaceUnchecked self = liftDOM (((self ^. js "frontFace") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpuprimitivestate-cullmode GPUPrimitiveState.cullMode specification>
setCullMode :: (MonadDOM m) => GPUPrimitiveState -> GPUCullMode -> m ()
setCullMode self val = liftDOM (void (self ^. jss "cullMode" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpuprimitivestate-cullmode GPUPrimitiveState.cullMode specification>
getCullMode :: (MonadDOM m) => GPUPrimitiveState -> m (Maybe GPUCullMode)
getCullMode self = liftDOM (((self ^. js "cullMode") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpuprimitivestate-cullmode GPUPrimitiveState.cullMode specification>
getCullModeUnsafe :: (MonadDOM m, HasCallStack) => GPUPrimitiveState -> m GPUCullMode
getCullModeUnsafe self = liftDOM ((((self ^. js "cullMode") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpuprimitivestate-cullmode GPUPrimitiveState.cullMode specification>
getCullModeUnchecked :: (MonadDOM m) => GPUPrimitiveState -> m GPUCullMode
getCullModeUnchecked self = liftDOM (((self ^. js "cullMode") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpuprimitivestate-unclippeddepth GPUPrimitiveState.unclippedDepth specification>
setUnclippedDepth :: (MonadDOM m) => GPUPrimitiveState -> Bool -> m ()
setUnclippedDepth self val = liftDOM (void (self ^. jss "unclippedDepth" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpuprimitivestate-unclippeddepth GPUPrimitiveState.unclippedDepth specification>
getUnclippedDepth :: (MonadDOM m) => GPUPrimitiveState -> m (Maybe Bool)
getUnclippedDepth self = liftDOM (((self ^. js "unclippedDepth") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpuprimitivestate-unclippeddepth GPUPrimitiveState.unclippedDepth specification>
getUnclippedDepthUnsafe :: (MonadDOM m, HasCallStack) => GPUPrimitiveState -> m Bool
getUnclippedDepthUnsafe self = liftDOM ((((self ^. js "unclippedDepth") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpuprimitivestate-unclippeddepth GPUPrimitiveState.unclippedDepth specification>
getUnclippedDepthUnchecked :: (MonadDOM m) => GPUPrimitiveState -> m Bool
getUnclippedDepthUnchecked self = liftDOM (((self ^. js "unclippedDepth") >>= valToBool))