jsaddle-dom-0.10.0.0: src/JSDOM/Generated/SanitizerConfig.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.SanitizerConfig
(newSanitizerConfig, setElements, getElements, getElementsUnsafe, getElementsUnchecked, setRemoveElements, getRemoveElements, getRemoveElementsUnsafe, getRemoveElementsUnchecked, setReplaceWithChildrenElements, getReplaceWithChildrenElements, getReplaceWithChildrenElementsUnsafe, getReplaceWithChildrenElementsUnchecked, setProcessingInstructions, getProcessingInstructions, getProcessingInstructionsUnsafe, getProcessingInstructionsUnchecked, setRemoveProcessingInstructions, getRemoveProcessingInstructions, getRemoveProcessingInstructionsUnsafe, getRemoveProcessingInstructionsUnchecked, setAttributes, getAttributes, getAttributesUnsafe, getAttributesUnchecked, setRemoveAttributes, getRemoveAttributes, getRemoveAttributesUnsafe, getRemoveAttributesUnchecked, setComments, getComments, getCommentsUnsafe, getCommentsUnchecked, setDataAttributes, getDataAttributes, getDataAttributesUnsafe, getDataAttributesUnchecked, setJavascriptURLs, getJavascriptURLs, getJavascriptURLsUnsafe, getJavascriptURLsUnchecked, SanitizerConfig(..), gTypeSanitizerConfig)
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#sanitizerconfig SanitizerConfig specification>
newSanitizerConfig :: (MonadDOM m) => m SanitizerConfig
newSanitizerConfig = liftDOM ((((new (jsg "Object") () >>= \o -> P.return o)) >>= fromJSValUnchecked))
-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerconfig-elements SanitizerConfig.elements specification>
setElements :: (MonadDOM m, IsSanitizerElementWithAttributes val) => SanitizerConfig -> [val] -> m ()
setElements self val = liftDOM (void (self ^. jss "elements" (toJSVal val)))
-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerconfig-elements SanitizerConfig.elements specification>
getElements :: (MonadDOM m) => SanitizerConfig -> m (Maybe [SanitizerElementWithAttributes])
getElements self = liftDOM (((self ^. js "elements") >>= fromJSValUnchecked))
-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerconfig-elements SanitizerConfig.elements specification>
getElementsUnsafe :: (MonadDOM m, HasCallStack) => SanitizerConfig -> m [SanitizerElementWithAttributes]
getElementsUnsafe self = liftDOM ((((self ^. js "elements") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerconfig-elements SanitizerConfig.elements specification>
getElementsUnchecked :: (MonadDOM m) => SanitizerConfig -> m [SanitizerElementWithAttributes]
getElementsUnchecked self = liftDOM (((self ^. js "elements") >>= fromJSValUnchecked))
-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerconfig-removeelements SanitizerConfig.removeElements specification>
setRemoveElements :: (MonadDOM m, IsSanitizerElement val) => SanitizerConfig -> [val] -> m ()
setRemoveElements self val = liftDOM (void (self ^. jss "removeElements" (toJSVal val)))
-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerconfig-removeelements SanitizerConfig.removeElements specification>
getRemoveElements :: (MonadDOM m) => SanitizerConfig -> m (Maybe [SanitizerElement])
getRemoveElements self = liftDOM (((self ^. js "removeElements") >>= fromJSValUnchecked))
-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerconfig-removeelements SanitizerConfig.removeElements specification>
getRemoveElementsUnsafe :: (MonadDOM m, HasCallStack) => SanitizerConfig -> m [SanitizerElement]
getRemoveElementsUnsafe self = liftDOM ((((self ^. js "removeElements") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerconfig-removeelements SanitizerConfig.removeElements specification>
getRemoveElementsUnchecked :: (MonadDOM m) => SanitizerConfig -> m [SanitizerElement]
getRemoveElementsUnchecked self = liftDOM (((self ^. js "removeElements") >>= fromJSValUnchecked))
-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerconfig-replacewithchildrenelements SanitizerConfig.replaceWithChildrenElements specification>
setReplaceWithChildrenElements :: (MonadDOM m, IsSanitizerElement val) => SanitizerConfig -> [val] -> m ()
setReplaceWithChildrenElements self val = liftDOM (void (self ^. jss "replaceWithChildrenElements" (toJSVal val)))
-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerconfig-replacewithchildrenelements SanitizerConfig.replaceWithChildrenElements specification>
getReplaceWithChildrenElements :: (MonadDOM m) => SanitizerConfig -> m (Maybe [SanitizerElement])
getReplaceWithChildrenElements self = liftDOM (((self ^. js "replaceWithChildrenElements") >>= fromJSValUnchecked))
-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerconfig-replacewithchildrenelements SanitizerConfig.replaceWithChildrenElements specification>
getReplaceWithChildrenElementsUnsafe :: (MonadDOM m, HasCallStack) => SanitizerConfig -> m [SanitizerElement]
getReplaceWithChildrenElementsUnsafe self = liftDOM ((((self ^. js "replaceWithChildrenElements") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerconfig-replacewithchildrenelements SanitizerConfig.replaceWithChildrenElements specification>
getReplaceWithChildrenElementsUnchecked :: (MonadDOM m) => SanitizerConfig -> m [SanitizerElement]
getReplaceWithChildrenElementsUnchecked self = liftDOM (((self ^. js "replaceWithChildrenElements") >>= fromJSValUnchecked))
-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerconfig-processinginstructions SanitizerConfig.processingInstructions specification>
setProcessingInstructions :: (MonadDOM m, IsSanitizerPI val) => SanitizerConfig -> [val] -> m ()
setProcessingInstructions self val = liftDOM (void (self ^. jss "processingInstructions" (toJSVal val)))
-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerconfig-processinginstructions SanitizerConfig.processingInstructions specification>
getProcessingInstructions :: (MonadDOM m) => SanitizerConfig -> m (Maybe [SanitizerPI])
getProcessingInstructions self = liftDOM (((self ^. js "processingInstructions") >>= fromJSValUnchecked))
-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerconfig-processinginstructions SanitizerConfig.processingInstructions specification>
getProcessingInstructionsUnsafe :: (MonadDOM m, HasCallStack) => SanitizerConfig -> m [SanitizerPI]
getProcessingInstructionsUnsafe self = liftDOM ((((self ^. js "processingInstructions") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerconfig-processinginstructions SanitizerConfig.processingInstructions specification>
getProcessingInstructionsUnchecked :: (MonadDOM m) => SanitizerConfig -> m [SanitizerPI]
getProcessingInstructionsUnchecked self = liftDOM (((self ^. js "processingInstructions") >>= fromJSValUnchecked))
-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerconfig-removeprocessinginstructions SanitizerConfig.removeProcessingInstructions specification>
setRemoveProcessingInstructions :: (MonadDOM m, IsSanitizerPI val) => SanitizerConfig -> [val] -> m ()
setRemoveProcessingInstructions self val = liftDOM (void (self ^. jss "removeProcessingInstructions" (toJSVal val)))
-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerconfig-removeprocessinginstructions SanitizerConfig.removeProcessingInstructions specification>
getRemoveProcessingInstructions :: (MonadDOM m) => SanitizerConfig -> m (Maybe [SanitizerPI])
getRemoveProcessingInstructions self = liftDOM (((self ^. js "removeProcessingInstructions") >>= fromJSValUnchecked))
-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerconfig-removeprocessinginstructions SanitizerConfig.removeProcessingInstructions specification>
getRemoveProcessingInstructionsUnsafe :: (MonadDOM m, HasCallStack) => SanitizerConfig -> m [SanitizerPI]
getRemoveProcessingInstructionsUnsafe self = liftDOM ((((self ^. js "removeProcessingInstructions") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerconfig-removeprocessinginstructions SanitizerConfig.removeProcessingInstructions specification>
getRemoveProcessingInstructionsUnchecked :: (MonadDOM m) => SanitizerConfig -> m [SanitizerPI]
getRemoveProcessingInstructionsUnchecked self = liftDOM (((self ^. js "removeProcessingInstructions") >>= fromJSValUnchecked))
-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerconfig-attributes SanitizerConfig.attributes specification>
setAttributes :: (MonadDOM m, IsSanitizerAttribute val) => SanitizerConfig -> [val] -> m ()
setAttributes self val = liftDOM (void (self ^. jss "attributes" (toJSVal val)))
-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerconfig-attributes SanitizerConfig.attributes specification>
getAttributes :: (MonadDOM m) => SanitizerConfig -> m (Maybe [SanitizerAttribute])
getAttributes self = liftDOM (((self ^. js "attributes") >>= fromJSValUnchecked))
-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerconfig-attributes SanitizerConfig.attributes specification>
getAttributesUnsafe :: (MonadDOM m, HasCallStack) => SanitizerConfig -> 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-sanitizerconfig-attributes SanitizerConfig.attributes specification>
getAttributesUnchecked :: (MonadDOM m) => SanitizerConfig -> m [SanitizerAttribute]
getAttributesUnchecked self = liftDOM (((self ^. js "attributes") >>= fromJSValUnchecked))
-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerconfig-removeattributes SanitizerConfig.removeAttributes specification>
setRemoveAttributes :: (MonadDOM m, IsSanitizerAttribute val) => SanitizerConfig -> [val] -> m ()
setRemoveAttributes self val = liftDOM (void (self ^. jss "removeAttributes" (toJSVal val)))
-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerconfig-removeattributes SanitizerConfig.removeAttributes specification>
getRemoveAttributes :: (MonadDOM m) => SanitizerConfig -> m (Maybe [SanitizerAttribute])
getRemoveAttributes self = liftDOM (((self ^. js "removeAttributes") >>= fromJSValUnchecked))
-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerconfig-removeattributes SanitizerConfig.removeAttributes specification>
getRemoveAttributesUnsafe :: (MonadDOM m, HasCallStack) => SanitizerConfig -> 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-sanitizerconfig-removeattributes SanitizerConfig.removeAttributes specification>
getRemoveAttributesUnchecked :: (MonadDOM m) => SanitizerConfig -> m [SanitizerAttribute]
getRemoveAttributesUnchecked self = liftDOM (((self ^. js "removeAttributes") >>= fromJSValUnchecked))
-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerconfig-comments SanitizerConfig.comments specification>
setComments :: (MonadDOM m) => SanitizerConfig -> Bool -> m ()
setComments self val = liftDOM (void (self ^. jss "comments" (toJSVal val)))
-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerconfig-comments SanitizerConfig.comments specification>
getComments :: (MonadDOM m) => SanitizerConfig -> m (Maybe Bool)
getComments self = liftDOM (((self ^. js "comments") >>= fromJSValUnchecked))
-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerconfig-comments SanitizerConfig.comments specification>
getCommentsUnsafe :: (MonadDOM m, HasCallStack) => SanitizerConfig -> m Bool
getCommentsUnsafe self = liftDOM ((((self ^. js "comments") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerconfig-comments SanitizerConfig.comments specification>
getCommentsUnchecked :: (MonadDOM m) => SanitizerConfig -> m Bool
getCommentsUnchecked self = liftDOM (((self ^. js "comments") >>= valToBool))
-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerconfig-dataattributes SanitizerConfig.dataAttributes specification>
setDataAttributes :: (MonadDOM m) => SanitizerConfig -> Bool -> m ()
setDataAttributes self val = liftDOM (void (self ^. jss "dataAttributes" (toJSVal val)))
-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerconfig-dataattributes SanitizerConfig.dataAttributes specification>
getDataAttributes :: (MonadDOM m) => SanitizerConfig -> m (Maybe Bool)
getDataAttributes self = liftDOM (((self ^. js "dataAttributes") >>= fromJSValUnchecked))
-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerconfig-dataattributes SanitizerConfig.dataAttributes specification>
getDataAttributesUnsafe :: (MonadDOM m, HasCallStack) => SanitizerConfig -> m Bool
getDataAttributesUnsafe self = liftDOM ((((self ^. js "dataAttributes") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerconfig-dataattributes SanitizerConfig.dataAttributes specification>
getDataAttributesUnchecked :: (MonadDOM m) => SanitizerConfig -> m Bool
getDataAttributesUnchecked self = liftDOM (((self ^. js "dataAttributes") >>= valToBool))
-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerconfig-javascripturls SanitizerConfig.javascriptURLs specification>
setJavascriptURLs :: (MonadDOM m) => SanitizerConfig -> Bool -> m ()
setJavascriptURLs self val = liftDOM (void (self ^. jss "javascriptURLs" (toJSVal val)))
-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerconfig-javascripturls SanitizerConfig.javascriptURLs specification>
getJavascriptURLs :: (MonadDOM m) => SanitizerConfig -> m (Maybe Bool)
getJavascriptURLs self = liftDOM (((self ^. js "javascriptURLs") >>= fromJSValUnchecked))
-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerconfig-javascripturls SanitizerConfig.javascriptURLs specification>
getJavascriptURLsUnsafe :: (MonadDOM m, HasCallStack) => SanitizerConfig -> m Bool
getJavascriptURLsUnsafe self = liftDOM ((((self ^. js "javascriptURLs") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizerconfig-javascripturls SanitizerConfig.javascriptURLs specification>
getJavascriptURLsUnchecked :: (MonadDOM m) => SanitizerConfig -> m Bool
getJavascriptURLsUnchecked self = liftDOM (((self ^. js "javascriptURLs") >>= valToBool))