packages feed

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

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from secure-payment-confirmation (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.AuthenticationExtensionsPaymentOutputs
       (js_newAuthenticationExtensionsPaymentOutputs, js_setBrowserBoundSignature, js_getBrowserBoundSignature, newAuthenticationExtensionsPaymentOutputs, setBrowserBoundSignature, getBrowserBoundSignature, getBrowserBoundSignatureUnsafe, getBrowserBoundSignatureUnchecked, AuthenticationExtensionsPaymentOutputs(..), gTypeAuthenticationExtensionsPaymentOutputs)
       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_newAuthenticationExtensionsPaymentOutputs :: IO AuthenticationExtensionsPaymentOutputs
-- | <https://w3c.github.io/secure-payment-confirmation/#dictdef-authenticationextensionspaymentoutputs AuthenticationExtensionsPaymentOutputs specification>
newAuthenticationExtensionsPaymentOutputs :: (MonadDOM m) => m AuthenticationExtensionsPaymentOutputs
newAuthenticationExtensionsPaymentOutputs = liftDOM ((js_newAuthenticationExtensionsPaymentOutputs))

foreign import javascript safe "(($1, $2) => { $1[\"browserBoundSignature\"] = $2; })"
        js_setBrowserBoundSignature :: AuthenticationExtensionsPaymentOutputs -> BrowserBoundSignature -> IO ()
-- | <https://w3c.github.io/secure-payment-confirmation/#dom-authenticationextensionspaymentoutputs-browserboundsignature AuthenticationExtensionsPaymentOutputs.browserBoundSignature specification>
setBrowserBoundSignature :: (MonadDOM m) => AuthenticationExtensionsPaymentOutputs -> BrowserBoundSignature -> m ()
setBrowserBoundSignature self val = liftDOM (void ((js_setBrowserBoundSignature (self) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"browserBoundSignature\"]; })"
        js_getBrowserBoundSignature :: AuthenticationExtensionsPaymentOutputs -> IO JSVal
-- | <https://w3c.github.io/secure-payment-confirmation/#dom-authenticationextensionspaymentoutputs-browserboundsignature AuthenticationExtensionsPaymentOutputs.browserBoundSignature specification>
getBrowserBoundSignature :: (MonadDOM m) => AuthenticationExtensionsPaymentOutputs -> m (Maybe BrowserBoundSignature)
getBrowserBoundSignature self = liftDOM (((js_getBrowserBoundSignature (self)) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/secure-payment-confirmation/#dom-authenticationextensionspaymentoutputs-browserboundsignature AuthenticationExtensionsPaymentOutputs.browserBoundSignature specification>
getBrowserBoundSignatureUnsafe :: (MonadDOM m, HasCallStack) => AuthenticationExtensionsPaymentOutputs -> m BrowserBoundSignature
getBrowserBoundSignatureUnsafe self = liftDOM ((((js_getBrowserBoundSignature (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/secure-payment-confirmation/#dom-authenticationextensionspaymentoutputs-browserboundsignature AuthenticationExtensionsPaymentOutputs.browserBoundSignature specification>
getBrowserBoundSignatureUnchecked :: (MonadDOM m) => AuthenticationExtensionsPaymentOutputs -> m BrowserBoundSignature
getBrowserBoundSignatureUnchecked self = liftDOM ((pFromJSVal <$> (js_getBrowserBoundSignature (self))))