ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/GPUBuffer.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.GPUBuffer
(js_destroy, js_getMappedRange, js_mapAsync, js_unmap, js_getSize, js_getUsage, js_getMapState, destroy, getMappedRange, getMappedRange_, mapAsync, unmap, getSize, getUsage, getMapState, GPUBuffer(..), gTypeGPUBuffer)
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 "(($1) => { return $1[\"destroy\"](); })"
js_destroy :: GPUBuffer -> IO ()
-- | <https://developer.mozilla.org/docs/Web/API/GPUBuffer/destroy MDN GPUBuffer.destroy documentation>
destroy :: (MonadDOM m) => GPUBuffer -> m ()
destroy self = liftDOM (void ((js_destroy (self))))
foreign import javascript safe "(($1, $2, $3) => { return $1[\"getMappedRange\"]($2, $3); })"
js_getMappedRange :: GPUBuffer -> JSVal -> JSVal -> IO ArrayBuffer
-- | <https://developer.mozilla.org/docs/Web/API/GPUBuffer/getMappedRange MDN GPUBuffer.getMappedRange documentation>
getMappedRange :: (MonadDOM m) => GPUBuffer -> Maybe Word53 -> Maybe Word53 -> m ArrayBuffer
getMappedRange self offset size = liftDOM (((P.maybe (P.return jsUndefined) toJSVal offset) >>= \a2' -> (P.maybe (P.return jsUndefined) toJSVal size) >>= \a3' -> js_getMappedRange (self) a2' a3'))
-- | <https://developer.mozilla.org/docs/Web/API/GPUBuffer/getMappedRange MDN GPUBuffer.getMappedRange documentation>
getMappedRange_ :: (MonadDOM m) => GPUBuffer -> Maybe Word53 -> Maybe Word53 -> m ()
getMappedRange_ self offset size = liftDOM (void (((P.maybe (P.return jsUndefined) toJSVal offset) >>= \a2' -> (P.maybe (P.return jsUndefined) toJSVal size) >>= \a3' -> js_getMappedRange (self) a2' a3')))
foreign import javascript interruptible "(($1, $2, $3, $4, $c) => { return $1[\"mapAsync\"]($2, $3, $4).then(function(s) { $c(null, s);}, function(e) { $c(e, null);}); })"
js_mapAsync :: GPUBuffer -> Word -> JSVal -> JSVal -> IO (JSVal, ())
-- | <https://developer.mozilla.org/docs/Web/API/GPUBuffer/mapAsync MDN GPUBuffer.mapAsync documentation>
mapAsync :: (MonadDOM m) => GPUBuffer -> Word -> Maybe Word53 -> Maybe Word53 -> m ()
mapAsync self mode offset size = liftDOM (void ((((P.maybe (P.return jsUndefined) toJSVal offset) >>= \a3' -> (P.maybe (P.return jsUndefined) toJSVal size) >>= \a4' -> js_mapAsync (self) (mode) a3' a4') >>= checkPromiseResult)))
foreign import javascript safe "(($1) => { return $1[\"unmap\"](); })"
js_unmap :: GPUBuffer -> IO ()
-- | <https://developer.mozilla.org/docs/Web/API/GPUBuffer/unmap MDN GPUBuffer.unmap documentation>
unmap :: (MonadDOM m) => GPUBuffer -> m ()
unmap self = liftDOM (void ((js_unmap (self))))
foreign import javascript unsafe "(($1) => { return $1[\"size\"]; })"
js_getSize :: GPUBuffer -> IO JSVal
-- | <https://developer.mozilla.org/docs/Web/API/GPUBuffer/size MDN GPUBuffer.size documentation>
getSize :: (MonadDOM m) => GPUBuffer -> m Word53
getSize self = liftDOM (((js_getSize (self)) >>= fromJSValUnchecked))
foreign import javascript unsafe "(($1) => { return $1[\"usage\"]; })"
js_getUsage :: GPUBuffer -> IO Word
-- | <https://developer.mozilla.org/docs/Web/API/GPUBuffer/usage MDN GPUBuffer.usage documentation>
getUsage :: (MonadDOM m) => GPUBuffer -> m Word
getUsage self = liftDOM ((js_getUsage (self)))
foreign import javascript unsafe "(($1) => { return $1[\"mapState\"]; })"
js_getMapState :: GPUBuffer -> IO JSVal
-- | <https://developer.mozilla.org/docs/Web/API/GPUBuffer/mapState MDN GPUBuffer.mapState documentation>
getMapState :: (MonadDOM m) => GPUBuffer -> m GPUBufferMapState
getMapState self = liftDOM (((js_getMapState (self)) >>= fromJSValUnchecked))