{-# LANGUAGE PatternSynonyms #-}
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module JSDOM.Generated.NamedNodeMap
       (item, item_, itemUnsafe, itemUnchecked, getNamedItem,
        getNamedItem_, getNamedItemUnsafe, getNamedItemUnchecked,
        getNamedItemNS, getNamedItemNS_, getNamedItemNSUnsafe,
        getNamedItemNSUnchecked, setNamedItem, setNamedItem_,
        setNamedItemUnsafe, setNamedItemUnchecked, setNamedItemNS,
        setNamedItemNS_, setNamedItemNSUnsafe, setNamedItemNSUnchecked,
        removeNamedItem, removeNamedItem_, removeNamedItemNS,
        removeNamedItemNS_, getLength, NamedNodeMap(..), gTypeNamedNodeMap)
       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

-- | <https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap.item Mozilla NamedNodeMap.item documentation> 
item :: (MonadDOM m) => NamedNodeMap -> Word -> m (Maybe Attr)
item :: forall (m :: * -> *).
MonadDOM m =>
NamedNodeMap -> Word -> m (Maybe Attr)
item NamedNodeMap
self Word
index
  = DOM (Maybe Attr) -> m (Maybe Attr)
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM ((NamedNodeMap
self NamedNodeMap
-> Getting (JSM JSVal) NamedNodeMap (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> [JSM JSVal] -> JSF
forall name args.
(ToJSString name, MakeArgs args) =>
name -> args -> JSF
jsf String
"item" [Word -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Word
index]) JSM JSVal -> (JSVal -> DOM (Maybe Attr)) -> DOM (Maybe Attr)
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> DOM (Maybe Attr)
forall a. FromJSVal a => JSVal -> JSM (Maybe a)
fromJSVal)

-- | <https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap.item Mozilla NamedNodeMap.item documentation> 
item_ :: (MonadDOM m) => NamedNodeMap -> Word -> m ()
item_ :: forall (m :: * -> *). MonadDOM m => NamedNodeMap -> Word -> m ()
item_ NamedNodeMap
self Word
index
  = DOM () -> m ()
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM (JSM JSVal -> DOM ()
forall (f :: * -> *) a. Functor f => f a -> f ()
void (NamedNodeMap
self NamedNodeMap
-> Getting (JSM JSVal) NamedNodeMap (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> [JSM JSVal] -> JSF
forall name args.
(ToJSString name, MakeArgs args) =>
name -> args -> JSF
jsf String
"item" [Word -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Word
index]))

-- | <https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap.item Mozilla NamedNodeMap.item documentation> 
itemUnsafe ::
           (MonadDOM m, HasCallStack) => NamedNodeMap -> Word -> m Attr
itemUnsafe :: forall (m :: * -> *).
(MonadDOM m, HasCallStack) =>
NamedNodeMap -> Word -> m Attr
itemUnsafe NamedNodeMap
self Word
index
  = DOM Attr -> m Attr
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM
      (((NamedNodeMap
self NamedNodeMap
-> Getting (JSM JSVal) NamedNodeMap (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> [JSM JSVal] -> JSF
forall name args.
(ToJSString name, MakeArgs args) =>
name -> args -> JSF
jsf String
"item" [Word -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Word
index]) JSM JSVal -> (JSVal -> DOM (Maybe Attr)) -> DOM (Maybe Attr)
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> DOM (Maybe Attr)
forall a. FromJSVal a => JSVal -> JSM (Maybe a)
fromJSVal) DOM (Maybe Attr) -> (Maybe Attr -> DOM Attr) -> DOM Attr
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>=
         DOM Attr -> (Attr -> DOM Attr) -> Maybe Attr -> DOM Attr
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (String -> DOM Attr
forall a. HasCallStack => String -> a
Prelude.error String
"Nothing to return") Attr -> DOM Attr
forall a. a -> JSM a
forall (m :: * -> *) a. Monad m => a -> m a
return)

-- | <https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap.item Mozilla NamedNodeMap.item documentation> 
itemUnchecked :: (MonadDOM m) => NamedNodeMap -> Word -> m Attr
itemUnchecked :: forall (m :: * -> *). MonadDOM m => NamedNodeMap -> Word -> m Attr
itemUnchecked NamedNodeMap
self Word
index
  = DOM Attr -> m Attr
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM
      ((NamedNodeMap
self NamedNodeMap
-> Getting (JSM JSVal) NamedNodeMap (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> [JSM JSVal] -> JSF
forall name args.
(ToJSString name, MakeArgs args) =>
name -> args -> JSF
jsf String
"item" [Word -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Word
index]) JSM JSVal -> (JSVal -> DOM Attr) -> DOM Attr
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> DOM Attr
forall a. FromJSVal a => JSVal -> JSM a
fromJSValUnchecked)

-- | <https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap.getNamedItem Mozilla NamedNodeMap.getNamedItem documentation> 
getNamedItem ::
             (MonadDOM m, ToJSString qualifiedName) =>
               NamedNodeMap -> qualifiedName -> m (Maybe Attr)
getNamedItem :: forall (m :: * -> *) qualifiedName.
(MonadDOM m, ToJSString qualifiedName) =>
NamedNodeMap -> qualifiedName -> m (Maybe Attr)
getNamedItem NamedNodeMap
self qualifiedName
qualifiedName
  = DOM (Maybe Attr) -> m (Maybe Attr)
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM ((NamedNodeMap
self NamedNodeMap -> qualifiedName -> JSM JSVal
forall this name.
(MakeObject this, ToJSString name) =>
this -> name -> JSM JSVal
! qualifiedName
qualifiedName) JSM JSVal -> (JSVal -> DOM (Maybe Attr)) -> DOM (Maybe Attr)
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> DOM (Maybe Attr)
forall a. FromJSVal a => JSVal -> JSM (Maybe a)
fromJSVal)

-- | <https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap.getNamedItem Mozilla NamedNodeMap.getNamedItem documentation> 
getNamedItem_ ::
              (MonadDOM m, ToJSString qualifiedName) =>
                NamedNodeMap -> qualifiedName -> m ()
getNamedItem_ :: forall (m :: * -> *) qualifiedName.
(MonadDOM m, ToJSString qualifiedName) =>
NamedNodeMap -> qualifiedName -> m ()
getNamedItem_ NamedNodeMap
self qualifiedName
qualifiedName
  = DOM () -> m ()
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM (JSM JSVal -> DOM ()
forall (f :: * -> *) a. Functor f => f a -> f ()
void (NamedNodeMap
self NamedNodeMap -> qualifiedName -> JSM JSVal
forall this name.
(MakeObject this, ToJSString name) =>
this -> name -> JSM JSVal
! qualifiedName
qualifiedName))

-- | <https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap.getNamedItem Mozilla NamedNodeMap.getNamedItem documentation> 
getNamedItemUnsafe ::
                   (MonadDOM m, ToJSString qualifiedName, HasCallStack) =>
                     NamedNodeMap -> qualifiedName -> m Attr
getNamedItemUnsafe :: forall (m :: * -> *) qualifiedName.
(MonadDOM m, ToJSString qualifiedName, HasCallStack) =>
NamedNodeMap -> qualifiedName -> m Attr
getNamedItemUnsafe NamedNodeMap
self qualifiedName
qualifiedName
  = DOM Attr -> m Attr
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM
      (((NamedNodeMap
self NamedNodeMap -> qualifiedName -> JSM JSVal
forall this name.
(MakeObject this, ToJSString name) =>
this -> name -> JSM JSVal
! qualifiedName
qualifiedName) JSM JSVal -> (JSVal -> DOM (Maybe Attr)) -> DOM (Maybe Attr)
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> DOM (Maybe Attr)
forall a. FromJSVal a => JSVal -> JSM (Maybe a)
fromJSVal) DOM (Maybe Attr) -> (Maybe Attr -> DOM Attr) -> DOM Attr
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>=
         DOM Attr -> (Attr -> DOM Attr) -> Maybe Attr -> DOM Attr
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (String -> DOM Attr
forall a. HasCallStack => String -> a
Prelude.error String
"Nothing to return") Attr -> DOM Attr
forall a. a -> JSM a
forall (m :: * -> *) a. Monad m => a -> m a
return)

-- | <https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap.getNamedItem Mozilla NamedNodeMap.getNamedItem documentation> 
getNamedItemUnchecked ::
                      (MonadDOM m, ToJSString qualifiedName) =>
                        NamedNodeMap -> qualifiedName -> m Attr
getNamedItemUnchecked :: forall (m :: * -> *) qualifiedName.
(MonadDOM m, ToJSString qualifiedName) =>
NamedNodeMap -> qualifiedName -> m Attr
getNamedItemUnchecked NamedNodeMap
self qualifiedName
qualifiedName
  = DOM Attr -> m Attr
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM ((NamedNodeMap
self NamedNodeMap -> qualifiedName -> JSM JSVal
forall this name.
(MakeObject this, ToJSString name) =>
this -> name -> JSM JSVal
! qualifiedName
qualifiedName) JSM JSVal -> (JSVal -> DOM Attr) -> DOM Attr
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> DOM Attr
forall a. FromJSVal a => JSVal -> JSM a
fromJSValUnchecked)

-- | <https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap.getNamedItemNS Mozilla NamedNodeMap.getNamedItemNS documentation> 
getNamedItemNS ::
               (MonadDOM m, ToJSString namespaceURI, ToJSString localName) =>
                 NamedNodeMap -> Maybe namespaceURI -> localName -> m (Maybe Attr)
getNamedItemNS :: forall (m :: * -> *) namespaceURI localName.
(MonadDOM m, ToJSString namespaceURI, ToJSString localName) =>
NamedNodeMap -> Maybe namespaceURI -> localName -> m (Maybe Attr)
getNamedItemNS NamedNodeMap
self Maybe namespaceURI
namespaceURI localName
localName
  = DOM (Maybe Attr) -> m (Maybe Attr)
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM
      ((NamedNodeMap
self NamedNodeMap
-> Getting (JSM JSVal) NamedNodeMap (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> [JSM JSVal] -> JSF
forall name args.
(ToJSString name, MakeArgs args) =>
name -> args -> JSF
jsf String
"getNamedItemNS"
          [Maybe namespaceURI -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Maybe namespaceURI
namespaceURI, localName -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal localName
localName])
         JSM JSVal -> (JSVal -> DOM (Maybe Attr)) -> DOM (Maybe Attr)
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> DOM (Maybe Attr)
forall a. FromJSVal a => JSVal -> JSM (Maybe a)
fromJSVal)

-- | <https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap.getNamedItemNS Mozilla NamedNodeMap.getNamedItemNS documentation> 
getNamedItemNS_ ::
                (MonadDOM m, ToJSString namespaceURI, ToJSString localName) =>
                  NamedNodeMap -> Maybe namespaceURI -> localName -> m ()
getNamedItemNS_ :: forall (m :: * -> *) namespaceURI localName.
(MonadDOM m, ToJSString namespaceURI, ToJSString localName) =>
NamedNodeMap -> Maybe namespaceURI -> localName -> m ()
getNamedItemNS_ NamedNodeMap
self Maybe namespaceURI
namespaceURI localName
localName
  = DOM () -> m ()
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM
      (JSM JSVal -> DOM ()
forall (f :: * -> *) a. Functor f => f a -> f ()
void
         (NamedNodeMap
self NamedNodeMap
-> Getting (JSM JSVal) NamedNodeMap (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> [JSM JSVal] -> JSF
forall name args.
(ToJSString name, MakeArgs args) =>
name -> args -> JSF
jsf String
"getNamedItemNS"
            [Maybe namespaceURI -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Maybe namespaceURI
namespaceURI, localName -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal localName
localName]))

-- | <https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap.getNamedItemNS Mozilla NamedNodeMap.getNamedItemNS documentation> 
getNamedItemNSUnsafe ::
                     (MonadDOM m, ToJSString namespaceURI, ToJSString localName,
                      HasCallStack) =>
                       NamedNodeMap -> Maybe namespaceURI -> localName -> m Attr
getNamedItemNSUnsafe :: forall (m :: * -> *) namespaceURI localName.
(MonadDOM m, ToJSString namespaceURI, ToJSString localName,
 HasCallStack) =>
NamedNodeMap -> Maybe namespaceURI -> localName -> m Attr
getNamedItemNSUnsafe NamedNodeMap
self Maybe namespaceURI
namespaceURI localName
localName
  = DOM Attr -> m Attr
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM
      (((NamedNodeMap
self NamedNodeMap
-> Getting (JSM JSVal) NamedNodeMap (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> [JSM JSVal] -> JSF
forall name args.
(ToJSString name, MakeArgs args) =>
name -> args -> JSF
jsf String
"getNamedItemNS"
           [Maybe namespaceURI -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Maybe namespaceURI
namespaceURI, localName -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal localName
localName])
          JSM JSVal -> (JSVal -> DOM (Maybe Attr)) -> DOM (Maybe Attr)
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> DOM (Maybe Attr)
forall a. FromJSVal a => JSVal -> JSM (Maybe a)
fromJSVal)
         DOM (Maybe Attr) -> (Maybe Attr -> DOM Attr) -> DOM Attr
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= DOM Attr -> (Attr -> DOM Attr) -> Maybe Attr -> DOM Attr
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (String -> DOM Attr
forall a. HasCallStack => String -> a
Prelude.error String
"Nothing to return") Attr -> DOM Attr
forall a. a -> JSM a
forall (m :: * -> *) a. Monad m => a -> m a
return)

-- | <https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap.getNamedItemNS Mozilla NamedNodeMap.getNamedItemNS documentation> 
getNamedItemNSUnchecked ::
                        (MonadDOM m, ToJSString namespaceURI, ToJSString localName) =>
                          NamedNodeMap -> Maybe namespaceURI -> localName -> m Attr
getNamedItemNSUnchecked :: forall (m :: * -> *) namespaceURI localName.
(MonadDOM m, ToJSString namespaceURI, ToJSString localName) =>
NamedNodeMap -> Maybe namespaceURI -> localName -> m Attr
getNamedItemNSUnchecked NamedNodeMap
self Maybe namespaceURI
namespaceURI localName
localName
  = DOM Attr -> m Attr
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM
      ((NamedNodeMap
self NamedNodeMap
-> Getting (JSM JSVal) NamedNodeMap (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> [JSM JSVal] -> JSF
forall name args.
(ToJSString name, MakeArgs args) =>
name -> args -> JSF
jsf String
"getNamedItemNS"
          [Maybe namespaceURI -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Maybe namespaceURI
namespaceURI, localName -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal localName
localName])
         JSM JSVal -> (JSVal -> DOM Attr) -> DOM Attr
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> DOM Attr
forall a. FromJSVal a => JSVal -> JSM a
fromJSValUnchecked)

-- | <https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap.setNamedItem Mozilla NamedNodeMap.setNamedItem documentation> 
setNamedItem ::
             (MonadDOM m) => NamedNodeMap -> Attr -> m (Maybe Attr)
setNamedItem :: forall (m :: * -> *).
MonadDOM m =>
NamedNodeMap -> Attr -> m (Maybe Attr)
setNamedItem NamedNodeMap
self Attr
attr
  = DOM (Maybe Attr) -> m (Maybe Attr)
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM
      ((NamedNodeMap
self NamedNodeMap
-> Getting (JSM JSVal) NamedNodeMap (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> [JSM JSVal] -> JSF
forall name args.
(ToJSString name, MakeArgs args) =>
name -> args -> JSF
jsf String
"setNamedItem" [Attr -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Attr
attr]) JSM JSVal -> (JSVal -> DOM (Maybe Attr)) -> DOM (Maybe Attr)
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> DOM (Maybe Attr)
forall a. FromJSVal a => JSVal -> JSM (Maybe a)
fromJSVal)

-- | <https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap.setNamedItem Mozilla NamedNodeMap.setNamedItem documentation> 
setNamedItem_ :: (MonadDOM m) => NamedNodeMap -> Attr -> m ()
setNamedItem_ :: forall (m :: * -> *). MonadDOM m => NamedNodeMap -> Attr -> m ()
setNamedItem_ NamedNodeMap
self Attr
attr
  = DOM () -> m ()
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM (JSM JSVal -> DOM ()
forall (f :: * -> *) a. Functor f => f a -> f ()
void (NamedNodeMap
self NamedNodeMap
-> Getting (JSM JSVal) NamedNodeMap (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> [JSM JSVal] -> JSF
forall name args.
(ToJSString name, MakeArgs args) =>
name -> args -> JSF
jsf String
"setNamedItem" [Attr -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Attr
attr]))

-- | <https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap.setNamedItem Mozilla NamedNodeMap.setNamedItem documentation> 
setNamedItemUnsafe ::
                   (MonadDOM m, HasCallStack) => NamedNodeMap -> Attr -> m Attr
setNamedItemUnsafe :: forall (m :: * -> *).
(MonadDOM m, HasCallStack) =>
NamedNodeMap -> Attr -> m Attr
setNamedItemUnsafe NamedNodeMap
self Attr
attr
  = DOM Attr -> m Attr
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM
      (((NamedNodeMap
self NamedNodeMap
-> Getting (JSM JSVal) NamedNodeMap (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> [JSM JSVal] -> JSF
forall name args.
(ToJSString name, MakeArgs args) =>
name -> args -> JSF
jsf String
"setNamedItem" [Attr -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Attr
attr]) JSM JSVal -> (JSVal -> DOM (Maybe Attr)) -> DOM (Maybe Attr)
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> DOM (Maybe Attr)
forall a. FromJSVal a => JSVal -> JSM (Maybe a)
fromJSVal) DOM (Maybe Attr) -> (Maybe Attr -> DOM Attr) -> DOM Attr
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>=
         DOM Attr -> (Attr -> DOM Attr) -> Maybe Attr -> DOM Attr
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (String -> DOM Attr
forall a. HasCallStack => String -> a
Prelude.error String
"Nothing to return") Attr -> DOM Attr
forall a. a -> JSM a
forall (m :: * -> *) a. Monad m => a -> m a
return)

-- | <https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap.setNamedItem Mozilla NamedNodeMap.setNamedItem documentation> 
setNamedItemUnchecked ::
                      (MonadDOM m) => NamedNodeMap -> Attr -> m Attr
setNamedItemUnchecked :: forall (m :: * -> *). MonadDOM m => NamedNodeMap -> Attr -> m Attr
setNamedItemUnchecked NamedNodeMap
self Attr
attr
  = DOM Attr -> m Attr
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM
      ((NamedNodeMap
self NamedNodeMap
-> Getting (JSM JSVal) NamedNodeMap (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> [JSM JSVal] -> JSF
forall name args.
(ToJSString name, MakeArgs args) =>
name -> args -> JSF
jsf String
"setNamedItem" [Attr -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Attr
attr]) JSM JSVal -> (JSVal -> DOM Attr) -> DOM Attr
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>=
         JSVal -> DOM Attr
forall a. FromJSVal a => JSVal -> JSM a
fromJSValUnchecked)

-- | <https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap.setNamedItemNS Mozilla NamedNodeMap.setNamedItemNS documentation> 
setNamedItemNS ::
               (MonadDOM m) => NamedNodeMap -> Attr -> m (Maybe Attr)
setNamedItemNS :: forall (m :: * -> *).
MonadDOM m =>
NamedNodeMap -> Attr -> m (Maybe Attr)
setNamedItemNS NamedNodeMap
self Attr
attr
  = DOM (Maybe Attr) -> m (Maybe Attr)
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM
      ((NamedNodeMap
self NamedNodeMap
-> Getting (JSM JSVal) NamedNodeMap (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> [JSM JSVal] -> JSF
forall name args.
(ToJSString name, MakeArgs args) =>
name -> args -> JSF
jsf String
"setNamedItemNS" [Attr -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Attr
attr]) JSM JSVal -> (JSVal -> DOM (Maybe Attr)) -> DOM (Maybe Attr)
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> DOM (Maybe Attr)
forall a. FromJSVal a => JSVal -> JSM (Maybe a)
fromJSVal)

-- | <https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap.setNamedItemNS Mozilla NamedNodeMap.setNamedItemNS documentation> 
setNamedItemNS_ :: (MonadDOM m) => NamedNodeMap -> Attr -> m ()
setNamedItemNS_ :: forall (m :: * -> *). MonadDOM m => NamedNodeMap -> Attr -> m ()
setNamedItemNS_ NamedNodeMap
self Attr
attr
  = DOM () -> m ()
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM (JSM JSVal -> DOM ()
forall (f :: * -> *) a. Functor f => f a -> f ()
void (NamedNodeMap
self NamedNodeMap
-> Getting (JSM JSVal) NamedNodeMap (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> [JSM JSVal] -> JSF
forall name args.
(ToJSString name, MakeArgs args) =>
name -> args -> JSF
jsf String
"setNamedItemNS" [Attr -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Attr
attr]))

-- | <https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap.setNamedItemNS Mozilla NamedNodeMap.setNamedItemNS documentation> 
setNamedItemNSUnsafe ::
                     (MonadDOM m, HasCallStack) => NamedNodeMap -> Attr -> m Attr
setNamedItemNSUnsafe :: forall (m :: * -> *).
(MonadDOM m, HasCallStack) =>
NamedNodeMap -> Attr -> m Attr
setNamedItemNSUnsafe NamedNodeMap
self Attr
attr
  = DOM Attr -> m Attr
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM
      (((NamedNodeMap
self NamedNodeMap
-> Getting (JSM JSVal) NamedNodeMap (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> [JSM JSVal] -> JSF
forall name args.
(ToJSString name, MakeArgs args) =>
name -> args -> JSF
jsf String
"setNamedItemNS" [Attr -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Attr
attr]) JSM JSVal -> (JSVal -> DOM (Maybe Attr)) -> DOM (Maybe Attr)
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> DOM (Maybe Attr)
forall a. FromJSVal a => JSVal -> JSM (Maybe a)
fromJSVal) DOM (Maybe Attr) -> (Maybe Attr -> DOM Attr) -> DOM Attr
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>=
         DOM Attr -> (Attr -> DOM Attr) -> Maybe Attr -> DOM Attr
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (String -> DOM Attr
forall a. HasCallStack => String -> a
Prelude.error String
"Nothing to return") Attr -> DOM Attr
forall a. a -> JSM a
forall (m :: * -> *) a. Monad m => a -> m a
return)

-- | <https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap.setNamedItemNS Mozilla NamedNodeMap.setNamedItemNS documentation> 
setNamedItemNSUnchecked ::
                        (MonadDOM m) => NamedNodeMap -> Attr -> m Attr
setNamedItemNSUnchecked :: forall (m :: * -> *). MonadDOM m => NamedNodeMap -> Attr -> m Attr
setNamedItemNSUnchecked NamedNodeMap
self Attr
attr
  = DOM Attr -> m Attr
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM
      ((NamedNodeMap
self NamedNodeMap
-> Getting (JSM JSVal) NamedNodeMap (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> [JSM JSVal] -> JSF
forall name args.
(ToJSString name, MakeArgs args) =>
name -> args -> JSF
jsf String
"setNamedItemNS" [Attr -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Attr
attr]) JSM JSVal -> (JSVal -> DOM Attr) -> DOM Attr
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>=
         JSVal -> DOM Attr
forall a. FromJSVal a => JSVal -> JSM a
fromJSValUnchecked)

-- | <https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap.removeNamedItem Mozilla NamedNodeMap.removeNamedItem documentation> 
removeNamedItem ::
                (MonadDOM m, ToJSString qualifiedName) =>
                  NamedNodeMap -> qualifiedName -> m Attr
removeNamedItem :: forall (m :: * -> *) qualifiedName.
(MonadDOM m, ToJSString qualifiedName) =>
NamedNodeMap -> qualifiedName -> m Attr
removeNamedItem NamedNodeMap
self qualifiedName
qualifiedName
  = DOM Attr -> m Attr
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM
      ((NamedNodeMap
self NamedNodeMap
-> Getting (JSM JSVal) NamedNodeMap (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> [JSM JSVal] -> JSF
forall name args.
(ToJSString name, MakeArgs args) =>
name -> args -> JSF
jsf String
"removeNamedItem" [qualifiedName -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal qualifiedName
qualifiedName]) JSM JSVal -> (JSVal -> DOM Attr) -> DOM Attr
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>=
         JSVal -> DOM Attr
forall a. FromJSVal a => JSVal -> JSM a
fromJSValUnchecked)

-- | <https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap.removeNamedItem Mozilla NamedNodeMap.removeNamedItem documentation> 
removeNamedItem_ ::
                 (MonadDOM m, ToJSString qualifiedName) =>
                   NamedNodeMap -> qualifiedName -> m ()
removeNamedItem_ :: forall (m :: * -> *) qualifiedName.
(MonadDOM m, ToJSString qualifiedName) =>
NamedNodeMap -> qualifiedName -> m ()
removeNamedItem_ NamedNodeMap
self qualifiedName
qualifiedName
  = DOM () -> m ()
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM
      (JSM JSVal -> DOM ()
forall (f :: * -> *) a. Functor f => f a -> f ()
void (NamedNodeMap
self NamedNodeMap
-> Getting (JSM JSVal) NamedNodeMap (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> [JSM JSVal] -> JSF
forall name args.
(ToJSString name, MakeArgs args) =>
name -> args -> JSF
jsf String
"removeNamedItem" [qualifiedName -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal qualifiedName
qualifiedName]))

-- | <https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap.removeNamedItemNS Mozilla NamedNodeMap.removeNamedItemNS documentation> 
removeNamedItemNS ::
                  (MonadDOM m, ToJSString namespaceURI, ToJSString localName) =>
                    NamedNodeMap -> Maybe namespaceURI -> localName -> m Attr
removeNamedItemNS :: forall (m :: * -> *) namespaceURI localName.
(MonadDOM m, ToJSString namespaceURI, ToJSString localName) =>
NamedNodeMap -> Maybe namespaceURI -> localName -> m Attr
removeNamedItemNS NamedNodeMap
self Maybe namespaceURI
namespaceURI localName
localName
  = DOM Attr -> m Attr
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM
      ((NamedNodeMap
self NamedNodeMap
-> Getting (JSM JSVal) NamedNodeMap (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> [JSM JSVal] -> JSF
forall name args.
(ToJSString name, MakeArgs args) =>
name -> args -> JSF
jsf String
"removeNamedItemNS"
          [Maybe namespaceURI -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Maybe namespaceURI
namespaceURI, localName -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal localName
localName])
         JSM JSVal -> (JSVal -> DOM Attr) -> DOM Attr
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> DOM Attr
forall a. FromJSVal a => JSVal -> JSM a
fromJSValUnchecked)

-- | <https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap.removeNamedItemNS Mozilla NamedNodeMap.removeNamedItemNS documentation> 
removeNamedItemNS_ ::
                   (MonadDOM m, ToJSString namespaceURI, ToJSString localName) =>
                     NamedNodeMap -> Maybe namespaceURI -> localName -> m ()
removeNamedItemNS_ :: forall (m :: * -> *) namespaceURI localName.
(MonadDOM m, ToJSString namespaceURI, ToJSString localName) =>
NamedNodeMap -> Maybe namespaceURI -> localName -> m ()
removeNamedItemNS_ NamedNodeMap
self Maybe namespaceURI
namespaceURI localName
localName
  = DOM () -> m ()
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM
      (JSM JSVal -> DOM ()
forall (f :: * -> *) a. Functor f => f a -> f ()
void
         (NamedNodeMap
self NamedNodeMap
-> Getting (JSM JSVal) NamedNodeMap (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> [JSM JSVal] -> JSF
forall name args.
(ToJSString name, MakeArgs args) =>
name -> args -> JSF
jsf String
"removeNamedItemNS"
            [Maybe namespaceURI -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Maybe namespaceURI
namespaceURI, localName -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal localName
localName]))

-- | <https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap.length Mozilla NamedNodeMap.length documentation> 
getLength :: (MonadDOM m) => NamedNodeMap -> m Word
getLength :: forall (m :: * -> *). MonadDOM m => NamedNodeMap -> m Word
getLength NamedNodeMap
self
  = DOM Word -> m Word
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM (Double -> Word
forall b. Integral b => Double -> b
forall a b. (RealFrac a, Integral b) => a -> b
round (Double -> Word) -> JSM Double -> DOM Word
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ((NamedNodeMap
self NamedNodeMap
-> Getting (JSM JSVal) NamedNodeMap (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> IndexPreservingGetter NamedNodeMap (JSM JSVal)
forall s name.
(MakeObject s, ToJSString name) =>
name -> IndexPreservingGetter s (JSM JSVal)
js String
"length") JSM JSVal -> (JSVal -> JSM Double) -> JSM Double
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> JSM Double
forall value. ToJSVal value => value -> JSM Double
valToNumber))