ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/PublicKeyCredentialParameters.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.PublicKeyCredentialParameters
(js_newPublicKeyCredentialParameters, js_setType, js_getType, js_setAlg, js_getAlg, newPublicKeyCredentialParameters, setType, getType, setAlg, getAlg, PublicKeyCredentialParameters(..), gTypePublicKeyCredentialParameters)
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, $2) => { return ({\"type\": $1, \"alg\": $2}); })"
js_newPublicKeyCredentialParameters :: JSString -> Int -> IO PublicKeyCredentialParameters
-- | <https://w3c.github.io/webauthn/#dictdef-publickeycredentialparameters PublicKeyCredentialParameters specification>
newPublicKeyCredentialParameters :: (MonadDOM m, ToJSString type') => type' -> Int -> m PublicKeyCredentialParameters
newPublicKeyCredentialParameters type' alg = liftDOM ((js_newPublicKeyCredentialParameters (toJSString type') (alg)))
foreign import javascript safe "(($1, $2) => { $1[\"type\"] = $2; })"
js_setType :: PublicKeyCredentialParameters -> JSString -> IO ()
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialparameters-type PublicKeyCredentialParameters.type specification>
setType :: (MonadDOM m, ToJSString val) => PublicKeyCredentialParameters -> val -> m ()
setType self val = liftDOM (void ((js_setType (self) (toJSString val))))
foreign import javascript unsafe "(($1) => { return $1[\"type\"]; })"
js_getType :: PublicKeyCredentialParameters -> IO JSString
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialparameters-type PublicKeyCredentialParameters.type specification>
getType :: (MonadDOM m, FromJSString result) => PublicKeyCredentialParameters -> m result
getType self = liftDOM ((fromJSString <$> (js_getType (self))))
foreign import javascript safe "(($1, $2) => { $1[\"alg\"] = $2; })"
js_setAlg :: PublicKeyCredentialParameters -> Int -> IO ()
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialparameters-alg PublicKeyCredentialParameters.alg specification>
setAlg :: (MonadDOM m) => PublicKeyCredentialParameters -> Int -> m ()
setAlg self val = liftDOM (void ((js_setAlg (self) (val))))
foreign import javascript unsafe "(($1) => { return $1[\"alg\"]; })"
js_getAlg :: PublicKeyCredentialParameters -> IO Int
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialparameters-alg PublicKeyCredentialParameters.alg specification>
getAlg :: (MonadDOM m) => PublicKeyCredentialParameters -> m Int
getAlg self = liftDOM ((js_getAlg (self)))