packages feed

jsaddle-dom-0.10.0.0: src/JSDOM/Generated/GPUTextureBindingLayout.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.GPUTextureBindingLayout
       (newGPUTextureBindingLayout, setSampleType, getSampleType, getSampleTypeUnsafe, getSampleTypeUnchecked, setViewDimension, getViewDimension, getViewDimensionUnsafe, getViewDimensionUnchecked, setMultisampled, getMultisampled, getMultisampledUnsafe, getMultisampledUnchecked, GPUTextureBindingLayout(..), gTypeGPUTextureBindingLayout)
       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-gputexturebindinglayout GPUTextureBindingLayout specification>
newGPUTextureBindingLayout :: (MonadDOM m) => m GPUTextureBindingLayout
newGPUTextureBindingLayout = liftDOM ((((new (jsg "Object") () >>= \o -> P.return o)) >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputexturebindinglayout-sampletype GPUTextureBindingLayout.sampleType specification>
setSampleType :: (MonadDOM m) => GPUTextureBindingLayout -> GPUTextureSampleType -> m ()
setSampleType self val = liftDOM (void (self ^. jss "sampleType" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputexturebindinglayout-sampletype GPUTextureBindingLayout.sampleType specification>
getSampleType :: (MonadDOM m) => GPUTextureBindingLayout -> m (Maybe GPUTextureSampleType)
getSampleType self = liftDOM (((self ^. js "sampleType") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputexturebindinglayout-sampletype GPUTextureBindingLayout.sampleType specification>
getSampleTypeUnsafe :: (MonadDOM m, HasCallStack) => GPUTextureBindingLayout -> m GPUTextureSampleType
getSampleTypeUnsafe self = liftDOM ((((self ^. js "sampleType") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputexturebindinglayout-sampletype GPUTextureBindingLayout.sampleType specification>
getSampleTypeUnchecked :: (MonadDOM m) => GPUTextureBindingLayout -> m GPUTextureSampleType
getSampleTypeUnchecked self = liftDOM (((self ^. js "sampleType") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputexturebindinglayout-viewdimension GPUTextureBindingLayout.viewDimension specification>
setViewDimension :: (MonadDOM m) => GPUTextureBindingLayout -> GPUTextureViewDimension -> m ()
setViewDimension self val = liftDOM (void (self ^. jss "viewDimension" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputexturebindinglayout-viewdimension GPUTextureBindingLayout.viewDimension specification>
getViewDimension :: (MonadDOM m) => GPUTextureBindingLayout -> m (Maybe GPUTextureViewDimension)
getViewDimension self = liftDOM (((self ^. js "viewDimension") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputexturebindinglayout-viewdimension GPUTextureBindingLayout.viewDimension specification>
getViewDimensionUnsafe :: (MonadDOM m, HasCallStack) => GPUTextureBindingLayout -> m GPUTextureViewDimension
getViewDimensionUnsafe self = liftDOM ((((self ^. js "viewDimension") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputexturebindinglayout-viewdimension GPUTextureBindingLayout.viewDimension specification>
getViewDimensionUnchecked :: (MonadDOM m) => GPUTextureBindingLayout -> m GPUTextureViewDimension
getViewDimensionUnchecked self = liftDOM (((self ^. js "viewDimension") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputexturebindinglayout-multisampled GPUTextureBindingLayout.multisampled specification>
setMultisampled :: (MonadDOM m) => GPUTextureBindingLayout -> Bool -> m ()
setMultisampled self val = liftDOM (void (self ^. jss "multisampled" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputexturebindinglayout-multisampled GPUTextureBindingLayout.multisampled specification>
getMultisampled :: (MonadDOM m) => GPUTextureBindingLayout -> m (Maybe Bool)
getMultisampled self = liftDOM (((self ^. js "multisampled") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputexturebindinglayout-multisampled GPUTextureBindingLayout.multisampled specification>
getMultisampledUnsafe :: (MonadDOM m, HasCallStack) => GPUTextureBindingLayout -> m Bool
getMultisampledUnsafe self = liftDOM ((((self ^. js "multisampled") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputexturebindinglayout-multisampled GPUTextureBindingLayout.multisampled specification>
getMultisampledUnchecked :: (MonadDOM m) => GPUTextureBindingLayout -> m Bool
getMultisampledUnchecked self = liftDOM (((self ^. js "multisampled") >>= valToBool))