packages feed

ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/GPUTextureViewDescriptor.hs

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from webgpu (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.GPUTextureViewDescriptor
       (js_newGPUTextureViewDescriptor, js_setFormat, js_getFormat, js_setDimension, js_getDimension, js_setUsage, js_getUsage, js_setAspect, js_getAspect, js_setBaseMipLevel, js_getBaseMipLevel, js_setMipLevelCount, js_getMipLevelCount, js_setBaseArrayLayer, js_getBaseArrayLayer, js_setArrayLayerCount, js_getArrayLayerCount, js_setSwizzle, js_getSwizzle, 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 GHCJS.Types (JSVal, JSString)
import GHCJS.Foreign (jsUndefined, jsNull)
import GHCJS.DOM.Types
import qualified GHCJS.DOM.Types as Types
import GHCJS.DOM.EventTargetClosures (EventName, unsafeEventName, unsafeEventNameAsync)
import GHCJS.DOM.JSFFI.Generated.Enums

foreign import javascript safe "(() => { return ({}); })"
        js_newGPUTextureViewDescriptor :: IO GPUTextureViewDescriptor
-- | <https://gpuweb.github.io/gpuweb/#dictdef-gputextureviewdescriptor GPUTextureViewDescriptor specification>
newGPUTextureViewDescriptor :: (MonadDOM m) => m GPUTextureViewDescriptor
newGPUTextureViewDescriptor = liftDOM ((js_newGPUTextureViewDescriptor))

foreign import javascript safe "(($1, $2) => { $1[\"format\"] = $2; })"
        js_setFormat :: GPUTextureViewDescriptor -> JSVal -> IO ()
-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-format GPUTextureViewDescriptor.format specification>
setFormat :: (MonadDOM m) => GPUTextureViewDescriptor -> GPUTextureFormat -> m ()
setFormat self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setFormat (self) a2')))

foreign import javascript unsafe "(($1) => { return $1[\"format\"]; })"
        js_getFormat :: GPUTextureViewDescriptor -> IO JSVal
-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-format GPUTextureViewDescriptor.format specification>
getFormat :: (MonadDOM m) => GPUTextureViewDescriptor -> m (Maybe GPUTextureFormat)
getFormat self = liftDOM (((js_getFormat (self)) >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-format GPUTextureViewDescriptor.format specification>
getFormatUnsafe :: (MonadDOM m, HasCallStack) => GPUTextureViewDescriptor -> m GPUTextureFormat
getFormatUnsafe self = liftDOM ((((js_getFormat (self)) >>= 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 ((pFromJSVal <$> (js_getFormat (self))))

foreign import javascript safe "(($1, $2) => { $1[\"dimension\"] = $2; })"
        js_setDimension :: GPUTextureViewDescriptor -> JSVal -> IO ()
-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-dimension GPUTextureViewDescriptor.dimension specification>
setDimension :: (MonadDOM m) => GPUTextureViewDescriptor -> GPUTextureViewDimension -> m ()
setDimension self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setDimension (self) a2')))

foreign import javascript unsafe "(($1) => { return $1[\"dimension\"]; })"
        js_getDimension :: GPUTextureViewDescriptor -> IO JSVal
-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-dimension GPUTextureViewDescriptor.dimension specification>
getDimension :: (MonadDOM m) => GPUTextureViewDescriptor -> m (Maybe GPUTextureViewDimension)
getDimension self = liftDOM (((js_getDimension (self)) >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-dimension GPUTextureViewDescriptor.dimension specification>
getDimensionUnsafe :: (MonadDOM m, HasCallStack) => GPUTextureViewDescriptor -> m GPUTextureViewDimension
getDimensionUnsafe self = liftDOM ((((js_getDimension (self)) >>= 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 ((pFromJSVal <$> (js_getDimension (self))))

foreign import javascript safe "(($1, $2) => { $1[\"usage\"] = $2; })"
        js_setUsage :: GPUTextureViewDescriptor -> Word -> IO ()
-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-usage GPUTextureViewDescriptor.usage specification>
setUsage :: (MonadDOM m) => GPUTextureViewDescriptor -> Word -> m ()
setUsage self val = liftDOM (void ((js_setUsage (self) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"usage\"]; })"
        js_getUsage :: GPUTextureViewDescriptor -> IO JSVal
-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-usage GPUTextureViewDescriptor.usage specification>
getUsage :: (MonadDOM m) => GPUTextureViewDescriptor -> m (Maybe Word)
getUsage self = liftDOM (((js_getUsage (self)) >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-usage GPUTextureViewDescriptor.usage specification>
getUsageUnsafe :: (MonadDOM m, HasCallStack) => GPUTextureViewDescriptor -> m Word
getUsageUnsafe self = liftDOM ((((js_getUsage (self)) >>= 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 ((pFromJSVal <$> (js_getUsage (self))))

foreign import javascript safe "(($1, $2) => { $1[\"aspect\"] = $2; })"
        js_setAspect :: GPUTextureViewDescriptor -> JSVal -> IO ()
-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-aspect GPUTextureViewDescriptor.aspect specification>
setAspect :: (MonadDOM m) => GPUTextureViewDescriptor -> GPUTextureAspect -> m ()
setAspect self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setAspect (self) a2')))

foreign import javascript unsafe "(($1) => { return $1[\"aspect\"]; })"
        js_getAspect :: GPUTextureViewDescriptor -> IO JSVal
-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-aspect GPUTextureViewDescriptor.aspect specification>
getAspect :: (MonadDOM m) => GPUTextureViewDescriptor -> m (Maybe GPUTextureAspect)
getAspect self = liftDOM (((js_getAspect (self)) >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-aspect GPUTextureViewDescriptor.aspect specification>
getAspectUnsafe :: (MonadDOM m, HasCallStack) => GPUTextureViewDescriptor -> m GPUTextureAspect
getAspectUnsafe self = liftDOM ((((js_getAspect (self)) >>= 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 ((pFromJSVal <$> (js_getAspect (self))))

foreign import javascript safe "(($1, $2) => { $1[\"baseMipLevel\"] = $2; })"
        js_setBaseMipLevel :: GPUTextureViewDescriptor -> Word -> IO ()
-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-basemiplevel GPUTextureViewDescriptor.baseMipLevel specification>
setBaseMipLevel :: (MonadDOM m) => GPUTextureViewDescriptor -> Word -> m ()
setBaseMipLevel self val = liftDOM (void ((js_setBaseMipLevel (self) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"baseMipLevel\"]; })"
        js_getBaseMipLevel :: GPUTextureViewDescriptor -> IO JSVal
-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-basemiplevel GPUTextureViewDescriptor.baseMipLevel specification>
getBaseMipLevel :: (MonadDOM m) => GPUTextureViewDescriptor -> m (Maybe Word)
getBaseMipLevel self = liftDOM (((js_getBaseMipLevel (self)) >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-basemiplevel GPUTextureViewDescriptor.baseMipLevel specification>
getBaseMipLevelUnsafe :: (MonadDOM m, HasCallStack) => GPUTextureViewDescriptor -> m Word
getBaseMipLevelUnsafe self = liftDOM ((((js_getBaseMipLevel (self)) >>= 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 ((pFromJSVal <$> (js_getBaseMipLevel (self))))

foreign import javascript safe "(($1, $2) => { $1[\"mipLevelCount\"] = $2; })"
        js_setMipLevelCount :: GPUTextureViewDescriptor -> Word -> IO ()
-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-miplevelcount GPUTextureViewDescriptor.mipLevelCount specification>
setMipLevelCount :: (MonadDOM m) => GPUTextureViewDescriptor -> Word -> m ()
setMipLevelCount self val = liftDOM (void ((js_setMipLevelCount (self) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"mipLevelCount\"]; })"
        js_getMipLevelCount :: GPUTextureViewDescriptor -> IO JSVal
-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-miplevelcount GPUTextureViewDescriptor.mipLevelCount specification>
getMipLevelCount :: (MonadDOM m) => GPUTextureViewDescriptor -> m (Maybe Word)
getMipLevelCount self = liftDOM (((js_getMipLevelCount (self)) >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-miplevelcount GPUTextureViewDescriptor.mipLevelCount specification>
getMipLevelCountUnsafe :: (MonadDOM m, HasCallStack) => GPUTextureViewDescriptor -> m Word
getMipLevelCountUnsafe self = liftDOM ((((js_getMipLevelCount (self)) >>= 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 ((pFromJSVal <$> (js_getMipLevelCount (self))))

foreign import javascript safe "(($1, $2) => { $1[\"baseArrayLayer\"] = $2; })"
        js_setBaseArrayLayer :: GPUTextureViewDescriptor -> Word -> IO ()
-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-basearraylayer GPUTextureViewDescriptor.baseArrayLayer specification>
setBaseArrayLayer :: (MonadDOM m) => GPUTextureViewDescriptor -> Word -> m ()
setBaseArrayLayer self val = liftDOM (void ((js_setBaseArrayLayer (self) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"baseArrayLayer\"]; })"
        js_getBaseArrayLayer :: GPUTextureViewDescriptor -> IO JSVal
-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-basearraylayer GPUTextureViewDescriptor.baseArrayLayer specification>
getBaseArrayLayer :: (MonadDOM m) => GPUTextureViewDescriptor -> m (Maybe Word)
getBaseArrayLayer self = liftDOM (((js_getBaseArrayLayer (self)) >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-basearraylayer GPUTextureViewDescriptor.baseArrayLayer specification>
getBaseArrayLayerUnsafe :: (MonadDOM m, HasCallStack) => GPUTextureViewDescriptor -> m Word
getBaseArrayLayerUnsafe self = liftDOM ((((js_getBaseArrayLayer (self)) >>= 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 ((pFromJSVal <$> (js_getBaseArrayLayer (self))))

foreign import javascript safe "(($1, $2) => { $1[\"arrayLayerCount\"] = $2; })"
        js_setArrayLayerCount :: GPUTextureViewDescriptor -> Word -> IO ()
-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-arraylayercount GPUTextureViewDescriptor.arrayLayerCount specification>
setArrayLayerCount :: (MonadDOM m) => GPUTextureViewDescriptor -> Word -> m ()
setArrayLayerCount self val = liftDOM (void ((js_setArrayLayerCount (self) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"arrayLayerCount\"]; })"
        js_getArrayLayerCount :: GPUTextureViewDescriptor -> IO JSVal
-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-arraylayercount GPUTextureViewDescriptor.arrayLayerCount specification>
getArrayLayerCount :: (MonadDOM m) => GPUTextureViewDescriptor -> m (Maybe Word)
getArrayLayerCount self = liftDOM (((js_getArrayLayerCount (self)) >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-arraylayercount GPUTextureViewDescriptor.arrayLayerCount specification>
getArrayLayerCountUnsafe :: (MonadDOM m, HasCallStack) => GPUTextureViewDescriptor -> m Word
getArrayLayerCountUnsafe self = liftDOM ((((js_getArrayLayerCount (self)) >>= 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 ((pFromJSVal <$> (js_getArrayLayerCount (self))))

foreign import javascript safe "(($1, $2) => { $1[\"swizzle\"] = $2; })"
        js_setSwizzle :: GPUTextureViewDescriptor -> JSString -> IO ()
-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-swizzle GPUTextureViewDescriptor.swizzle specification>
setSwizzle :: (MonadDOM m, ToJSString val) => GPUTextureViewDescriptor -> val -> m ()
setSwizzle self val = liftDOM (void ((js_setSwizzle (self) (toJSString val))))

foreign import javascript unsafe "(($1) => { return $1[\"swizzle\"]; })"
        js_getSwizzle :: GPUTextureViewDescriptor -> IO JSVal
-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-swizzle GPUTextureViewDescriptor.swizzle specification>
getSwizzle :: (MonadDOM m, FromJSString result) => GPUTextureViewDescriptor -> m (Maybe result)
getSwizzle self = liftDOM (((fromMaybeJSString . Nullable) <$> (js_getSwizzle (self))))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-swizzle GPUTextureViewDescriptor.swizzle specification>
getSwizzleUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => GPUTextureViewDescriptor -> m result
getSwizzleUnsafe self = liftDOM ((((fromMaybeJSString . Nullable) <$> (js_getSwizzle (self))) >>= 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 ((pFromJSVal <$> (js_getSwizzle (self))))