packages feed

ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/GPUSamplerBindingLayout.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.GPUSamplerBindingLayout
       (js_newGPUSamplerBindingLayout, js_setType, js_getType, 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 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_newGPUSamplerBindingLayout :: IO GPUSamplerBindingLayout
-- | <https://gpuweb.github.io/gpuweb/#dictdef-gpusamplerbindinglayout GPUSamplerBindingLayout specification>
newGPUSamplerBindingLayout :: (MonadDOM m) => m GPUSamplerBindingLayout
newGPUSamplerBindingLayout = liftDOM ((js_newGPUSamplerBindingLayout))

foreign import javascript safe "(($1, $2) => { $1[\"type\"] = $2; })"
        js_setType :: GPUSamplerBindingLayout -> JSVal -> IO ()
-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerbindinglayout-type GPUSamplerBindingLayout.type specification>
setType :: (MonadDOM m) => GPUSamplerBindingLayout -> GPUSamplerBindingType -> m ()
setType self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setType (self) a2')))

foreign import javascript unsafe "(($1) => { return $1[\"type\"]; })"
        js_getType :: GPUSamplerBindingLayout -> IO JSVal
-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerbindinglayout-type GPUSamplerBindingLayout.type specification>
getType :: (MonadDOM m) => GPUSamplerBindingLayout -> m (Maybe GPUSamplerBindingType)
getType self = liftDOM (((js_getType (self)) >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerbindinglayout-type GPUSamplerBindingLayout.type specification>
getTypeUnsafe :: (MonadDOM m, HasCallStack) => GPUSamplerBindingLayout -> m GPUSamplerBindingType
getTypeUnsafe self = liftDOM ((((js_getType (self)) >>= 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 ((pFromJSVal <$> (js_getType (self))))