packages feed

ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/Sanitizer.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.Sanitizer
       (js_newSanitizer, js_allowAttribute, js_allowElement, js_get, js_removeAttribute, js_removeElement, js_removeUnsafe, js_replaceElementWithChildren, js_setComments, js_setDataAttributes, newSanitizer, allowAttribute, allowAttribute_, allowElement, allowElement_, get, get_, removeAttribute, removeAttribute_, removeElement, removeElement_, removeUnsafe, removeUnsafe_, replaceElementWithChildren, replaceElementWithChildren_, setComments, setComments_, setDataAttributes, setDataAttributes_, Sanitizer(..), gTypeSanitizer)
       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 new globalThis[\"Sanitizer\"]($1); })"
        js_newSanitizer :: JSVal -> IO Sanitizer
-- | <https://developer.mozilla.org/docs/Web/API/Sanitizer/Sanitizer MDN Sanitizer. documentation>
newSanitizer :: (MonadDOM m, IsSanitizerConfigOrSanitizerPresets configuration) => Maybe configuration -> m Sanitizer
newSanitizer configuration = liftDOM (((P.maybe (P.return jsUndefined) toJSVal configuration) >>= \a1' -> js_newSanitizer a1'))

foreign import javascript safe "(($1, $2) => { return $1[\"allowAttribute\"]($2); })"
        js_allowAttribute :: Sanitizer -> SanitizerAttribute -> IO Bool
-- | <https://developer.mozilla.org/docs/Web/API/Sanitizer/allowAttribute MDN Sanitizer.allowAttribute documentation>
allowAttribute :: (MonadDOM m, IsSanitizerAttribute attribute) => Sanitizer -> attribute -> m Bool
allowAttribute self attribute = liftDOM ((js_allowAttribute (self) (Types.toSanitizerAttribute attribute)))

-- | <https://developer.mozilla.org/docs/Web/API/Sanitizer/allowAttribute MDN Sanitizer.allowAttribute documentation>
allowAttribute_ :: (MonadDOM m, IsSanitizerAttribute attribute) => Sanitizer -> attribute -> m ()
allowAttribute_ self attribute = liftDOM (void ((js_allowAttribute (self) (Types.toSanitizerAttribute attribute))))

foreign import javascript safe "(($1, $2) => { return $1[\"allowElement\"]($2); })"
        js_allowElement :: Sanitizer -> SanitizerElementWithAttributes -> IO Bool
-- | <https://developer.mozilla.org/docs/Web/API/Sanitizer/allowElement MDN Sanitizer.allowElement documentation>
allowElement :: (MonadDOM m, IsSanitizerElementWithAttributes element) => Sanitizer -> element -> m Bool
allowElement self element = liftDOM ((js_allowElement (self) (Types.toSanitizerElementWithAttributes element)))

-- | <https://developer.mozilla.org/docs/Web/API/Sanitizer/allowElement MDN Sanitizer.allowElement documentation>
allowElement_ :: (MonadDOM m, IsSanitizerElementWithAttributes element) => Sanitizer -> element -> m ()
allowElement_ self element = liftDOM (void ((js_allowElement (self) (Types.toSanitizerElementWithAttributes element))))

foreign import javascript safe "(($1) => { return $1[\"get\"](); })"
        js_get :: Sanitizer -> IO SanitizerConfig
-- | <https://developer.mozilla.org/docs/Web/API/Sanitizer/get MDN Sanitizer.get documentation>
get :: (MonadDOM m) => Sanitizer -> m SanitizerConfig
get self = liftDOM ((js_get (self)))

-- | <https://developer.mozilla.org/docs/Web/API/Sanitizer/get MDN Sanitizer.get documentation>
get_ :: (MonadDOM m) => Sanitizer -> m ()
get_ self = liftDOM (void ((js_get (self))))

foreign import javascript safe "(($1, $2) => { return $1[\"removeAttribute\"]($2); })"
        js_removeAttribute :: Sanitizer -> SanitizerAttribute -> IO Bool
-- | <https://developer.mozilla.org/docs/Web/API/Sanitizer/removeAttribute MDN Sanitizer.removeAttribute documentation>
removeAttribute :: (MonadDOM m, IsSanitizerAttribute attribute) => Sanitizer -> attribute -> m Bool
removeAttribute self attribute = liftDOM ((js_removeAttribute (self) (Types.toSanitizerAttribute attribute)))

-- | <https://developer.mozilla.org/docs/Web/API/Sanitizer/removeAttribute MDN Sanitizer.removeAttribute documentation>
removeAttribute_ :: (MonadDOM m, IsSanitizerAttribute attribute) => Sanitizer -> attribute -> m ()
removeAttribute_ self attribute = liftDOM (void ((js_removeAttribute (self) (Types.toSanitizerAttribute attribute))))

foreign import javascript safe "(($1, $2) => { return $1[\"removeElement\"]($2); })"
        js_removeElement :: Sanitizer -> SanitizerElement -> IO Bool
-- | <https://developer.mozilla.org/docs/Web/API/Sanitizer/removeElement MDN Sanitizer.removeElement documentation>
removeElement :: (MonadDOM m, IsSanitizerElement element) => Sanitizer -> element -> m Bool
removeElement self element = liftDOM ((js_removeElement (self) (Types.toSanitizerElement element)))

-- | <https://developer.mozilla.org/docs/Web/API/Sanitizer/removeElement MDN Sanitizer.removeElement documentation>
removeElement_ :: (MonadDOM m, IsSanitizerElement element) => Sanitizer -> element -> m ()
removeElement_ self element = liftDOM (void ((js_removeElement (self) (Types.toSanitizerElement element))))

foreign import javascript safe "(($1) => { return $1[\"removeUnsafe\"](); })"
        js_removeUnsafe :: Sanitizer -> IO Bool
-- | <https://developer.mozilla.org/docs/Web/API/Sanitizer/removeUnsafe MDN Sanitizer.removeUnsafe documentation>
removeUnsafe :: (MonadDOM m) => Sanitizer -> m Bool
removeUnsafe self = liftDOM ((js_removeUnsafe (self)))

-- | <https://developer.mozilla.org/docs/Web/API/Sanitizer/removeUnsafe MDN Sanitizer.removeUnsafe documentation>
removeUnsafe_ :: (MonadDOM m) => Sanitizer -> m ()
removeUnsafe_ self = liftDOM (void ((js_removeUnsafe (self))))

foreign import javascript safe "(($1, $2) => { return $1[\"replaceElementWithChildren\"]($2); })"
        js_replaceElementWithChildren :: Sanitizer -> SanitizerElement -> IO Bool
-- | <https://developer.mozilla.org/docs/Web/API/Sanitizer/replaceElementWithChildren MDN Sanitizer.replaceElementWithChildren documentation>
replaceElementWithChildren :: (MonadDOM m, IsSanitizerElement element) => Sanitizer -> element -> m Bool
replaceElementWithChildren self element = liftDOM ((js_replaceElementWithChildren (self) (Types.toSanitizerElement element)))

-- | <https://developer.mozilla.org/docs/Web/API/Sanitizer/replaceElementWithChildren MDN Sanitizer.replaceElementWithChildren documentation>
replaceElementWithChildren_ :: (MonadDOM m, IsSanitizerElement element) => Sanitizer -> element -> m ()
replaceElementWithChildren_ self element = liftDOM (void ((js_replaceElementWithChildren (self) (Types.toSanitizerElement element))))

foreign import javascript safe "(($1, $2) => { return $1[\"setComments\"]($2); })"
        js_setComments :: Sanitizer -> Bool -> IO Bool
-- | <https://developer.mozilla.org/docs/Web/API/Sanitizer/setComments MDN Sanitizer.setComments documentation>
setComments :: (MonadDOM m) => Sanitizer -> Bool -> m Bool
setComments self allow = liftDOM ((js_setComments (self) (allow)))

-- | <https://developer.mozilla.org/docs/Web/API/Sanitizer/setComments MDN Sanitizer.setComments documentation>
setComments_ :: (MonadDOM m) => Sanitizer -> Bool -> m ()
setComments_ self allow = liftDOM (void ((js_setComments (self) (allow))))

foreign import javascript safe "(($1, $2) => { return $1[\"setDataAttributes\"]($2); })"
        js_setDataAttributes :: Sanitizer -> Bool -> IO Bool
-- | <https://developer.mozilla.org/docs/Web/API/Sanitizer/setDataAttributes MDN Sanitizer.setDataAttributes documentation>
setDataAttributes :: (MonadDOM m) => Sanitizer -> Bool -> m Bool
setDataAttributes self allow = liftDOM ((js_setDataAttributes (self) (allow)))

-- | <https://developer.mozilla.org/docs/Web/API/Sanitizer/setDataAttributes MDN Sanitizer.setDataAttributes documentation>
setDataAttributes_ :: (MonadDOM m) => Sanitizer -> Bool -> m ()
setDataAttributes_ self allow = liftDOM (void ((js_setDataAttributes (self) (allow))))