packages feed

ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/WebTransportHash.hs

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from webtransport (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.WebTransportHash
       (js_newWebTransportHash, js_setAlgorithm, js_getAlgorithm, js_setValue, js_getValue, newWebTransportHash, setAlgorithm, getAlgorithm, setValue, getValue, WebTransportHash(..), gTypeWebTransportHash)
       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, $2) => { return ({\"algorithm\": $1, \"value\": $2}); })"
        js_newWebTransportHash :: JSString -> BufferSource -> IO WebTransportHash
-- | <https://w3c.github.io/webtransport/#dictdef-webtransporthash WebTransportHash specification>
newWebTransportHash :: (MonadDOM m, ToJSString algorithm, IsBufferSource value) => algorithm -> value -> m WebTransportHash
newWebTransportHash algorithm value = liftDOM ((js_newWebTransportHash (toJSString algorithm) (Types.toBufferSource value)))

foreign import javascript safe "(($1, $2) => { $1[\"algorithm\"] = $2; })"
        js_setAlgorithm :: WebTransportHash -> JSString -> IO ()
-- | <https://w3c.github.io/webtransport/#dom-webtransporthash-algorithm WebTransportHash.algorithm specification>
setAlgorithm :: (MonadDOM m, ToJSString val) => WebTransportHash -> val -> m ()
setAlgorithm self val = liftDOM (void ((js_setAlgorithm (self) (toJSString val))))

foreign import javascript unsafe "(($1) => { return $1[\"algorithm\"]; })"
        js_getAlgorithm :: WebTransportHash -> IO JSString
-- | <https://w3c.github.io/webtransport/#dom-webtransporthash-algorithm WebTransportHash.algorithm specification>
getAlgorithm :: (MonadDOM m, FromJSString result) => WebTransportHash -> m result
getAlgorithm self = liftDOM ((fromJSString <$> (js_getAlgorithm (self))))

foreign import javascript safe "(($1, $2) => { $1[\"value\"] = $2; })"
        js_setValue :: WebTransportHash -> BufferSource -> IO ()
-- | <https://w3c.github.io/webtransport/#dom-webtransporthash-value WebTransportHash.value specification>
setValue :: (MonadDOM m, IsBufferSource val) => WebTransportHash -> val -> m ()
setValue self val = liftDOM (void ((js_setValue (self) (Types.toBufferSource val))))

foreign import javascript unsafe "(($1) => { return $1[\"value\"]; })"
        js_getValue :: WebTransportHash -> IO BufferSource
-- | <https://w3c.github.io/webtransport/#dom-webtransporthash-value WebTransportHash.value specification>
getValue :: (MonadDOM m) => WebTransportHash -> m BufferSource
getValue self = liftDOM ((js_getValue (self)))