ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/NotificationEvent.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from notifications (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.NotificationEvent
(js_newNotificationEvent, js_getNotification, js_getAction, newNotificationEvent, getNotification, getAction, NotificationEvent(..), gTypeNotificationEvent)
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 new globalThis[\"NotificationEvent\"]($1, $2); })"
js_newNotificationEvent :: JSString -> NotificationEventInit -> IO NotificationEvent
-- | <https://developer.mozilla.org/docs/Web/API/NotificationEvent/NotificationEvent MDN NotificationEvent. documentation>
newNotificationEvent :: (MonadDOM m, ToJSString type') => type' -> NotificationEventInit -> m NotificationEvent
newNotificationEvent type' eventInitDict = liftDOM ((js_newNotificationEvent (toJSString type') (eventInitDict)))
foreign import javascript unsafe "(($1) => { return $1[\"notification\"]; })"
js_getNotification :: NotificationEvent -> IO Notification
-- | <https://developer.mozilla.org/docs/Web/API/NotificationEvent/notification MDN NotificationEvent.notification documentation>
getNotification :: (MonadDOM m) => NotificationEvent -> m Notification
getNotification self = liftDOM ((js_getNotification (self)))
foreign import javascript unsafe "(($1) => { return $1[\"action\"]; })"
js_getAction :: NotificationEvent -> IO JSString
-- | <https://developer.mozilla.org/docs/Web/API/NotificationEvent/action MDN NotificationEvent.action documentation>
getAction :: (MonadDOM m, FromJSString result) => NotificationEvent -> m result
getAction self = liftDOM ((fromJSString <$> (js_getAction (self))))