{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module JSDOM.Generated.Attr
(getNamespaceURI, getNamespaceURIUnsafe, getNamespaceURIUnchecked,
getPrefix, getPrefixUnsafe, getPrefixUnchecked, getLocalName,
getName, setValue, getValue, getOwnerElement,
getOwnerElementUnsafe, getOwnerElementUnchecked, getSpecified,
Attr(..), gTypeAttr)
where
import Prelude ((.), (==), (>>=), return, IO, Int, Float, Double, Bool(..), Maybe, maybe, fromIntegral, round, realToFrac, fmap, Show, Read, Eq, Ord, Maybe(..))
import qualified Prelude (error)
import Data.Typeable (Typeable)
import Data.Traversable (mapM)
import Language.Javascript.JSaddle (JSM(..), JSVal(..), JSString, strictEqual, toJSVal, valToStr, valToNumber, valToBool, js, jss, jsf, jsg, function, asyncFunction, new, array, jsUndefined, (!), (!!))
import Data.Int (Int64)
import Data.Word (Word, Word64)
import JSDOM.Types
import Control.Applicative ((<$>))
import Control.Monad (void)
import Control.Lens.Operators ((^.))
import JSDOM.EventTargetClosures (EventName, unsafeEventName, unsafeEventNameAsync)
import JSDOM.Enums
getNamespaceURI ::
(MonadDOM m, FromJSString result) => Attr -> m (Maybe result)
getNamespaceURI self
= liftDOM ((self ^. js "namespaceURI") >>= fromMaybeJSString)
getNamespaceURIUnsafe ::
(MonadDOM m, HasCallStack, FromJSString result) => Attr -> m result
getNamespaceURIUnsafe self
= liftDOM
(((self ^. js "namespaceURI") >>= fromMaybeJSString) >>=
maybe (Prelude.error "Nothing to return") return)
getNamespaceURIUnchecked ::
(MonadDOM m, FromJSString result) => Attr -> m result
getNamespaceURIUnchecked self
= liftDOM ((self ^. js "namespaceURI") >>= fromJSValUnchecked)
getPrefix ::
(MonadDOM m, FromJSString result) => Attr -> m (Maybe result)
getPrefix self
= liftDOM ((self ^. js "prefix") >>= fromMaybeJSString)
getPrefixUnsafe ::
(MonadDOM m, HasCallStack, FromJSString result) => Attr -> m result
getPrefixUnsafe self
= liftDOM
(((self ^. js "prefix") >>= fromMaybeJSString) >>=
maybe (Prelude.error "Nothing to return") return)
getPrefixUnchecked ::
(MonadDOM m, FromJSString result) => Attr -> m result
getPrefixUnchecked self
= liftDOM ((self ^. js "prefix") >>= fromJSValUnchecked)
getLocalName ::
(MonadDOM m, FromJSString result) => Attr -> m result
getLocalName self
= liftDOM ((self ^. js "localName") >>= fromJSValUnchecked)
getName :: (MonadDOM m, FromJSString result) => Attr -> m result
getName self = liftDOM ((self ^. js "name") >>= fromJSValUnchecked)
setValue :: (MonadDOM m, ToJSString val) => Attr -> val -> m ()
setValue self val = liftDOM (self ^. jss "value" (toJSVal val))
getValue :: (MonadDOM m, FromJSString result) => Attr -> m result
getValue self
= liftDOM ((self ^. js "value") >>= fromJSValUnchecked)
getOwnerElement :: (MonadDOM m) => Attr -> m (Maybe Element)
getOwnerElement self
= liftDOM ((self ^. js "ownerElement") >>= fromJSVal)
getOwnerElementUnsafe ::
(MonadDOM m, HasCallStack) => Attr -> m Element
getOwnerElementUnsafe self
= liftDOM
(((self ^. js "ownerElement") >>= fromJSVal) >>=
maybe (Prelude.error "Nothing to return") return)
getOwnerElementUnchecked :: (MonadDOM m) => Attr -> m Element
getOwnerElementUnchecked self
= liftDOM ((self ^. js "ownerElement") >>= fromJSValUnchecked)
getSpecified :: (MonadDOM m) => Attr -> m Bool
getSpecified self
= liftDOM ((self ^. js "specified") >>= valToBool)