jsaddle-dom-0.10.0.0: src/JSDOM/Generated/ServiceWorkerGlobalScope.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from service-workers (webref). Do not edit.
module JSDOM.Generated.ServiceWorkerGlobalScope
(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 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
-- | <https://developer.mozilla.org/docs/Web/API/ServiceWorkerGlobalScope/skipWaiting MDN ServiceWorkerGlobalScope.skipWaiting documentation>
skipWaiting :: (MonadDOM m) => ServiceWorkerGlobalScope -> m ()
skipWaiting self = liftDOM (void (((self ^. jsf "skipWaiting" ()) >>= readPromise)))
-- | <https://developer.mozilla.org/docs/Web/API/ServiceWorkerGlobalScope/clients MDN ServiceWorkerGlobalScope.clients documentation>
getClients :: (MonadDOM m) => ServiceWorkerGlobalScope -> m Clients
getClients self = liftDOM (((self ^. js "clients") >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/ServiceWorkerGlobalScope/registration MDN ServiceWorkerGlobalScope.registration documentation>
getRegistration :: (MonadDOM m) => ServiceWorkerGlobalScope -> m ServiceWorkerRegistration
getRegistration self = liftDOM (((self ^. js "registration") >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/ServiceWorkerGlobalScope/serviceWorker MDN ServiceWorkerGlobalScope.serviceWorker documentation>
getServiceWorker :: (MonadDOM m) => ServiceWorkerGlobalScope -> m ServiceWorker
getServiceWorker self = liftDOM (((self ^. js "serviceWorker") >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/ServiceWorkerGlobalScope/cookieStore MDN ServiceWorkerGlobalScope.cookieStore documentation>
getCookieStore :: (MonadDOM m) => ServiceWorkerGlobalScope -> m CookieStore
getCookieStore self = liftDOM (((self ^. js "cookieStore") >>= fromJSValUnchecked))
-- | <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")