packages feed

ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/AuthenticationExtensionsPRFInputsJSON.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.AuthenticationExtensionsPRFInputsJSON
       (js_newAuthenticationExtensionsPRFInputsJSON, js_setEval, js_getEval, js_setEvalByCredential, js_getEvalByCredential, newAuthenticationExtensionsPRFInputsJSON, setEval, getEval, getEvalUnsafe, getEvalUnchecked, setEvalByCredential, getEvalByCredential, getEvalByCredentialUnsafe, getEvalByCredentialUnchecked, AuthenticationExtensionsPRFInputsJSON(..), gTypeAuthenticationExtensionsPRFInputsJSON)
       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 "(() => { return ({}); })"
        js_newAuthenticationExtensionsPRFInputsJSON :: IO AuthenticationExtensionsPRFInputsJSON
-- | <https://w3c.github.io/webauthn/#dictdef-authenticationextensionsprfinputsjson AuthenticationExtensionsPRFInputsJSON specification>
newAuthenticationExtensionsPRFInputsJSON :: (MonadDOM m) => m AuthenticationExtensionsPRFInputsJSON
newAuthenticationExtensionsPRFInputsJSON = liftDOM ((js_newAuthenticationExtensionsPRFInputsJSON))

foreign import javascript safe "(($1, $2) => { $1[\"eval\"] = $2; })"
        js_setEval :: AuthenticationExtensionsPRFInputsJSON -> AuthenticationExtensionsPRFValuesJSON -> IO ()
-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfinputsjson-eval AuthenticationExtensionsPRFInputsJSON.eval specification>
setEval :: (MonadDOM m) => AuthenticationExtensionsPRFInputsJSON -> AuthenticationExtensionsPRFValuesJSON -> m ()
setEval self val = liftDOM (void ((js_setEval (self) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"eval\"]; })"
        js_getEval :: AuthenticationExtensionsPRFInputsJSON -> IO JSVal
-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfinputsjson-eval AuthenticationExtensionsPRFInputsJSON.eval specification>
getEval :: (MonadDOM m) => AuthenticationExtensionsPRFInputsJSON -> m (Maybe AuthenticationExtensionsPRFValuesJSON)
getEval self = liftDOM (((js_getEval (self)) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfinputsjson-eval AuthenticationExtensionsPRFInputsJSON.eval specification>
getEvalUnsafe :: (MonadDOM m, HasCallStack) => AuthenticationExtensionsPRFInputsJSON -> m AuthenticationExtensionsPRFValuesJSON
getEvalUnsafe self = liftDOM ((((js_getEval (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfinputsjson-eval AuthenticationExtensionsPRFInputsJSON.eval specification>
getEvalUnchecked :: (MonadDOM m) => AuthenticationExtensionsPRFInputsJSON -> m AuthenticationExtensionsPRFValuesJSON
getEvalUnchecked self = liftDOM ((pFromJSVal <$> (js_getEval (self))))

foreign import javascript safe "(($1, $2) => { $1[\"evalByCredential\"] = $2; })"
        js_setEvalByCredential :: AuthenticationExtensionsPRFInputsJSON -> JSVal -> IO ()
-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfinputsjson-evalbycredential AuthenticationExtensionsPRFInputsJSON.evalByCredential specification>
setEvalByCredential :: (MonadDOM m) => AuthenticationExtensionsPRFInputsJSON -> (Record JSString JSVal) -> m ()
setEvalByCredential self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setEvalByCredential (self) a2')))

foreign import javascript unsafe "(($1) => { return $1[\"evalByCredential\"]; })"
        js_getEvalByCredential :: AuthenticationExtensionsPRFInputsJSON -> IO JSVal
-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfinputsjson-evalbycredential AuthenticationExtensionsPRFInputsJSON.evalByCredential specification>
getEvalByCredential :: (MonadDOM m) => AuthenticationExtensionsPRFInputsJSON -> m (Maybe (Record JSString JSVal))
getEvalByCredential self = liftDOM (((js_getEvalByCredential (self)) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfinputsjson-evalbycredential AuthenticationExtensionsPRFInputsJSON.evalByCredential specification>
getEvalByCredentialUnsafe :: (MonadDOM m, HasCallStack) => AuthenticationExtensionsPRFInputsJSON -> m (Record JSString JSVal)
getEvalByCredentialUnsafe self = liftDOM ((((js_getEvalByCredential (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfinputsjson-evalbycredential AuthenticationExtensionsPRFInputsJSON.evalByCredential specification>
getEvalByCredentialUnchecked :: (MonadDOM m) => AuthenticationExtensionsPRFInputsJSON -> m (Record JSString JSVal)
getEvalByCredentialUnchecked self = liftDOM ((pFromJSVal <$> (js_getEvalByCredential (self))))