ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/ServiceWorkerGlobalScope.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from service-workers (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.ServiceWorkerGlobalScope
(js_skipWaiting, js_getClients, js_getRegistration, js_getServiceWorker, js_getCookieStore, skipWaiting, getClients, getRegistration, getServiceWorker, getCookieStore, install, activate, fetch, message, messageerror, cookiechange, notificationclick, notificationclose, push, pushsubscriptionchange, ServiceWorkerGlobalScope(..), gTypeServiceWorkerGlobalScope)
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 interruptible "(($1, $c) => { return $1[\"skipWaiting\"]().then(function(s) { $c(null, s);}, function(e) { $c(e, null);}); })"
js_skipWaiting :: ServiceWorkerGlobalScope -> IO (JSVal, ())
-- | <https://developer.mozilla.org/docs/Web/API/ServiceWorkerGlobalScope/skipWaiting MDN ServiceWorkerGlobalScope.skipWaiting documentation>
skipWaiting :: (MonadDOM m) => ServiceWorkerGlobalScope -> m ()
skipWaiting self = liftDOM (void (((js_skipWaiting (self)) >>= checkPromiseResult)))
foreign import javascript unsafe "(($1) => { return $1[\"clients\"]; })"
js_getClients :: ServiceWorkerGlobalScope -> IO Clients
-- | <https://developer.mozilla.org/docs/Web/API/ServiceWorkerGlobalScope/clients MDN ServiceWorkerGlobalScope.clients documentation>
getClients :: (MonadDOM m) => ServiceWorkerGlobalScope -> m Clients
getClients self = liftDOM ((js_getClients (self)))
foreign import javascript unsafe "(($1) => { return $1[\"registration\"]; })"
js_getRegistration :: ServiceWorkerGlobalScope -> IO ServiceWorkerRegistration
-- | <https://developer.mozilla.org/docs/Web/API/ServiceWorkerGlobalScope/registration MDN ServiceWorkerGlobalScope.registration documentation>
getRegistration :: (MonadDOM m) => ServiceWorkerGlobalScope -> m ServiceWorkerRegistration
getRegistration self = liftDOM ((js_getRegistration (self)))
foreign import javascript unsafe "(($1) => { return $1[\"serviceWorker\"]; })"
js_getServiceWorker :: ServiceWorkerGlobalScope -> IO ServiceWorker
-- | <https://developer.mozilla.org/docs/Web/API/ServiceWorkerGlobalScope/serviceWorker MDN ServiceWorkerGlobalScope.serviceWorker documentation>
getServiceWorker :: (MonadDOM m) => ServiceWorkerGlobalScope -> m ServiceWorker
getServiceWorker self = liftDOM ((js_getServiceWorker (self)))
foreign import javascript unsafe "(($1) => { return $1[\"cookieStore\"]; })"
js_getCookieStore :: ServiceWorkerGlobalScope -> IO CookieStore
-- | <https://developer.mozilla.org/docs/Web/API/ServiceWorkerGlobalScope/cookieStore MDN ServiceWorkerGlobalScope.cookieStore documentation>
getCookieStore :: (MonadDOM m) => ServiceWorkerGlobalScope -> m CookieStore
getCookieStore self = liftDOM ((js_getCookieStore (self)))
-- | <https://w3c.github.io/ServiceWorker/#dom-serviceworkerglobalscope-oninstall install event>
install :: EventName ServiceWorkerGlobalScope InstallEvent
install = unsafeEventName (toJSString "install")
-- | <https://w3c.github.io/ServiceWorker/#dom-serviceworkerglobalscope-onactivate activate event>
activate :: EventName ServiceWorkerGlobalScope ExtendableEvent
activate = unsafeEventName (toJSString "activate")
-- | <https://w3c.github.io/ServiceWorker/#dom-serviceworkerglobalscope-onfetch fetch event>
fetch :: EventName ServiceWorkerGlobalScope FetchEvent
fetch = unsafeEventName (toJSString "fetch")
-- | <https://w3c.github.io/ServiceWorker/#dom-serviceworkerglobalscope-onmessage message event>
message :: EventName ServiceWorkerGlobalScope ExtendableMessageEvent
message = unsafeEventNameAsync (toJSString "message")
-- | <https://w3c.github.io/ServiceWorker/#dom-serviceworkerglobalscope-onmessageerror messageerror event>
messageerror :: EventName ServiceWorkerGlobalScope ExtendableMessageEvent
messageerror = unsafeEventName (toJSString "messageerror")
-- | <https://cookiestore.spec.whatwg.org/#dom-serviceworkerglobalscope-oncookiechange cookiechange event>
cookiechange :: EventName ServiceWorkerGlobalScope ExtendableCookieChangeEvent
cookiechange = unsafeEventName (toJSString "cookiechange")
-- | <https://notifications.spec.whatwg.org/#dom-serviceworkerglobalscope-onnotificationclick notificationclick event>
notificationclick :: EventName ServiceWorkerGlobalScope NotificationEvent
notificationclick = unsafeEventName (toJSString "notificationclick")
-- | <https://notifications.spec.whatwg.org/#dom-serviceworkerglobalscope-onnotificationclose notificationclose event>
notificationclose :: EventName ServiceWorkerGlobalScope NotificationEvent
notificationclose = unsafeEventName (toJSString "notificationclose")
-- | <https://w3c.github.io/push-api/#dom-serviceworkerglobalscope-onpush push event>
push :: EventName ServiceWorkerGlobalScope PushEvent
push = unsafeEventName (toJSString "push")
-- | <https://w3c.github.io/push-api/#dom-serviceworkerglobalscope-onpushsubscriptionchange pushsubscriptionchange event>
pushsubscriptionchange :: EventName ServiceWorkerGlobalScope PushSubscriptionChangeEvent
pushsubscriptionchange = unsafeEventName (toJSString "pushsubscriptionchange")