packages feed

jsaddle-dom-0.10.0.0: src/JSDOM/Generated/GPUTextureViewDescriptor.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.GPUTextureViewDescriptor
       (newGPUTextureViewDescriptor, setFormat, getFormat, getFormatUnsafe, getFormatUnchecked, setDimension, getDimension, getDimensionUnsafe, getDimensionUnchecked, setUsage, getUsage, getUsageUnsafe, getUsageUnchecked, setAspect, getAspect, getAspectUnsafe, getAspectUnchecked, setBaseMipLevel, getBaseMipLevel, getBaseMipLevelUnsafe, getBaseMipLevelUnchecked, setMipLevelCount, getMipLevelCount, getMipLevelCountUnsafe, getMipLevelCountUnchecked, setBaseArrayLayer, getBaseArrayLayer, getBaseArrayLayerUnsafe, getBaseArrayLayerUnchecked, setArrayLayerCount, getArrayLayerCount, getArrayLayerCountUnsafe, getArrayLayerCountUnchecked, setSwizzle, getSwizzle, getSwizzleUnsafe, getSwizzleUnchecked, GPUTextureViewDescriptor(..), gTypeGPUTextureViewDescriptor)
       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-gputextureviewdescriptor GPUTextureViewDescriptor specification>
newGPUTextureViewDescriptor :: (MonadDOM m) => m GPUTextureViewDescriptor
newGPUTextureViewDescriptor = liftDOM ((((new (jsg "Object") () >>= \o -> P.return o)) >>= fromJSValUnchecked))

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

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

-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-format GPUTextureViewDescriptor.format specification>
getFormatUnsafe :: (MonadDOM m, HasCallStack) => GPUTextureViewDescriptor -> m GPUTextureFormat
getFormatUnsafe self = liftDOM ((((self ^. js "format") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

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

-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-dimension GPUTextureViewDescriptor.dimension specification>
setDimension :: (MonadDOM m) => GPUTextureViewDescriptor -> GPUTextureViewDimension -> m ()
setDimension self val = liftDOM (void (self ^. jss "dimension" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-dimension GPUTextureViewDescriptor.dimension specification>
getDimension :: (MonadDOM m) => GPUTextureViewDescriptor -> m (Maybe GPUTextureViewDimension)
getDimension self = liftDOM (((self ^. js "dimension") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-dimension GPUTextureViewDescriptor.dimension specification>
getDimensionUnsafe :: (MonadDOM m, HasCallStack) => GPUTextureViewDescriptor -> m GPUTextureViewDimension
getDimensionUnsafe self = liftDOM ((((self ^. js "dimension") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-dimension GPUTextureViewDescriptor.dimension specification>
getDimensionUnchecked :: (MonadDOM m) => GPUTextureViewDescriptor -> m GPUTextureViewDimension
getDimensionUnchecked self = liftDOM (((self ^. js "dimension") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-usage GPUTextureViewDescriptor.usage specification>
setUsage :: (MonadDOM m) => GPUTextureViewDescriptor -> Word -> m ()
setUsage self val = liftDOM (void (self ^. jss "usage" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-usage GPUTextureViewDescriptor.usage specification>
getUsage :: (MonadDOM m) => GPUTextureViewDescriptor -> m (Maybe Word)
getUsage self = liftDOM (((self ^. js "usage") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-usage GPUTextureViewDescriptor.usage specification>
getUsageUnsafe :: (MonadDOM m, HasCallStack) => GPUTextureViewDescriptor -> m Word
getUsageUnsafe self = liftDOM ((((self ^. js "usage") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-usage GPUTextureViewDescriptor.usage specification>
getUsageUnchecked :: (MonadDOM m) => GPUTextureViewDescriptor -> m Word
getUsageUnchecked self = liftDOM ((P.round <$> ((self ^. js "usage") >>= valToNumber)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-aspect GPUTextureViewDescriptor.aspect specification>
setAspect :: (MonadDOM m) => GPUTextureViewDescriptor -> GPUTextureAspect -> m ()
setAspect self val = liftDOM (void (self ^. jss "aspect" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-aspect GPUTextureViewDescriptor.aspect specification>
getAspect :: (MonadDOM m) => GPUTextureViewDescriptor -> m (Maybe GPUTextureAspect)
getAspect self = liftDOM (((self ^. js "aspect") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-aspect GPUTextureViewDescriptor.aspect specification>
getAspectUnsafe :: (MonadDOM m, HasCallStack) => GPUTextureViewDescriptor -> m GPUTextureAspect
getAspectUnsafe self = liftDOM ((((self ^. js "aspect") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-aspect GPUTextureViewDescriptor.aspect specification>
getAspectUnchecked :: (MonadDOM m) => GPUTextureViewDescriptor -> m GPUTextureAspect
getAspectUnchecked self = liftDOM (((self ^. js "aspect") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-basemiplevel GPUTextureViewDescriptor.baseMipLevel specification>
setBaseMipLevel :: (MonadDOM m) => GPUTextureViewDescriptor -> Word -> m ()
setBaseMipLevel self val = liftDOM (void (self ^. jss "baseMipLevel" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-basemiplevel GPUTextureViewDescriptor.baseMipLevel specification>
getBaseMipLevel :: (MonadDOM m) => GPUTextureViewDescriptor -> m (Maybe Word)
getBaseMipLevel self = liftDOM (((self ^. js "baseMipLevel") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-basemiplevel GPUTextureViewDescriptor.baseMipLevel specification>
getBaseMipLevelUnsafe :: (MonadDOM m, HasCallStack) => GPUTextureViewDescriptor -> m Word
getBaseMipLevelUnsafe self = liftDOM ((((self ^. js "baseMipLevel") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-basemiplevel GPUTextureViewDescriptor.baseMipLevel specification>
getBaseMipLevelUnchecked :: (MonadDOM m) => GPUTextureViewDescriptor -> m Word
getBaseMipLevelUnchecked self = liftDOM ((P.round <$> ((self ^. js "baseMipLevel") >>= valToNumber)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-miplevelcount GPUTextureViewDescriptor.mipLevelCount specification>
setMipLevelCount :: (MonadDOM m) => GPUTextureViewDescriptor -> Word -> m ()
setMipLevelCount self val = liftDOM (void (self ^. jss "mipLevelCount" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-miplevelcount GPUTextureViewDescriptor.mipLevelCount specification>
getMipLevelCount :: (MonadDOM m) => GPUTextureViewDescriptor -> m (Maybe Word)
getMipLevelCount self = liftDOM (((self ^. js "mipLevelCount") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-miplevelcount GPUTextureViewDescriptor.mipLevelCount specification>
getMipLevelCountUnsafe :: (MonadDOM m, HasCallStack) => GPUTextureViewDescriptor -> m Word
getMipLevelCountUnsafe self = liftDOM ((((self ^. js "mipLevelCount") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-miplevelcount GPUTextureViewDescriptor.mipLevelCount specification>
getMipLevelCountUnchecked :: (MonadDOM m) => GPUTextureViewDescriptor -> m Word
getMipLevelCountUnchecked self = liftDOM ((P.round <$> ((self ^. js "mipLevelCount") >>= valToNumber)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-basearraylayer GPUTextureViewDescriptor.baseArrayLayer specification>
setBaseArrayLayer :: (MonadDOM m) => GPUTextureViewDescriptor -> Word -> m ()
setBaseArrayLayer self val = liftDOM (void (self ^. jss "baseArrayLayer" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-basearraylayer GPUTextureViewDescriptor.baseArrayLayer specification>
getBaseArrayLayer :: (MonadDOM m) => GPUTextureViewDescriptor -> m (Maybe Word)
getBaseArrayLayer self = liftDOM (((self ^. js "baseArrayLayer") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-basearraylayer GPUTextureViewDescriptor.baseArrayLayer specification>
getBaseArrayLayerUnsafe :: (MonadDOM m, HasCallStack) => GPUTextureViewDescriptor -> m Word
getBaseArrayLayerUnsafe self = liftDOM ((((self ^. js "baseArrayLayer") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-basearraylayer GPUTextureViewDescriptor.baseArrayLayer specification>
getBaseArrayLayerUnchecked :: (MonadDOM m) => GPUTextureViewDescriptor -> m Word
getBaseArrayLayerUnchecked self = liftDOM ((P.round <$> ((self ^. js "baseArrayLayer") >>= valToNumber)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-arraylayercount GPUTextureViewDescriptor.arrayLayerCount specification>
setArrayLayerCount :: (MonadDOM m) => GPUTextureViewDescriptor -> Word -> m ()
setArrayLayerCount self val = liftDOM (void (self ^. jss "arrayLayerCount" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-arraylayercount GPUTextureViewDescriptor.arrayLayerCount specification>
getArrayLayerCount :: (MonadDOM m) => GPUTextureViewDescriptor -> m (Maybe Word)
getArrayLayerCount self = liftDOM (((self ^. js "arrayLayerCount") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-arraylayercount GPUTextureViewDescriptor.arrayLayerCount specification>
getArrayLayerCountUnsafe :: (MonadDOM m, HasCallStack) => GPUTextureViewDescriptor -> m Word
getArrayLayerCountUnsafe self = liftDOM ((((self ^. js "arrayLayerCount") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-arraylayercount GPUTextureViewDescriptor.arrayLayerCount specification>
getArrayLayerCountUnchecked :: (MonadDOM m) => GPUTextureViewDescriptor -> m Word
getArrayLayerCountUnchecked self = liftDOM ((P.round <$> ((self ^. js "arrayLayerCount") >>= valToNumber)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-swizzle GPUTextureViewDescriptor.swizzle specification>
setSwizzle :: (MonadDOM m, ToJSString val) => GPUTextureViewDescriptor -> val -> m ()
setSwizzle self val = liftDOM (void (self ^. jss "swizzle" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-swizzle GPUTextureViewDescriptor.swizzle specification>
getSwizzle :: (MonadDOM m, FromJSString result) => GPUTextureViewDescriptor -> m (Maybe result)
getSwizzle self = liftDOM (((self ^. js "swizzle") >>= fromMaybeJSString))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-swizzle GPUTextureViewDescriptor.swizzle specification>
getSwizzleUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => GPUTextureViewDescriptor -> m result
getSwizzleUnsafe self = liftDOM ((((self ^. js "swizzle") >>= fromMaybeJSString) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-swizzle GPUTextureViewDescriptor.swizzle specification>
getSwizzleUnchecked :: (MonadDOM m, FromJSString result) => GPUTextureViewDescriptor -> m result
getSwizzleUnchecked self = liftDOM (((self ^. js "swizzle") >>= fromJSValUnchecked))