jsaddle-dom-0.10.0.0: src/JSDOM/Generated/MutationObserverInit.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from dom (webref). Do not edit.
module JSDOM.Generated.MutationObserverInit
(newMutationObserverInit, setChildList, getChildList, getChildListUnsafe, getChildListUnchecked, setAttributes, getAttributes, getAttributesUnsafe, getAttributesUnchecked, setCharacterData, getCharacterData, getCharacterDataUnsafe, getCharacterDataUnchecked, setSubtree, getSubtree, getSubtreeUnsafe, getSubtreeUnchecked, setAttributeOldValue, getAttributeOldValue, getAttributeOldValueUnsafe, getAttributeOldValueUnchecked, setCharacterDataOldValue, getCharacterDataOldValue, getCharacterDataOldValueUnsafe, getCharacterDataOldValueUnchecked, setAttributeFilter, getAttributeFilter, getAttributeFilterUnsafe, getAttributeFilterUnchecked, MutationObserverInit(..), gTypeMutationObserverInit)
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://dom.spec.whatwg.org/#dictdef-mutationobserverinit MutationObserverInit specification>
newMutationObserverInit :: (MonadDOM m) => m MutationObserverInit
newMutationObserverInit = liftDOM ((((new (jsg "Object") () >>= \o -> P.return o)) >>= fromJSValUnchecked))
-- | <https://dom.spec.whatwg.org/#dom-mutationobserverinit-childlist MutationObserverInit.childList specification>
setChildList :: (MonadDOM m) => MutationObserverInit -> Bool -> m ()
setChildList self val = liftDOM (void (self ^. jss "childList" (toJSVal val)))
-- | <https://dom.spec.whatwg.org/#dom-mutationobserverinit-childlist MutationObserverInit.childList specification>
getChildList :: (MonadDOM m) => MutationObserverInit -> m (Maybe Bool)
getChildList self = liftDOM (((self ^. js "childList") >>= fromJSValUnchecked))
-- | <https://dom.spec.whatwg.org/#dom-mutationobserverinit-childlist MutationObserverInit.childList specification>
getChildListUnsafe :: (MonadDOM m, HasCallStack) => MutationObserverInit -> m Bool
getChildListUnsafe self = liftDOM ((((self ^. js "childList") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://dom.spec.whatwg.org/#dom-mutationobserverinit-childlist MutationObserverInit.childList specification>
getChildListUnchecked :: (MonadDOM m) => MutationObserverInit -> m Bool
getChildListUnchecked self = liftDOM (((self ^. js "childList") >>= valToBool))
-- | <https://dom.spec.whatwg.org/#dom-mutationobserverinit-attributes MutationObserverInit.attributes specification>
setAttributes :: (MonadDOM m) => MutationObserverInit -> Bool -> m ()
setAttributes self val = liftDOM (void (self ^. jss "attributes" (toJSVal val)))
-- | <https://dom.spec.whatwg.org/#dom-mutationobserverinit-attributes MutationObserverInit.attributes specification>
getAttributes :: (MonadDOM m) => MutationObserverInit -> m (Maybe Bool)
getAttributes self = liftDOM (((self ^. js "attributes") >>= fromJSValUnchecked))
-- | <https://dom.spec.whatwg.org/#dom-mutationobserverinit-attributes MutationObserverInit.attributes specification>
getAttributesUnsafe :: (MonadDOM m, HasCallStack) => MutationObserverInit -> m Bool
getAttributesUnsafe self = liftDOM ((((self ^. js "attributes") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://dom.spec.whatwg.org/#dom-mutationobserverinit-attributes MutationObserverInit.attributes specification>
getAttributesUnchecked :: (MonadDOM m) => MutationObserverInit -> m Bool
getAttributesUnchecked self = liftDOM (((self ^. js "attributes") >>= valToBool))
-- | <https://dom.spec.whatwg.org/#dom-mutationobserverinit-characterdata MutationObserverInit.characterData specification>
setCharacterData :: (MonadDOM m) => MutationObserverInit -> Bool -> m ()
setCharacterData self val = liftDOM (void (self ^. jss "characterData" (toJSVal val)))
-- | <https://dom.spec.whatwg.org/#dom-mutationobserverinit-characterdata MutationObserverInit.characterData specification>
getCharacterData :: (MonadDOM m) => MutationObserverInit -> m (Maybe Bool)
getCharacterData self = liftDOM (((self ^. js "characterData") >>= fromJSValUnchecked))
-- | <https://dom.spec.whatwg.org/#dom-mutationobserverinit-characterdata MutationObserverInit.characterData specification>
getCharacterDataUnsafe :: (MonadDOM m, HasCallStack) => MutationObserverInit -> m Bool
getCharacterDataUnsafe self = liftDOM ((((self ^. js "characterData") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://dom.spec.whatwg.org/#dom-mutationobserverinit-characterdata MutationObserverInit.characterData specification>
getCharacterDataUnchecked :: (MonadDOM m) => MutationObserverInit -> m Bool
getCharacterDataUnchecked self = liftDOM (((self ^. js "characterData") >>= valToBool))
-- | <https://dom.spec.whatwg.org/#dom-mutationobserverinit-subtree MutationObserverInit.subtree specification>
setSubtree :: (MonadDOM m) => MutationObserverInit -> Bool -> m ()
setSubtree self val = liftDOM (void (self ^. jss "subtree" (toJSVal val)))
-- | <https://dom.spec.whatwg.org/#dom-mutationobserverinit-subtree MutationObserverInit.subtree specification>
getSubtree :: (MonadDOM m) => MutationObserverInit -> m (Maybe Bool)
getSubtree self = liftDOM (((self ^. js "subtree") >>= fromJSValUnchecked))
-- | <https://dom.spec.whatwg.org/#dom-mutationobserverinit-subtree MutationObserverInit.subtree specification>
getSubtreeUnsafe :: (MonadDOM m, HasCallStack) => MutationObserverInit -> m Bool
getSubtreeUnsafe self = liftDOM ((((self ^. js "subtree") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://dom.spec.whatwg.org/#dom-mutationobserverinit-subtree MutationObserverInit.subtree specification>
getSubtreeUnchecked :: (MonadDOM m) => MutationObserverInit -> m Bool
getSubtreeUnchecked self = liftDOM (((self ^. js "subtree") >>= valToBool))
-- | <https://dom.spec.whatwg.org/#dom-mutationobserverinit-attributeoldvalue MutationObserverInit.attributeOldValue specification>
setAttributeOldValue :: (MonadDOM m) => MutationObserverInit -> Bool -> m ()
setAttributeOldValue self val = liftDOM (void (self ^. jss "attributeOldValue" (toJSVal val)))
-- | <https://dom.spec.whatwg.org/#dom-mutationobserverinit-attributeoldvalue MutationObserverInit.attributeOldValue specification>
getAttributeOldValue :: (MonadDOM m) => MutationObserverInit -> m (Maybe Bool)
getAttributeOldValue self = liftDOM (((self ^. js "attributeOldValue") >>= fromJSValUnchecked))
-- | <https://dom.spec.whatwg.org/#dom-mutationobserverinit-attributeoldvalue MutationObserverInit.attributeOldValue specification>
getAttributeOldValueUnsafe :: (MonadDOM m, HasCallStack) => MutationObserverInit -> m Bool
getAttributeOldValueUnsafe self = liftDOM ((((self ^. js "attributeOldValue") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://dom.spec.whatwg.org/#dom-mutationobserverinit-attributeoldvalue MutationObserverInit.attributeOldValue specification>
getAttributeOldValueUnchecked :: (MonadDOM m) => MutationObserverInit -> m Bool
getAttributeOldValueUnchecked self = liftDOM (((self ^. js "attributeOldValue") >>= valToBool))
-- | <https://dom.spec.whatwg.org/#dom-mutationobserverinit-characterdataoldvalue MutationObserverInit.characterDataOldValue specification>
setCharacterDataOldValue :: (MonadDOM m) => MutationObserverInit -> Bool -> m ()
setCharacterDataOldValue self val = liftDOM (void (self ^. jss "characterDataOldValue" (toJSVal val)))
-- | <https://dom.spec.whatwg.org/#dom-mutationobserverinit-characterdataoldvalue MutationObserverInit.characterDataOldValue specification>
getCharacterDataOldValue :: (MonadDOM m) => MutationObserverInit -> m (Maybe Bool)
getCharacterDataOldValue self = liftDOM (((self ^. js "characterDataOldValue") >>= fromJSValUnchecked))
-- | <https://dom.spec.whatwg.org/#dom-mutationobserverinit-characterdataoldvalue MutationObserverInit.characterDataOldValue specification>
getCharacterDataOldValueUnsafe :: (MonadDOM m, HasCallStack) => MutationObserverInit -> m Bool
getCharacterDataOldValueUnsafe self = liftDOM ((((self ^. js "characterDataOldValue") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://dom.spec.whatwg.org/#dom-mutationobserverinit-characterdataoldvalue MutationObserverInit.characterDataOldValue specification>
getCharacterDataOldValueUnchecked :: (MonadDOM m) => MutationObserverInit -> m Bool
getCharacterDataOldValueUnchecked self = liftDOM (((self ^. js "characterDataOldValue") >>= valToBool))
-- | <https://dom.spec.whatwg.org/#dom-mutationobserverinit-attributefilter MutationObserverInit.attributeFilter specification>
setAttributeFilter :: (MonadDOM m, ToJSString val) => MutationObserverInit -> [val] -> m ()
setAttributeFilter self val = liftDOM (void (self ^. jss "attributeFilter" (toJSVal val)))
-- | <https://dom.spec.whatwg.org/#dom-mutationobserverinit-attributefilter MutationObserverInit.attributeFilter specification>
getAttributeFilter :: (MonadDOM m, FromJSString result) => MutationObserverInit -> m (Maybe [result])
getAttributeFilter self = liftDOM (((self ^. js "attributeFilter") >>= fromJSValUnchecked))
-- | <https://dom.spec.whatwg.org/#dom-mutationobserverinit-attributefilter MutationObserverInit.attributeFilter specification>
getAttributeFilterUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => MutationObserverInit -> m [result]
getAttributeFilterUnsafe self = liftDOM ((((self ^. js "attributeFilter") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://dom.spec.whatwg.org/#dom-mutationobserverinit-attributefilter MutationObserverInit.attributeFilter specification>
getAttributeFilterUnchecked :: (MonadDOM m, FromJSString result) => MutationObserverInit -> m [result]
getAttributeFilterUnchecked self = liftDOM (((self ^. js "attributeFilter") >>= fromJSValUnchecked))