ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/AriaNotificationOptions.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from wai-aria-1.3 (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.AriaNotificationOptions
(js_newAriaNotificationOptions, js_setPriority, js_getPriority, newAriaNotificationOptions, setPriority, getPriority, getPriorityUnsafe, getPriorityUnchecked, AriaNotificationOptions(..), gTypeAriaNotificationOptions)
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 "(() => { return ({}); })"
js_newAriaNotificationOptions :: IO AriaNotificationOptions
-- | <https://w3c.github.io/aria/#dom-arianotificationoptions AriaNotificationOptions specification>
newAriaNotificationOptions :: (MonadDOM m) => m AriaNotificationOptions
newAriaNotificationOptions = liftDOM ((js_newAriaNotificationOptions))
foreign import javascript safe "(($1, $2) => { $1[\"priority\"] = $2; })"
js_setPriority :: AriaNotificationOptions -> JSVal -> IO ()
-- | <https://w3c.github.io/aria/#dom-arianotificationoptions-priority AriaNotificationOptions.priority specification>
setPriority :: (MonadDOM m) => AriaNotificationOptions -> AriaNotifyPriority -> m ()
setPriority self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setPriority (self) a2')))
foreign import javascript unsafe "(($1) => { return $1[\"priority\"]; })"
js_getPriority :: AriaNotificationOptions -> IO JSVal
-- | <https://w3c.github.io/aria/#dom-arianotificationoptions-priority AriaNotificationOptions.priority specification>
getPriority :: (MonadDOM m) => AriaNotificationOptions -> m (Maybe AriaNotifyPriority)
getPriority self = liftDOM (((js_getPriority (self)) >>= fromJSValUnchecked))
-- | <https://w3c.github.io/aria/#dom-arianotificationoptions-priority AriaNotificationOptions.priority specification>
getPriorityUnsafe :: (MonadDOM m, HasCallStack) => AriaNotificationOptions -> m AriaNotifyPriority
getPriorityUnsafe self = liftDOM ((((js_getPriority (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/aria/#dom-arianotificationoptions-priority AriaNotificationOptions.priority specification>
getPriorityUnchecked :: (MonadDOM m) => AriaNotificationOptions -> m AriaNotifyPriority
getPriorityUnchecked self = liftDOM ((pFromJSVal <$> (js_getPriority (self))))