jsaddle-dom-0.10.0.0: src/JSDOM/Generated/GPUShaderModuleCompilationHint.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.GPUShaderModuleCompilationHint
(newGPUShaderModuleCompilationHint, setEntryPoint, getEntryPoint, setLayout, getLayout, getLayoutUnsafe, getLayoutUnchecked, GPUShaderModuleCompilationHint(..), gTypeGPUShaderModuleCompilationHint)
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-gpushadermodulecompilationhint GPUShaderModuleCompilationHint specification>
newGPUShaderModuleCompilationHint :: (MonadDOM m, ToJSString entryPoint) => entryPoint -> m GPUShaderModuleCompilationHint
newGPUShaderModuleCompilationHint entryPoint = liftDOM ((((new (jsg "Object") () >>= \o -> (o ^. jss "entryPoint" (toJSVal entryPoint)) P.>> P.return o)) >>= fromJSValUnchecked))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpushadermodulecompilationhint-entrypoint GPUShaderModuleCompilationHint.entryPoint specification>
setEntryPoint :: (MonadDOM m, ToJSString val) => GPUShaderModuleCompilationHint -> val -> m ()
setEntryPoint self val = liftDOM (void (self ^. jss "entryPoint" (toJSVal val)))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpushadermodulecompilationhint-entrypoint GPUShaderModuleCompilationHint.entryPoint specification>
getEntryPoint :: (MonadDOM m, FromJSString result) => GPUShaderModuleCompilationHint -> m result
getEntryPoint self = liftDOM (((self ^. js "entryPoint") >>= fromJSValUnchecked))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpushadermodulecompilationhint-layout GPUShaderModuleCompilationHint.layout specification>
setLayout :: (MonadDOM m, IsGPUPipelineLayoutOrGPUAutoLayoutMode val) => GPUShaderModuleCompilationHint -> val -> m ()
setLayout self val = liftDOM (void (self ^. jss "layout" (toJSVal val)))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpushadermodulecompilationhint-layout GPUShaderModuleCompilationHint.layout specification>
getLayout :: (MonadDOM m) => GPUShaderModuleCompilationHint -> m (Maybe GPUPipelineLayoutOrGPUAutoLayoutMode)
getLayout self = liftDOM (((self ^. js "layout") >>= fromJSValUnchecked))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpushadermodulecompilationhint-layout GPUShaderModuleCompilationHint.layout specification>
getLayoutUnsafe :: (MonadDOM m, HasCallStack) => GPUShaderModuleCompilationHint -> m GPUPipelineLayoutOrGPUAutoLayoutMode
getLayoutUnsafe self = liftDOM ((((self ^. js "layout") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpushadermodulecompilationhint-layout GPUShaderModuleCompilationHint.layout specification>
getLayoutUnchecked :: (MonadDOM m) => GPUShaderModuleCompilationHint -> m GPUPipelineLayoutOrGPUAutoLayoutMode
getLayoutUnchecked self = liftDOM (((self ^. js "layout") >>= fromJSValUnchecked))