packages feed

jsaddle-dom-0.10.0.0: src/JSDOM/Generated/GPUBindGroupLayoutEntry.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.GPUBindGroupLayoutEntry
       (newGPUBindGroupLayoutEntry, setBinding, getBinding, setVisibility, getVisibility, setBuffer, getBuffer, getBufferUnsafe, getBufferUnchecked, setSampler, getSampler, getSamplerUnsafe, getSamplerUnchecked, setTexture, getTexture, getTextureUnsafe, getTextureUnchecked, setStorageTexture, getStorageTexture, getStorageTextureUnsafe, getStorageTextureUnchecked, setExternalTexture, getExternalTexture, getExternalTextureUnsafe, getExternalTextureUnchecked, GPUBindGroupLayoutEntry(..), gTypeGPUBindGroupLayoutEntry)
       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-gpubindgrouplayoutentry GPUBindGroupLayoutEntry specification>
newGPUBindGroupLayoutEntry :: (MonadDOM m) => Word -> Word -> m GPUBindGroupLayoutEntry
newGPUBindGroupLayoutEntry binding visibility = liftDOM ((((new (jsg "Object") () >>= \o -> (o ^. jss "binding" (toJSVal binding)) P.>> (o ^. jss "visibility" (toJSVal visibility)) P.>> P.return o)) >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpubindgrouplayoutentry-binding GPUBindGroupLayoutEntry.binding specification>
setBinding :: (MonadDOM m) => GPUBindGroupLayoutEntry -> Word -> m ()
setBinding self val = liftDOM (void (self ^. jss "binding" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpubindgrouplayoutentry-binding GPUBindGroupLayoutEntry.binding specification>
getBinding :: (MonadDOM m) => GPUBindGroupLayoutEntry -> m Word
getBinding self = liftDOM ((P.round <$> ((self ^. js "binding") >>= valToNumber)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpubindgrouplayoutentry-visibility GPUBindGroupLayoutEntry.visibility specification>
setVisibility :: (MonadDOM m) => GPUBindGroupLayoutEntry -> Word -> m ()
setVisibility self val = liftDOM (void (self ^. jss "visibility" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpubindgrouplayoutentry-visibility GPUBindGroupLayoutEntry.visibility specification>
getVisibility :: (MonadDOM m) => GPUBindGroupLayoutEntry -> m Word
getVisibility self = liftDOM ((P.round <$> ((self ^. js "visibility") >>= valToNumber)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpubindgrouplayoutentry-buffer GPUBindGroupLayoutEntry.buffer specification>
setBuffer :: (MonadDOM m) => GPUBindGroupLayoutEntry -> GPUBufferBindingLayout -> m ()
setBuffer self val = liftDOM (void (self ^. jss "buffer" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpubindgrouplayoutentry-buffer GPUBindGroupLayoutEntry.buffer specification>
getBuffer :: (MonadDOM m) => GPUBindGroupLayoutEntry -> m (Maybe GPUBufferBindingLayout)
getBuffer self = liftDOM (((self ^. js "buffer") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpubindgrouplayoutentry-buffer GPUBindGroupLayoutEntry.buffer specification>
getBufferUnsafe :: (MonadDOM m, HasCallStack) => GPUBindGroupLayoutEntry -> m GPUBufferBindingLayout
getBufferUnsafe self = liftDOM ((((self ^. js "buffer") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpubindgrouplayoutentry-buffer GPUBindGroupLayoutEntry.buffer specification>
getBufferUnchecked :: (MonadDOM m) => GPUBindGroupLayoutEntry -> m GPUBufferBindingLayout
getBufferUnchecked self = liftDOM (((self ^. js "buffer") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpubindgrouplayoutentry-sampler GPUBindGroupLayoutEntry.sampler specification>
setSampler :: (MonadDOM m) => GPUBindGroupLayoutEntry -> GPUSamplerBindingLayout -> m ()
setSampler self val = liftDOM (void (self ^. jss "sampler" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpubindgrouplayoutentry-sampler GPUBindGroupLayoutEntry.sampler specification>
getSampler :: (MonadDOM m) => GPUBindGroupLayoutEntry -> m (Maybe GPUSamplerBindingLayout)
getSampler self = liftDOM (((self ^. js "sampler") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpubindgrouplayoutentry-sampler GPUBindGroupLayoutEntry.sampler specification>
getSamplerUnsafe :: (MonadDOM m, HasCallStack) => GPUBindGroupLayoutEntry -> m GPUSamplerBindingLayout
getSamplerUnsafe self = liftDOM ((((self ^. js "sampler") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpubindgrouplayoutentry-sampler GPUBindGroupLayoutEntry.sampler specification>
getSamplerUnchecked :: (MonadDOM m) => GPUBindGroupLayoutEntry -> m GPUSamplerBindingLayout
getSamplerUnchecked self = liftDOM (((self ^. js "sampler") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpubindgrouplayoutentry-texture GPUBindGroupLayoutEntry.texture specification>
setTexture :: (MonadDOM m) => GPUBindGroupLayoutEntry -> GPUTextureBindingLayout -> m ()
setTexture self val = liftDOM (void (self ^. jss "texture" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpubindgrouplayoutentry-texture GPUBindGroupLayoutEntry.texture specification>
getTexture :: (MonadDOM m) => GPUBindGroupLayoutEntry -> m (Maybe GPUTextureBindingLayout)
getTexture self = liftDOM (((self ^. js "texture") >>= fromJSValUnchecked))

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

-- | <https://gpuweb.github.io/gpuweb/#dom-gpubindgrouplayoutentry-texture GPUBindGroupLayoutEntry.texture specification>
getTextureUnchecked :: (MonadDOM m) => GPUBindGroupLayoutEntry -> m GPUTextureBindingLayout
getTextureUnchecked self = liftDOM (((self ^. js "texture") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpubindgrouplayoutentry-storagetexture GPUBindGroupLayoutEntry.storageTexture specification>
setStorageTexture :: (MonadDOM m) => GPUBindGroupLayoutEntry -> GPUStorageTextureBindingLayout -> m ()
setStorageTexture self val = liftDOM (void (self ^. jss "storageTexture" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpubindgrouplayoutentry-storagetexture GPUBindGroupLayoutEntry.storageTexture specification>
getStorageTexture :: (MonadDOM m) => GPUBindGroupLayoutEntry -> m (Maybe GPUStorageTextureBindingLayout)
getStorageTexture self = liftDOM (((self ^. js "storageTexture") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpubindgrouplayoutentry-storagetexture GPUBindGroupLayoutEntry.storageTexture specification>
getStorageTextureUnsafe :: (MonadDOM m, HasCallStack) => GPUBindGroupLayoutEntry -> m GPUStorageTextureBindingLayout
getStorageTextureUnsafe self = liftDOM ((((self ^. js "storageTexture") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpubindgrouplayoutentry-storagetexture GPUBindGroupLayoutEntry.storageTexture specification>
getStorageTextureUnchecked :: (MonadDOM m) => GPUBindGroupLayoutEntry -> m GPUStorageTextureBindingLayout
getStorageTextureUnchecked self = liftDOM (((self ^. js "storageTexture") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpubindgrouplayoutentry-externaltexture GPUBindGroupLayoutEntry.externalTexture specification>
setExternalTexture :: (MonadDOM m) => GPUBindGroupLayoutEntry -> GPUExternalTextureBindingLayout -> m ()
setExternalTexture self val = liftDOM (void (self ^. jss "externalTexture" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpubindgrouplayoutentry-externaltexture GPUBindGroupLayoutEntry.externalTexture specification>
getExternalTexture :: (MonadDOM m) => GPUBindGroupLayoutEntry -> m (Maybe GPUExternalTextureBindingLayout)
getExternalTexture self = liftDOM (((self ^. js "externalTexture") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpubindgrouplayoutentry-externaltexture GPUBindGroupLayoutEntry.externalTexture specification>
getExternalTextureUnsafe :: (MonadDOM m, HasCallStack) => GPUBindGroupLayoutEntry -> m GPUExternalTextureBindingLayout
getExternalTextureUnsafe self = liftDOM ((((self ^. js "externalTexture") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpubindgrouplayoutentry-externaltexture GPUBindGroupLayoutEntry.externalTexture specification>
getExternalTextureUnchecked :: (MonadDOM m) => GPUBindGroupLayoutEntry -> m GPUExternalTextureBindingLayout
getExternalTextureUnchecked self = liftDOM (((self ^. js "externalTexture") >>= fromJSValUnchecked))