jsaddle-dom-0.10.0.0: src/JSDOM/Generated/Sanitizer.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.Sanitizer
(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 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://developer.mozilla.org/docs/Web/API/Sanitizer/Sanitizer MDN Sanitizer. documentation>
newSanitizer :: (MonadDOM m, IsSanitizerConfigOrSanitizerPresets configuration) => Maybe configuration -> m Sanitizer
newSanitizer configuration = liftDOM (((new (jsg "Sanitizer") [P.maybe (P.return jsUndefined) toJSVal configuration]) >>= fromJSValUnchecked))
-- | <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 (((self ^. jsf "allowAttribute" [toJSVal attribute]) >>= valToBool))
-- | <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 (self ^. jsf "allowAttribute" [toJSVal attribute]))
-- | <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 (((self ^. jsf "allowElement" [toJSVal element]) >>= valToBool))
-- | <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 (self ^. jsf "allowElement" [toJSVal element]))
-- | <https://developer.mozilla.org/docs/Web/API/Sanitizer/get MDN Sanitizer.get documentation>
get :: (MonadDOM m) => Sanitizer -> m SanitizerConfig
get self = liftDOM (((self ^. jsf "get" ()) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/Sanitizer/get MDN Sanitizer.get documentation>
get_ :: (MonadDOM m) => Sanitizer -> m ()
get_ self = liftDOM (void (self ^. jsf "get" ()))
-- | <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 (((self ^. jsf "removeAttribute" [toJSVal attribute]) >>= valToBool))
-- | <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 (self ^. jsf "removeAttribute" [toJSVal attribute]))
-- | <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 (((self ^. jsf "removeElement" [toJSVal element]) >>= valToBool))
-- | <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 (self ^. jsf "removeElement" [toJSVal element]))
-- | <https://developer.mozilla.org/docs/Web/API/Sanitizer/removeUnsafe MDN Sanitizer.removeUnsafe documentation>
removeUnsafe :: (MonadDOM m) => Sanitizer -> m Bool
removeUnsafe self = liftDOM (((self ^. jsf "removeUnsafe" ()) >>= valToBool))
-- | <https://developer.mozilla.org/docs/Web/API/Sanitizer/removeUnsafe MDN Sanitizer.removeUnsafe documentation>
removeUnsafe_ :: (MonadDOM m) => Sanitizer -> m ()
removeUnsafe_ self = liftDOM (void (self ^. jsf "removeUnsafe" ()))
-- | <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 (((self ^. jsf "replaceElementWithChildren" [toJSVal element]) >>= valToBool))
-- | <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 (self ^. jsf "replaceElementWithChildren" [toJSVal element]))
-- | <https://developer.mozilla.org/docs/Web/API/Sanitizer/setComments MDN Sanitizer.setComments documentation>
setComments :: (MonadDOM m) => Sanitizer -> Bool -> m Bool
setComments self allow = liftDOM (((self ^. jsf "setComments" [toJSVal allow]) >>= valToBool))
-- | <https://developer.mozilla.org/docs/Web/API/Sanitizer/setComments MDN Sanitizer.setComments documentation>
setComments_ :: (MonadDOM m) => Sanitizer -> Bool -> m ()
setComments_ self allow = liftDOM (void (self ^. jsf "setComments" [toJSVal allow]))
-- | <https://developer.mozilla.org/docs/Web/API/Sanitizer/setDataAttributes MDN Sanitizer.setDataAttributes documentation>
setDataAttributes :: (MonadDOM m) => Sanitizer -> Bool -> m Bool
setDataAttributes self allow = liftDOM (((self ^. jsf "setDataAttributes" [toJSVal allow]) >>= valToBool))
-- | <https://developer.mozilla.org/docs/Web/API/Sanitizer/setDataAttributes MDN Sanitizer.setDataAttributes documentation>
setDataAttributes_ :: (MonadDOM m) => Sanitizer -> Bool -> m ()
setDataAttributes_ self allow = liftDOM (void (self ^. jsf "setDataAttributes" [toJSVal allow]))