jsaddle-dom-0.10.0.0: src/JSDOM/Generated/DigitalCredential.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from digital-credentials (webref). Do not edit.
module JSDOM.Generated.DigitalCredential
(toJSON, toJSON_, userAgentAllowsProtocol, userAgentAllowsProtocol_, getProtocol, getData, DigitalCredential(..), gTypeDigitalCredential)
where
import Prelude ((.), (==), (>>=), (<$>), (++), Bool(..), Maybe(..), IO, Int, Word, Double, Float)
import qualified Prelude as P
import Control.Monad (void)
import Control.Lens.Operators ((^.))
import Language.Javascript.JSaddle (JSM, JSVal, JSString, toJSVal, valToBool, valToNumber, js, jss, jsf, jsg, new, function, asyncFunction, jsUndefined, jsNull)
import JSDOM.Types
import qualified JSDOM.Types as Types
import JSDOM.EventTargetClosures (EventName, unsafeEventName, unsafeEventNameAsync)
import JSDOM.Generated.Enums
toJSON :: (MonadDOM m) => DigitalCredential -> m GObject
toJSON self = liftDOM (((self ^. jsf "toJSON" ()) >>= fromJSValUnchecked))
toJSON_ :: (MonadDOM m) => DigitalCredential -> m ()
toJSON_ self = liftDOM (void (self ^. jsf "toJSON" ()))
-- | <https://w3c-fedid.github.io/digital-credentials/#dom-digitalcredential-useragentallowsprotocol DigitalCredential.userAgentAllowsProtocol specification>
userAgentAllowsProtocol :: (MonadDOM m, ToJSString protocol) => protocol -> m Bool
userAgentAllowsProtocol protocol = liftDOM ((((jsg "DigitalCredential") ^. jsf "userAgentAllowsProtocol" [toJSVal protocol]) >>= valToBool))
-- | <https://w3c-fedid.github.io/digital-credentials/#dom-digitalcredential-useragentallowsprotocol DigitalCredential.userAgentAllowsProtocol specification>
userAgentAllowsProtocol_ :: (MonadDOM m, ToJSString protocol) => protocol -> m ()
userAgentAllowsProtocol_ protocol = liftDOM (void ((jsg "DigitalCredential") ^. jsf "userAgentAllowsProtocol" [toJSVal protocol]))
-- | <https://w3c-fedid.github.io/digital-credentials/#dom-digitalcredential-protocol DigitalCredential.protocol specification>
getProtocol :: (MonadDOM m) => DigitalCredential -> m DigitalCredentialProtocol
getProtocol self = liftDOM (((self ^. js "protocol") >>= fromJSValUnchecked))
-- | <https://w3c-fedid.github.io/digital-credentials/#dom-digitalcredential-data DigitalCredential.data specification>
getData :: (MonadDOM m) => DigitalCredential -> m GObject
getData self = liftDOM (((self ^. js "data") >>= fromJSValUnchecked))