ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/AuthenticationExtensionsPRFValues.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from webauthn-4 (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.AuthenticationExtensionsPRFValues
(js_newAuthenticationExtensionsPRFValues, js_setFirst, js_getFirst, js_setSecond, js_getSecond, newAuthenticationExtensionsPRFValues, setFirst, getFirst, setSecond, getSecond, getSecondUnsafe, getSecondUnchecked, AuthenticationExtensionsPRFValues(..), gTypeAuthenticationExtensionsPRFValues)
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 ({\"first\": $1}); })"
js_newAuthenticationExtensionsPRFValues :: BufferSource -> IO AuthenticationExtensionsPRFValues
-- | <https://w3c.github.io/webauthn/#dictdef-authenticationextensionsprfvalues AuthenticationExtensionsPRFValues specification>
newAuthenticationExtensionsPRFValues :: (MonadDOM m, IsBufferSource first) => first -> m AuthenticationExtensionsPRFValues
newAuthenticationExtensionsPRFValues first = liftDOM ((js_newAuthenticationExtensionsPRFValues (Types.toBufferSource first)))
foreign import javascript safe "(($1, $2) => { $1[\"first\"] = $2; })"
js_setFirst :: AuthenticationExtensionsPRFValues -> BufferSource -> IO ()
-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfvalues-first AuthenticationExtensionsPRFValues.first specification>
setFirst :: (MonadDOM m, IsBufferSource val) => AuthenticationExtensionsPRFValues -> val -> m ()
setFirst self val = liftDOM (void ((js_setFirst (self) (Types.toBufferSource val))))
foreign import javascript unsafe "(($1) => { return $1[\"first\"]; })"
js_getFirst :: AuthenticationExtensionsPRFValues -> IO BufferSource
-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfvalues-first AuthenticationExtensionsPRFValues.first specification>
getFirst :: (MonadDOM m) => AuthenticationExtensionsPRFValues -> m BufferSource
getFirst self = liftDOM ((js_getFirst (self)))
foreign import javascript safe "(($1, $2) => { $1[\"second\"] = $2; })"
js_setSecond :: AuthenticationExtensionsPRFValues -> BufferSource -> IO ()
-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfvalues-second AuthenticationExtensionsPRFValues.second specification>
setSecond :: (MonadDOM m, IsBufferSource val) => AuthenticationExtensionsPRFValues -> val -> m ()
setSecond self val = liftDOM (void ((js_setSecond (self) (Types.toBufferSource val))))
foreign import javascript unsafe "(($1) => { return $1[\"second\"]; })"
js_getSecond :: AuthenticationExtensionsPRFValues -> IO JSVal
-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfvalues-second AuthenticationExtensionsPRFValues.second specification>
getSecond :: (MonadDOM m) => AuthenticationExtensionsPRFValues -> m (Maybe BufferSource)
getSecond self = liftDOM (((js_getSecond (self)) >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfvalues-second AuthenticationExtensionsPRFValues.second specification>
getSecondUnsafe :: (MonadDOM m, HasCallStack) => AuthenticationExtensionsPRFValues -> m BufferSource
getSecondUnsafe self = liftDOM ((((js_getSecond (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfvalues-second AuthenticationExtensionsPRFValues.second specification>
getSecondUnchecked :: (MonadDOM m) => AuthenticationExtensionsPRFValues -> m BufferSource
getSecondUnchecked self = liftDOM ((pFromJSVal <$> (js_getSecond (self))))