jsaddle-dom-0.10.0.0: src/JSDOM/Generated/GPUComputePassTimestampWrites.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.GPUComputePassTimestampWrites
(newGPUComputePassTimestampWrites, setQuerySet, getQuerySet, setBeginningOfPassWriteIndex, getBeginningOfPassWriteIndex, getBeginningOfPassWriteIndexUnsafe, getBeginningOfPassWriteIndexUnchecked, setEndOfPassWriteIndex, getEndOfPassWriteIndex, getEndOfPassWriteIndexUnsafe, getEndOfPassWriteIndexUnchecked, GPUComputePassTimestampWrites(..), gTypeGPUComputePassTimestampWrites)
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-gpucomputepasstimestampwrites GPUComputePassTimestampWrites specification>
newGPUComputePassTimestampWrites :: (MonadDOM m) => GPUQuerySet -> m GPUComputePassTimestampWrites
newGPUComputePassTimestampWrites querySet = liftDOM ((((new (jsg "Object") () >>= \o -> (o ^. jss "querySet" (toJSVal querySet)) P.>> P.return o)) >>= fromJSValUnchecked))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpucomputepasstimestampwrites-queryset GPUComputePassTimestampWrites.querySet specification>
setQuerySet :: (MonadDOM m) => GPUComputePassTimestampWrites -> GPUQuerySet -> m ()
setQuerySet self val = liftDOM (void (self ^. jss "querySet" (toJSVal val)))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpucomputepasstimestampwrites-queryset GPUComputePassTimestampWrites.querySet specification>
getQuerySet :: (MonadDOM m) => GPUComputePassTimestampWrites -> m GPUQuerySet
getQuerySet self = liftDOM (((self ^. js "querySet") >>= fromJSValUnchecked))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpucomputepasstimestampwrites-beginningofpasswriteindex GPUComputePassTimestampWrites.beginningOfPassWriteIndex specification>
setBeginningOfPassWriteIndex :: (MonadDOM m) => GPUComputePassTimestampWrites -> Word -> m ()
setBeginningOfPassWriteIndex self val = liftDOM (void (self ^. jss "beginningOfPassWriteIndex" (toJSVal val)))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpucomputepasstimestampwrites-beginningofpasswriteindex GPUComputePassTimestampWrites.beginningOfPassWriteIndex specification>
getBeginningOfPassWriteIndex :: (MonadDOM m) => GPUComputePassTimestampWrites -> m (Maybe Word)
getBeginningOfPassWriteIndex self = liftDOM (((self ^. js "beginningOfPassWriteIndex") >>= fromJSValUnchecked))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpucomputepasstimestampwrites-beginningofpasswriteindex GPUComputePassTimestampWrites.beginningOfPassWriteIndex specification>
getBeginningOfPassWriteIndexUnsafe :: (MonadDOM m, HasCallStack) => GPUComputePassTimestampWrites -> m Word
getBeginningOfPassWriteIndexUnsafe self = liftDOM ((((self ^. js "beginningOfPassWriteIndex") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpucomputepasstimestampwrites-beginningofpasswriteindex GPUComputePassTimestampWrites.beginningOfPassWriteIndex specification>
getBeginningOfPassWriteIndexUnchecked :: (MonadDOM m) => GPUComputePassTimestampWrites -> m Word
getBeginningOfPassWriteIndexUnchecked self = liftDOM ((P.round <$> ((self ^. js "beginningOfPassWriteIndex") >>= valToNumber)))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpucomputepasstimestampwrites-endofpasswriteindex GPUComputePassTimestampWrites.endOfPassWriteIndex specification>
setEndOfPassWriteIndex :: (MonadDOM m) => GPUComputePassTimestampWrites -> Word -> m ()
setEndOfPassWriteIndex self val = liftDOM (void (self ^. jss "endOfPassWriteIndex" (toJSVal val)))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpucomputepasstimestampwrites-endofpasswriteindex GPUComputePassTimestampWrites.endOfPassWriteIndex specification>
getEndOfPassWriteIndex :: (MonadDOM m) => GPUComputePassTimestampWrites -> m (Maybe Word)
getEndOfPassWriteIndex self = liftDOM (((self ^. js "endOfPassWriteIndex") >>= fromJSValUnchecked))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpucomputepasstimestampwrites-endofpasswriteindex GPUComputePassTimestampWrites.endOfPassWriteIndex specification>
getEndOfPassWriteIndexUnsafe :: (MonadDOM m, HasCallStack) => GPUComputePassTimestampWrites -> m Word
getEndOfPassWriteIndexUnsafe self = liftDOM ((((self ^. js "endOfPassWriteIndex") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpucomputepasstimestampwrites-endofpasswriteindex GPUComputePassTimestampWrites.endOfPassWriteIndex specification>
getEndOfPassWriteIndexUnchecked :: (MonadDOM m) => GPUComputePassTimestampWrites -> m Word
getEndOfPassWriteIndexUnchecked self = liftDOM ((P.round <$> ((self ^. js "endOfPassWriteIndex") >>= valToNumber)))