ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/PushSubscriptionOptions.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from push-api (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.PushSubscriptionOptions
(js_getUserVisibleOnly, js_getApplicationServerKey, getUserVisibleOnly, getApplicationServerKey, getApplicationServerKeyUnsafe, getApplicationServerKeyUnchecked, PushSubscriptionOptions(..), gTypePushSubscriptionOptions)
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[\"userVisibleOnly\"]; })"
js_getUserVisibleOnly :: PushSubscriptionOptions -> IO Bool
-- | <https://developer.mozilla.org/docs/Web/API/PushSubscriptionOptions/userVisibleOnly MDN PushSubscriptionOptions.userVisibleOnly documentation>
getUserVisibleOnly :: (MonadDOM m) => PushSubscriptionOptions -> m Bool
getUserVisibleOnly self = liftDOM ((js_getUserVisibleOnly (self)))
foreign import javascript unsafe "(($1) => { return $1[\"applicationServerKey\"]; })"
js_getApplicationServerKey :: PushSubscriptionOptions -> IO JSVal
-- | <https://developer.mozilla.org/docs/Web/API/PushSubscriptionOptions/applicationServerKey MDN PushSubscriptionOptions.applicationServerKey documentation>
getApplicationServerKey :: (MonadDOM m) => PushSubscriptionOptions -> m (Maybe ArrayBuffer)
getApplicationServerKey self = liftDOM (((js_getApplicationServerKey (self)) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/PushSubscriptionOptions/applicationServerKey MDN PushSubscriptionOptions.applicationServerKey documentation>
getApplicationServerKeyUnsafe :: (MonadDOM m, HasCallStack) => PushSubscriptionOptions -> m ArrayBuffer
getApplicationServerKeyUnsafe self = liftDOM ((((js_getApplicationServerKey (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://developer.mozilla.org/docs/Web/API/PushSubscriptionOptions/applicationServerKey MDN PushSubscriptionOptions.applicationServerKey documentation>
getApplicationServerKeyUnchecked :: (MonadDOM m) => PushSubscriptionOptions -> m ArrayBuffer
getApplicationServerKeyUnchecked self = liftDOM ((pFromJSVal <$> (js_getApplicationServerKey (self))))