ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/AuthenticatorAssertionResponse.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.AuthenticatorAssertionResponse
(js_getAuthenticatorData, js_getSignature, js_getUserHandle, getAuthenticatorData, getSignature, getUserHandle, getUserHandleUnsafe, getUserHandleUnchecked, AuthenticatorAssertionResponse(..), gTypeAuthenticatorAssertionResponse)
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 unsafe "(($1) => { return $1[\"authenticatorData\"]; })"
js_getAuthenticatorData :: AuthenticatorAssertionResponse -> IO ArrayBuffer
-- | <https://developer.mozilla.org/docs/Web/API/AuthenticatorAssertionResponse/authenticatorData MDN AuthenticatorAssertionResponse.authenticatorData documentation>
getAuthenticatorData :: (MonadDOM m) => AuthenticatorAssertionResponse -> m ArrayBuffer
getAuthenticatorData self = liftDOM ((js_getAuthenticatorData (self)))
foreign import javascript unsafe "(($1) => { return $1[\"signature\"]; })"
js_getSignature :: AuthenticatorAssertionResponse -> IO ArrayBuffer
-- | <https://developer.mozilla.org/docs/Web/API/AuthenticatorAssertionResponse/signature MDN AuthenticatorAssertionResponse.signature documentation>
getSignature :: (MonadDOM m) => AuthenticatorAssertionResponse -> m ArrayBuffer
getSignature self = liftDOM ((js_getSignature (self)))
foreign import javascript unsafe "(($1) => { return $1[\"userHandle\"]; })"
js_getUserHandle :: AuthenticatorAssertionResponse -> IO JSVal
-- | <https://developer.mozilla.org/docs/Web/API/AuthenticatorAssertionResponse/userHandle MDN AuthenticatorAssertionResponse.userHandle documentation>
getUserHandle :: (MonadDOM m) => AuthenticatorAssertionResponse -> m (Maybe ArrayBuffer)
getUserHandle self = liftDOM (((js_getUserHandle (self)) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/AuthenticatorAssertionResponse/userHandle MDN AuthenticatorAssertionResponse.userHandle documentation>
getUserHandleUnsafe :: (MonadDOM m, HasCallStack) => AuthenticatorAssertionResponse -> m ArrayBuffer
getUserHandleUnsafe self = liftDOM ((((js_getUserHandle (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://developer.mozilla.org/docs/Web/API/AuthenticatorAssertionResponse/userHandle MDN AuthenticatorAssertionResponse.userHandle documentation>
getUserHandleUnchecked :: (MonadDOM m) => AuthenticatorAssertionResponse -> m ArrayBuffer
getUserHandleUnchecked self = liftDOM ((pFromJSVal <$> (js_getUserHandle (self))))