ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/MutationRecord.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from dom (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.MutationRecord
(js_getType, js_getTarget, js_getAddedNodes, js_getRemovedNodes, js_getPreviousSibling, js_getNextSibling, js_getAttributeName, js_getAttributeNamespace, js_getOldValue, 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 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 unsafe "(($1) => { return $1[\"type\"]; })"
js_getType :: MutationRecord -> IO JSString
-- | <https://developer.mozilla.org/docs/Web/API/MutationRecord/type MDN MutationRecord.type documentation>
getType :: (MonadDOM m, FromJSString result) => MutationRecord -> m result
getType self = liftDOM ((fromJSString <$> (js_getType (self))))
foreign import javascript unsafe "(($1) => { return $1[\"target\"]; })"
js_getTarget :: MutationRecord -> IO Node
-- | <https://developer.mozilla.org/docs/Web/API/MutationRecord/target MDN MutationRecord.target documentation>
getTarget :: (MonadDOM m) => MutationRecord -> m Node
getTarget self = liftDOM ((js_getTarget (self)))
foreign import javascript unsafe "(($1) => { return $1[\"addedNodes\"]; })"
js_getAddedNodes :: MutationRecord -> IO NodeList
-- | <https://developer.mozilla.org/docs/Web/API/MutationRecord/addedNodes MDN MutationRecord.addedNodes documentation>
getAddedNodes :: (MonadDOM m) => MutationRecord -> m NodeList
getAddedNodes self = liftDOM ((js_getAddedNodes (self)))
foreign import javascript unsafe "(($1) => { return $1[\"removedNodes\"]; })"
js_getRemovedNodes :: MutationRecord -> IO NodeList
-- | <https://developer.mozilla.org/docs/Web/API/MutationRecord/removedNodes MDN MutationRecord.removedNodes documentation>
getRemovedNodes :: (MonadDOM m) => MutationRecord -> m NodeList
getRemovedNodes self = liftDOM ((js_getRemovedNodes (self)))
foreign import javascript unsafe "(($1) => { return $1[\"previousSibling\"]; })"
js_getPreviousSibling :: MutationRecord -> IO JSVal
-- | <https://developer.mozilla.org/docs/Web/API/MutationRecord/previousSibling MDN MutationRecord.previousSibling documentation>
getPreviousSibling :: (MonadDOM m) => MutationRecord -> m (Maybe Node)
getPreviousSibling self = liftDOM (((js_getPreviousSibling (self)) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/MutationRecord/previousSibling MDN MutationRecord.previousSibling documentation>
getPreviousSiblingUnsafe :: (MonadDOM m, HasCallStack) => MutationRecord -> m Node
getPreviousSiblingUnsafe self = liftDOM ((((js_getPreviousSibling (self)) >>= 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 ((pFromJSVal <$> (js_getPreviousSibling (self))))
foreign import javascript unsafe "(($1) => { return $1[\"nextSibling\"]; })"
js_getNextSibling :: MutationRecord -> IO JSVal
-- | <https://developer.mozilla.org/docs/Web/API/MutationRecord/nextSibling MDN MutationRecord.nextSibling documentation>
getNextSibling :: (MonadDOM m) => MutationRecord -> m (Maybe Node)
getNextSibling self = liftDOM (((js_getNextSibling (self)) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/MutationRecord/nextSibling MDN MutationRecord.nextSibling documentation>
getNextSiblingUnsafe :: (MonadDOM m, HasCallStack) => MutationRecord -> m Node
getNextSiblingUnsafe self = liftDOM ((((js_getNextSibling (self)) >>= 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 ((pFromJSVal <$> (js_getNextSibling (self))))
foreign import javascript unsafe "(($1) => { return $1[\"attributeName\"]; })"
js_getAttributeName :: MutationRecord -> IO JSVal
-- | <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 (((fromMaybeJSString . Nullable) <$> (js_getAttributeName (self))))
-- | <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 ((((fromMaybeJSString . Nullable) <$> (js_getAttributeName (self))) >>= 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 ((pFromJSVal <$> (js_getAttributeName (self))))
foreign import javascript unsafe "(($1) => { return $1[\"attributeNamespace\"]; })"
js_getAttributeNamespace :: MutationRecord -> IO JSVal
-- | <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 (((fromMaybeJSString . Nullable) <$> (js_getAttributeNamespace (self))))
-- | <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 ((((fromMaybeJSString . Nullable) <$> (js_getAttributeNamespace (self))) >>= 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 ((pFromJSVal <$> (js_getAttributeNamespace (self))))
foreign import javascript unsafe "(($1) => { return $1[\"oldValue\"]; })"
js_getOldValue :: MutationRecord -> IO JSVal
-- | <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 (((fromMaybeJSString . Nullable) <$> (js_getOldValue (self))))
-- | <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 ((((fromMaybeJSString . Nullable) <$> (js_getOldValue (self))) >>= 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 ((pFromJSVal <$> (js_getOldValue (self))))