packages feed

jsaddle-dom-0.10.0.0: src/JSDOM/Generated/SanitizerElementNamespaceWithAttributes.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.SanitizerElementNamespaceWithAttributes
       (newSanitizerElementNamespaceWithAttributes, setAttributes, getAttributes, getAttributesUnsafe, getAttributesUnchecked, setRemoveAttributes, getRemoveAttributes, getRemoveAttributesUnsafe, getRemoveAttributesUnchecked, SanitizerElementNamespaceWithAttributes(..), gTypeSanitizerElementNamespaceWithAttributes)
       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://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#sanitizerelementnamespacewithattributes SanitizerElementNamespaceWithAttributes specification>
newSanitizerElementNamespaceWithAttributes :: (MonadDOM m, ToJSString name) => name -> m SanitizerElementNamespaceWithAttributes
newSanitizerElementNamespaceWithAttributes name = liftDOM ((((new (jsg "Object") () >>= \o -> (o ^. jss "name" (toJSVal name)) P.>> P.return o)) >>= fromJSValUnchecked))

-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerelementnamespacewithattributes-attributes SanitizerElementNamespaceWithAttributes.attributes specification>
setAttributes :: (MonadDOM m, IsSanitizerAttribute val) => SanitizerElementNamespaceWithAttributes -> [val] -> m ()
setAttributes self val = liftDOM (void (self ^. jss "attributes" (toJSVal val)))

-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerelementnamespacewithattributes-attributes SanitizerElementNamespaceWithAttributes.attributes specification>
getAttributes :: (MonadDOM m) => SanitizerElementNamespaceWithAttributes -> m (Maybe [SanitizerAttribute])
getAttributes self = liftDOM (((self ^. js "attributes") >>= fromJSValUnchecked))

-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerelementnamespacewithattributes-attributes SanitizerElementNamespaceWithAttributes.attributes specification>
getAttributesUnsafe :: (MonadDOM m, HasCallStack) => SanitizerElementNamespaceWithAttributes -> m [SanitizerAttribute]
getAttributesUnsafe self = liftDOM ((((self ^. js "attributes") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerelementnamespacewithattributes-attributes SanitizerElementNamespaceWithAttributes.attributes specification>
getAttributesUnchecked :: (MonadDOM m) => SanitizerElementNamespaceWithAttributes -> m [SanitizerAttribute]
getAttributesUnchecked self = liftDOM (((self ^. js "attributes") >>= fromJSValUnchecked))

-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerelementnamespacewithattributes-removeattributes SanitizerElementNamespaceWithAttributes.removeAttributes specification>
setRemoveAttributes :: (MonadDOM m, IsSanitizerAttribute val) => SanitizerElementNamespaceWithAttributes -> [val] -> m ()
setRemoveAttributes self val = liftDOM (void (self ^. jss "removeAttributes" (toJSVal val)))

-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerelementnamespacewithattributes-removeattributes SanitizerElementNamespaceWithAttributes.removeAttributes specification>
getRemoveAttributes :: (MonadDOM m) => SanitizerElementNamespaceWithAttributes -> m (Maybe [SanitizerAttribute])
getRemoveAttributes self = liftDOM (((self ^. js "removeAttributes") >>= fromJSValUnchecked))

-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerelementnamespacewithattributes-removeattributes SanitizerElementNamespaceWithAttributes.removeAttributes specification>
getRemoveAttributesUnsafe :: (MonadDOM m, HasCallStack) => SanitizerElementNamespaceWithAttributes -> m [SanitizerAttribute]
getRemoveAttributesUnsafe self = liftDOM ((((self ^. js "removeAttributes") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerelementnamespacewithattributes-removeattributes SanitizerElementNamespaceWithAttributes.removeAttributes specification>
getRemoveAttributesUnchecked :: (MonadDOM m) => SanitizerElementNamespaceWithAttributes -> m [SanitizerAttribute]
getRemoveAttributesUnchecked self = liftDOM (((self ^. js "removeAttributes") >>= fromJSValUnchecked))