jsaddle-dom-0.10.0.0: src/JSDOM/Generated/GPUComputePassDescriptor.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.GPUComputePassDescriptor
(newGPUComputePassDescriptor, setTimestampWrites, getTimestampWrites, getTimestampWritesUnsafe, getTimestampWritesUnchecked, GPUComputePassDescriptor(..), gTypeGPUComputePassDescriptor)
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-gpucomputepassdescriptor GPUComputePassDescriptor specification>
newGPUComputePassDescriptor :: (MonadDOM m) => m GPUComputePassDescriptor
newGPUComputePassDescriptor = liftDOM ((((new (jsg "Object") () >>= \o -> P.return o)) >>= fromJSValUnchecked))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpucomputepassdescriptor-timestampwrites GPUComputePassDescriptor.timestampWrites specification>
setTimestampWrites :: (MonadDOM m) => GPUComputePassDescriptor -> GPUComputePassTimestampWrites -> m ()
setTimestampWrites self val = liftDOM (void (self ^. jss "timestampWrites" (toJSVal val)))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpucomputepassdescriptor-timestampwrites GPUComputePassDescriptor.timestampWrites specification>
getTimestampWrites :: (MonadDOM m) => GPUComputePassDescriptor -> m (Maybe GPUComputePassTimestampWrites)
getTimestampWrites self = liftDOM (((self ^. js "timestampWrites") >>= fromJSValUnchecked))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpucomputepassdescriptor-timestampwrites GPUComputePassDescriptor.timestampWrites specification>
getTimestampWritesUnsafe :: (MonadDOM m, HasCallStack) => GPUComputePassDescriptor -> m GPUComputePassTimestampWrites
getTimestampWritesUnsafe self = liftDOM ((((self ^. js "timestampWrites") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpucomputepassdescriptor-timestampwrites GPUComputePassDescriptor.timestampWrites specification>
getTimestampWritesUnchecked :: (MonadDOM m) => GPUComputePassDescriptor -> m GPUComputePassTimestampWrites
getTimestampWritesUnchecked self = liftDOM (((self ^. js "timestampWrites") >>= fromJSValUnchecked))