jsaddle-dom-0.10.0.0: src/JSDOM/Generated/HTMLOrSVGOrMathMLElement.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from html (webref). Do not edit.
module JSDOM.Generated.HTMLOrSVGOrMathMLElement
(blur, focus, focus', getDataset, setNonce, getNonce, setAutofocus, getAutofocus, setTabIndex, getTabIndex, HTMLOrSVGOrMathMLElement(..), gTypeHTMLOrSVGOrMathMLElement, IsHTMLOrSVGOrMathMLElement, toHTMLOrSVGOrMathMLElement)
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/HTMLElement/blur MDN HTMLOrSVGOrMathMLElement.blur documentation>
blur :: (MonadDOM m, IsHTMLOrSVGOrMathMLElement self) => self -> m ()
blur self = liftDOM (void ((Types.toHTMLOrSVGOrMathMLElement self) ^. jsf "blur" ()))
-- | <https://developer.mozilla.org/docs/Web/API/HTMLElement/focus MDN HTMLOrSVGOrMathMLElement.focus documentation>
focus :: (MonadDOM m, IsHTMLOrSVGOrMathMLElement self) => self -> m ()
focus self = liftDOM (void ((Types.toHTMLOrSVGOrMathMLElement self) ^. jsf "focus" ()))
-- | <https://developer.mozilla.org/docs/Web/API/HTMLElement/focus MDN HTMLOrSVGOrMathMLElement.focus documentation>
focus' :: (MonadDOM m, IsHTMLOrSVGOrMathMLElement self) => self -> Maybe FocusOptions -> m ()
focus' self options = liftDOM (void ((Types.toHTMLOrSVGOrMathMLElement self) ^. jsf "focus" [P.maybe (P.return jsUndefined) toJSVal options]))
-- | <https://developer.mozilla.org/docs/Web/API/HTMLElement/dataset MDN HTMLOrSVGOrMathMLElement.dataset documentation>
getDataset :: (MonadDOM m, IsHTMLOrSVGOrMathMLElement self) => self -> m DOMStringMap
getDataset self = liftDOM ((((Types.toHTMLOrSVGOrMathMLElement self) ^. js "dataset") >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/HTMLElement/nonce MDN HTMLOrSVGOrMathMLElement.nonce documentation>
setNonce :: (MonadDOM m, IsHTMLOrSVGOrMathMLElement self, ToJSString val) => self -> val -> m ()
setNonce self val = liftDOM (void ((Types.toHTMLOrSVGOrMathMLElement self) ^. jss "nonce" (toJSVal val)))
-- | <https://developer.mozilla.org/docs/Web/API/HTMLElement/nonce MDN HTMLOrSVGOrMathMLElement.nonce documentation>
getNonce :: (MonadDOM m, IsHTMLOrSVGOrMathMLElement self, FromJSString result) => self -> m result
getNonce self = liftDOM ((((Types.toHTMLOrSVGOrMathMLElement self) ^. js "nonce") >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/HTMLElement/autofocus MDN HTMLOrSVGOrMathMLElement.autofocus documentation>
setAutofocus :: (MonadDOM m, IsHTMLOrSVGOrMathMLElement self) => self -> Bool -> m ()
setAutofocus self val = liftDOM (void ((Types.toHTMLOrSVGOrMathMLElement self) ^. jss "autofocus" (toJSVal val)))
-- | <https://developer.mozilla.org/docs/Web/API/HTMLElement/autofocus MDN HTMLOrSVGOrMathMLElement.autofocus documentation>
getAutofocus :: (MonadDOM m, IsHTMLOrSVGOrMathMLElement self) => self -> m Bool
getAutofocus self = liftDOM ((((Types.toHTMLOrSVGOrMathMLElement self) ^. js "autofocus") >>= valToBool))
-- | <https://developer.mozilla.org/docs/Web/API/HTMLElement/tabIndex MDN HTMLOrSVGOrMathMLElement.tabIndex documentation>
setTabIndex :: (MonadDOM m, IsHTMLOrSVGOrMathMLElement self) => self -> Int -> m ()
setTabIndex self val = liftDOM (void ((Types.toHTMLOrSVGOrMathMLElement self) ^. jss "tabIndex" (toJSVal val)))
-- | <https://developer.mozilla.org/docs/Web/API/HTMLElement/tabIndex MDN HTMLOrSVGOrMathMLElement.tabIndex documentation>
getTabIndex :: (MonadDOM m, IsHTMLOrSVGOrMathMLElement self) => self -> m Int
getTabIndex self = liftDOM ((P.round <$> (((Types.toHTMLOrSVGOrMathMLElement self) ^. js "tabIndex") >>= valToNumber)))