module JSDOM.Generated.XPathEvaluator
(newXPathEvaluator, createExpression, createExpression_,
createNSResolver, createNSResolver_, evaluate, evaluate_,
XPathEvaluator(..), gTypeXPathEvaluator)
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
newXPathEvaluator :: (MonadDOM m) => m XPathEvaluator
newXPathEvaluator
= liftDOM (XPathEvaluator <$> new (jsg "XPathEvaluator") ())
createExpression ::
(MonadDOM m, ToJSString expression) =>
XPathEvaluator ->
Maybe expression -> Maybe XPathNSResolver -> m XPathExpression
createExpression self expression resolver
= liftDOM
((self ^. jsf "createExpression"
[toJSVal expression, toJSVal resolver])
>>= fromJSValUnchecked)
createExpression_ ::
(MonadDOM m, ToJSString expression) =>
XPathEvaluator -> Maybe expression -> Maybe XPathNSResolver -> m ()
createExpression_ self expression resolver
= liftDOM
(void
(self ^. jsf "createExpression"
[toJSVal expression, toJSVal resolver]))
createNSResolver ::
(MonadDOM m, IsNode nodeResolver) =>
XPathEvaluator -> Maybe nodeResolver -> m XPathNSResolver
createNSResolver self nodeResolver
= liftDOM
((self ^. jsf "createNSResolver" [toJSVal nodeResolver]) >>=
fromJSValUnchecked)
createNSResolver_ ::
(MonadDOM m, IsNode nodeResolver) =>
XPathEvaluator -> Maybe nodeResolver -> m ()
createNSResolver_ self nodeResolver
= liftDOM
(void (self ^. jsf "createNSResolver" [toJSVal nodeResolver]))
evaluate ::
(MonadDOM m, ToJSString expression, IsNode contextNode) =>
XPathEvaluator ->
Maybe expression ->
Maybe contextNode ->
Maybe XPathNSResolver ->
Maybe Word -> Maybe XPathResult -> m XPathResult
evaluate self expression contextNode resolver type' inResult
= liftDOM
((self ^. jsf "evaluate"
[toJSVal expression, toJSVal contextNode, toJSVal resolver,
toJSVal type', toJSVal inResult])
>>= fromJSValUnchecked)
evaluate_ ::
(MonadDOM m, ToJSString expression, IsNode contextNode) =>
XPathEvaluator ->
Maybe expression ->
Maybe contextNode ->
Maybe XPathNSResolver -> Maybe Word -> Maybe XPathResult -> m ()
evaluate_ self expression contextNode resolver type' inResult
= liftDOM
(void
(self ^. jsf "evaluate"
[toJSVal expression, toJSVal contextNode, toJSVal resolver,
toJSVal type', toJSVal inResult]))