module JSDOM.Generated.NodeIterator
(nextNode, nextNode_, nextNodeUnsafe, nextNodeUnchecked,
previousNode, previousNode_, previousNodeUnsafe,
previousNodeUnchecked, detach, getRoot, getReferenceNode,
getPointerBeforeReferenceNode, getWhatToShow, NodeIterator(..),
gTypeNodeIterator)
where
import Prelude ((.), (==), (>>=), return, IO, Int, Float, Double, Bool(..), Maybe, maybe, fromIntegral, round, realToFrac, fmap, Show, Read, Eq, Ord, Maybe(..))
import qualified Prelude (error)
import Data.Typeable (Typeable)
import Data.Traversable (mapM)
import Language.Javascript.JSaddle (JSM(..), JSVal(..), JSString, strictEqual, toJSVal, valToStr, valToNumber, valToBool, js, jss, jsf, jsg, function, asyncFunction, new, array, jsUndefined, (!), (!!))
import Data.Int (Int64)
import Data.Word (Word, Word64)
import JSDOM.Types
import Control.Applicative ((<$>))
import Control.Monad (void)
import Control.Lens.Operators ((^.))
import JSDOM.EventTargetClosures (EventName, unsafeEventName)
import JSDOM.Enums
nextNode :: (MonadDOM m) => NodeIterator -> m (Maybe Node)
nextNode self = liftDOM ((self ^. jsf "nextNode" ()) >>= fromJSVal)
nextNode_ :: (MonadDOM m) => NodeIterator -> m ()
nextNode_ self = liftDOM (void (self ^. jsf "nextNode" ()))
nextNodeUnsafe ::
(MonadDOM m, HasCallStack) => NodeIterator -> m Node
nextNodeUnsafe self
= liftDOM
(((self ^. jsf "nextNode" ()) >>= fromJSVal) >>=
maybe (Prelude.error "Nothing to return") return)
nextNodeUnchecked :: (MonadDOM m) => NodeIterator -> m Node
nextNodeUnchecked self
= liftDOM ((self ^. jsf "nextNode" ()) >>= fromJSValUnchecked)
previousNode :: (MonadDOM m) => NodeIterator -> m (Maybe Node)
previousNode self
= liftDOM ((self ^. jsf "previousNode" ()) >>= fromJSVal)
previousNode_ :: (MonadDOM m) => NodeIterator -> m ()
previousNode_ self = liftDOM (void (self ^. jsf "previousNode" ()))
previousNodeUnsafe ::
(MonadDOM m, HasCallStack) => NodeIterator -> m Node
previousNodeUnsafe self
= liftDOM
(((self ^. jsf "previousNode" ()) >>= fromJSVal) >>=
maybe (Prelude.error "Nothing to return") return)
previousNodeUnchecked :: (MonadDOM m) => NodeIterator -> m Node
previousNodeUnchecked self
= liftDOM ((self ^. jsf "previousNode" ()) >>= fromJSValUnchecked)
detach :: (MonadDOM m) => NodeIterator -> m ()
detach self = liftDOM (void (self ^. jsf "detach" ()))
getRoot :: (MonadDOM m) => NodeIterator -> m Node
getRoot self = liftDOM ((self ^. js "root") >>= fromJSValUnchecked)
getReferenceNode :: (MonadDOM m) => NodeIterator -> m Node
getReferenceNode self
= liftDOM ((self ^. js "referenceNode") >>= fromJSValUnchecked)
getPointerBeforeReferenceNode ::
(MonadDOM m) => NodeIterator -> m Bool
getPointerBeforeReferenceNode self
= liftDOM ((self ^. js "pointerBeforeReferenceNode") >>= valToBool)
getWhatToShow :: (MonadDOM m) => NodeIterator -> m Word
getWhatToShow self
= liftDOM (round <$> ((self ^. js "whatToShow") >>= valToNumber))