packages feed

jsaddle-dom-0.10.0.0: src/JSDOM/Generated/MutationRecord.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.MutationRecord
       (getType, getTarget, getAddedNodes, getRemovedNodes, getPreviousSibling, getPreviousSiblingUnsafe, getPreviousSiblingUnchecked, getNextSibling, getNextSiblingUnsafe, getNextSiblingUnchecked, getAttributeName, getAttributeNameUnsafe, getAttributeNameUnchecked, getAttributeNamespace, getAttributeNamespaceUnsafe, getAttributeNamespaceUnchecked, getOldValue, getOldValueUnsafe, getOldValueUnchecked, MutationRecord(..), gTypeMutationRecord)
       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/MutationRecord/type MDN MutationRecord.type documentation>
getType :: (MonadDOM m, FromJSString result) => MutationRecord -> m result
getType self = liftDOM (((self ^. js "type") >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/MutationRecord/target MDN MutationRecord.target documentation>
getTarget :: (MonadDOM m) => MutationRecord -> m Node
getTarget self = liftDOM (((self ^. js "target") >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/MutationRecord/addedNodes MDN MutationRecord.addedNodes documentation>
getAddedNodes :: (MonadDOM m) => MutationRecord -> m NodeList
getAddedNodes self = liftDOM (((self ^. js "addedNodes") >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/MutationRecord/removedNodes MDN MutationRecord.removedNodes documentation>
getRemovedNodes :: (MonadDOM m) => MutationRecord -> m NodeList
getRemovedNodes self = liftDOM (((self ^. js "removedNodes") >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/MutationRecord/previousSibling MDN MutationRecord.previousSibling documentation>
getPreviousSibling :: (MonadDOM m) => MutationRecord -> m (Maybe Node)
getPreviousSibling self = liftDOM (((self ^. js "previousSibling") >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/MutationRecord/previousSibling MDN MutationRecord.previousSibling documentation>
getPreviousSiblingUnsafe :: (MonadDOM m, HasCallStack) => MutationRecord -> m Node
getPreviousSiblingUnsafe self = liftDOM ((((self ^. js "previousSibling") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://developer.mozilla.org/docs/Web/API/MutationRecord/previousSibling MDN MutationRecord.previousSibling documentation>
getPreviousSiblingUnchecked :: (MonadDOM m) => MutationRecord -> m Node
getPreviousSiblingUnchecked self = liftDOM (((self ^. js "previousSibling") >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/MutationRecord/nextSibling MDN MutationRecord.nextSibling documentation>
getNextSibling :: (MonadDOM m) => MutationRecord -> m (Maybe Node)
getNextSibling self = liftDOM (((self ^. js "nextSibling") >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/MutationRecord/nextSibling MDN MutationRecord.nextSibling documentation>
getNextSiblingUnsafe :: (MonadDOM m, HasCallStack) => MutationRecord -> m Node
getNextSiblingUnsafe self = liftDOM ((((self ^. js "nextSibling") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://developer.mozilla.org/docs/Web/API/MutationRecord/nextSibling MDN MutationRecord.nextSibling documentation>
getNextSiblingUnchecked :: (MonadDOM m) => MutationRecord -> m Node
getNextSiblingUnchecked self = liftDOM (((self ^. js "nextSibling") >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/MutationRecord/attributeName MDN MutationRecord.attributeName documentation>
getAttributeName :: (MonadDOM m, FromJSString result) => MutationRecord -> m (Maybe result)
getAttributeName self = liftDOM (((self ^. js "attributeName") >>= fromMaybeJSString))

-- | <https://developer.mozilla.org/docs/Web/API/MutationRecord/attributeName MDN MutationRecord.attributeName documentation>
getAttributeNameUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => MutationRecord -> m result
getAttributeNameUnsafe self = liftDOM ((((self ^. js "attributeName") >>= fromMaybeJSString) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://developer.mozilla.org/docs/Web/API/MutationRecord/attributeName MDN MutationRecord.attributeName documentation>
getAttributeNameUnchecked :: (MonadDOM m, FromJSString result) => MutationRecord -> m result
getAttributeNameUnchecked self = liftDOM (((self ^. js "attributeName") >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/MutationRecord/attributeNamespace MDN MutationRecord.attributeNamespace documentation>
getAttributeNamespace :: (MonadDOM m, FromJSString result) => MutationRecord -> m (Maybe result)
getAttributeNamespace self = liftDOM (((self ^. js "attributeNamespace") >>= fromMaybeJSString))

-- | <https://developer.mozilla.org/docs/Web/API/MutationRecord/attributeNamespace MDN MutationRecord.attributeNamespace documentation>
getAttributeNamespaceUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => MutationRecord -> m result
getAttributeNamespaceUnsafe self = liftDOM ((((self ^. js "attributeNamespace") >>= fromMaybeJSString) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://developer.mozilla.org/docs/Web/API/MutationRecord/attributeNamespace MDN MutationRecord.attributeNamespace documentation>
getAttributeNamespaceUnchecked :: (MonadDOM m, FromJSString result) => MutationRecord -> m result
getAttributeNamespaceUnchecked self = liftDOM (((self ^. js "attributeNamespace") >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/MutationRecord/oldValue MDN MutationRecord.oldValue documentation>
getOldValue :: (MonadDOM m, FromJSString result) => MutationRecord -> m (Maybe result)
getOldValue self = liftDOM (((self ^. js "oldValue") >>= fromMaybeJSString))

-- | <https://developer.mozilla.org/docs/Web/API/MutationRecord/oldValue MDN MutationRecord.oldValue documentation>
getOldValueUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => MutationRecord -> m result
getOldValueUnsafe self = liftDOM ((((self ^. js "oldValue") >>= fromMaybeJSString) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://developer.mozilla.org/docs/Web/API/MutationRecord/oldValue MDN MutationRecord.oldValue documentation>
getOldValueUnchecked :: (MonadDOM m, FromJSString result) => MutationRecord -> m result
getOldValueUnchecked self = liftDOM (((self ^. js "oldValue") >>= fromJSValUnchecked))