packages feed

ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/AuthenticationExtensionsPRFOutputs.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.AuthenticationExtensionsPRFOutputs
       (js_newAuthenticationExtensionsPRFOutputs, js_setEnabled, js_getEnabled, js_setResults, js_getResults, newAuthenticationExtensionsPRFOutputs, setEnabled, getEnabled, getEnabledUnsafe, getEnabledUnchecked, setResults, getResults, getResultsUnsafe, getResultsUnchecked, AuthenticationExtensionsPRFOutputs(..), gTypeAuthenticationExtensionsPRFOutputs)
       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_newAuthenticationExtensionsPRFOutputs :: IO AuthenticationExtensionsPRFOutputs
-- | <https://w3c.github.io/webauthn/#dictdef-authenticationextensionsprfoutputs AuthenticationExtensionsPRFOutputs specification>
newAuthenticationExtensionsPRFOutputs :: (MonadDOM m) => m AuthenticationExtensionsPRFOutputs
newAuthenticationExtensionsPRFOutputs = liftDOM ((js_newAuthenticationExtensionsPRFOutputs))

foreign import javascript safe "(($1, $2) => { $1[\"enabled\"] = $2; })"
        js_setEnabled :: AuthenticationExtensionsPRFOutputs -> Bool -> IO ()
-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfoutputs-enabled AuthenticationExtensionsPRFOutputs.enabled specification>
setEnabled :: (MonadDOM m) => AuthenticationExtensionsPRFOutputs -> Bool -> m ()
setEnabled self val = liftDOM (void ((js_setEnabled (self) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"enabled\"]; })"
        js_getEnabled :: AuthenticationExtensionsPRFOutputs -> IO JSVal
-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfoutputs-enabled AuthenticationExtensionsPRFOutputs.enabled specification>
getEnabled :: (MonadDOM m) => AuthenticationExtensionsPRFOutputs -> m (Maybe Bool)
getEnabled self = liftDOM (((js_getEnabled (self)) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfoutputs-enabled AuthenticationExtensionsPRFOutputs.enabled specification>
getEnabledUnsafe :: (MonadDOM m, HasCallStack) => AuthenticationExtensionsPRFOutputs -> m Bool
getEnabledUnsafe self = liftDOM ((((js_getEnabled (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfoutputs-enabled AuthenticationExtensionsPRFOutputs.enabled specification>
getEnabledUnchecked :: (MonadDOM m) => AuthenticationExtensionsPRFOutputs -> m Bool
getEnabledUnchecked self = liftDOM ((pFromJSVal <$> (js_getEnabled (self))))

foreign import javascript safe "(($1, $2) => { $1[\"results\"] = $2; })"
        js_setResults :: AuthenticationExtensionsPRFOutputs -> AuthenticationExtensionsPRFValues -> IO ()
-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfoutputs-results AuthenticationExtensionsPRFOutputs.results specification>
setResults :: (MonadDOM m) => AuthenticationExtensionsPRFOutputs -> AuthenticationExtensionsPRFValues -> m ()
setResults self val = liftDOM (void ((js_setResults (self) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"results\"]; })"
        js_getResults :: AuthenticationExtensionsPRFOutputs -> IO JSVal
-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfoutputs-results AuthenticationExtensionsPRFOutputs.results specification>
getResults :: (MonadDOM m) => AuthenticationExtensionsPRFOutputs -> m (Maybe AuthenticationExtensionsPRFValues)
getResults self = liftDOM (((js_getResults (self)) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfoutputs-results AuthenticationExtensionsPRFOutputs.results specification>
getResultsUnsafe :: (MonadDOM m, HasCallStack) => AuthenticationExtensionsPRFOutputs -> m AuthenticationExtensionsPRFValues
getResultsUnsafe self = liftDOM ((((js_getResults (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfoutputs-results AuthenticationExtensionsPRFOutputs.results specification>
getResultsUnchecked :: (MonadDOM m) => AuthenticationExtensionsPRFOutputs -> m AuthenticationExtensionsPRFValues
getResultsUnchecked self = liftDOM ((pFromJSVal <$> (js_getResults (self))))