packages feed

ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/SanitizerElementNamespaceWithAttributes.hs

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from html (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.SanitizerElementNamespaceWithAttributes
       (js_newSanitizerElementNamespaceWithAttributes, js_setAttributes, js_getAttributes, js_setRemoveAttributes, js_getRemoveAttributes, 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 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 "(($1) => { return ({\"name\": $1}); })"
        js_newSanitizerElementNamespaceWithAttributes :: JSString -> IO SanitizerElementNamespaceWithAttributes
-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#sanitizerelementnamespacewithattributes SanitizerElementNamespaceWithAttributes specification>
newSanitizerElementNamespaceWithAttributes :: (MonadDOM m, ToJSString name) => name -> m SanitizerElementNamespaceWithAttributes
newSanitizerElementNamespaceWithAttributes name = liftDOM ((js_newSanitizerElementNamespaceWithAttributes (toJSString name)))

foreign import javascript safe "(($1, $2) => { $1[\"attributes\"] = $2; })"
        js_setAttributes :: SanitizerElementNamespaceWithAttributes -> JSVal -> IO ()
-- | <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 (((toJSVal val) >>= \a2' -> js_setAttributes (self) a2')))

foreign import javascript unsafe "(($1) => { return $1[\"attributes\"]; })"
        js_getAttributes :: SanitizerElementNamespaceWithAttributes -> IO JSVal
-- | <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 (((js_getAttributes (self)) >>= 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 ((((js_getAttributes (self)) >>= 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 (((js_getAttributes (self)) >>= fromJSValUnchecked))

foreign import javascript safe "(($1, $2) => { $1[\"removeAttributes\"] = $2; })"
        js_setRemoveAttributes :: SanitizerElementNamespaceWithAttributes -> JSVal -> IO ()
-- | <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 (((toJSVal val) >>= \a2' -> js_setRemoveAttributes (self) a2')))

foreign import javascript unsafe "(($1) => { return $1[\"removeAttributes\"]; })"
        js_getRemoveAttributes :: SanitizerElementNamespaceWithAttributes -> IO JSVal
-- | <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 (((js_getRemoveAttributes (self)) >>= 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 ((((js_getRemoveAttributes (self)) >>= 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 (((js_getRemoveAttributes (self)) >>= fromJSValUnchecked))