jsaddle-dom-0.10.0.0: src/JSDOM/Generated/GPUSamplerBindingLayout.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.GPUSamplerBindingLayout
(newGPUSamplerBindingLayout, setType, getType, getTypeUnsafe, getTypeUnchecked, GPUSamplerBindingLayout(..), gTypeGPUSamplerBindingLayout)
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-gpusamplerbindinglayout GPUSamplerBindingLayout specification>
newGPUSamplerBindingLayout :: (MonadDOM m) => m GPUSamplerBindingLayout
newGPUSamplerBindingLayout = liftDOM ((((new (jsg "Object") () >>= \o -> P.return o)) >>= fromJSValUnchecked))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerbindinglayout-type GPUSamplerBindingLayout.type specification>
setType :: (MonadDOM m) => GPUSamplerBindingLayout -> GPUSamplerBindingType -> m ()
setType self val = liftDOM (void (self ^. jss "type" (toJSVal val)))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerbindinglayout-type GPUSamplerBindingLayout.type specification>
getType :: (MonadDOM m) => GPUSamplerBindingLayout -> m (Maybe GPUSamplerBindingType)
getType self = liftDOM (((self ^. js "type") >>= fromJSValUnchecked))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerbindinglayout-type GPUSamplerBindingLayout.type specification>
getTypeUnsafe :: (MonadDOM m, HasCallStack) => GPUSamplerBindingLayout -> m GPUSamplerBindingType
getTypeUnsafe self = liftDOM ((((self ^. js "type") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerbindinglayout-type GPUSamplerBindingLayout.type specification>
getTypeUnchecked :: (MonadDOM m) => GPUSamplerBindingLayout -> m GPUSamplerBindingType
getTypeUnchecked self = liftDOM (((self ^. js "type") >>= fromJSValUnchecked))