packages feed

jsaddle-dom-0.10.0.0: src/JSDOM/Generated/GPUStorageTextureBindingLayout.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.GPUStorageTextureBindingLayout
       (newGPUStorageTextureBindingLayout, setAccess, getAccess, getAccessUnsafe, getAccessUnchecked, setFormat, getFormat, setViewDimension, getViewDimension, getViewDimensionUnsafe, getViewDimensionUnchecked, GPUStorageTextureBindingLayout(..), gTypeGPUStorageTextureBindingLayout)
       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-gpustoragetexturebindinglayout GPUStorageTextureBindingLayout specification>
newGPUStorageTextureBindingLayout :: (MonadDOM m) => GPUTextureFormat -> m GPUStorageTextureBindingLayout
newGPUStorageTextureBindingLayout format = liftDOM ((((new (jsg "Object") () >>= \o -> (o ^. jss "format" (toJSVal format)) P.>> P.return o)) >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpustoragetexturebindinglayout-access GPUStorageTextureBindingLayout.access specification>
setAccess :: (MonadDOM m) => GPUStorageTextureBindingLayout -> GPUStorageTextureAccess -> m ()
setAccess self val = liftDOM (void (self ^. jss "access" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpustoragetexturebindinglayout-access GPUStorageTextureBindingLayout.access specification>
getAccess :: (MonadDOM m) => GPUStorageTextureBindingLayout -> m (Maybe GPUStorageTextureAccess)
getAccess self = liftDOM (((self ^. js "access") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpustoragetexturebindinglayout-access GPUStorageTextureBindingLayout.access specification>
getAccessUnsafe :: (MonadDOM m, HasCallStack) => GPUStorageTextureBindingLayout -> m GPUStorageTextureAccess
getAccessUnsafe self = liftDOM ((((self ^. js "access") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpustoragetexturebindinglayout-access GPUStorageTextureBindingLayout.access specification>
getAccessUnchecked :: (MonadDOM m) => GPUStorageTextureBindingLayout -> m GPUStorageTextureAccess
getAccessUnchecked self = liftDOM (((self ^. js "access") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpustoragetexturebindinglayout-format GPUStorageTextureBindingLayout.format specification>
setFormat :: (MonadDOM m) => GPUStorageTextureBindingLayout -> GPUTextureFormat -> m ()
setFormat self val = liftDOM (void (self ^. jss "format" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpustoragetexturebindinglayout-format GPUStorageTextureBindingLayout.format specification>
getFormat :: (MonadDOM m) => GPUStorageTextureBindingLayout -> m GPUTextureFormat
getFormat self = liftDOM (((self ^. js "format") >>= fromJSValUnchecked))

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

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

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

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