packages feed

ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/XPathExpression.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.XPathExpression
       (js_evaluate, evaluate, evaluate_, XPathExpression(..), gTypeXPathExpression)
       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 safe "(($1, $2, $3, $4) => { return $1[\"evaluate\"]($2, $3, $4); })"
        js_evaluate :: XPathExpression -> Node -> JSVal -> JSVal -> IO XPathResult
-- | <https://developer.mozilla.org/docs/Web/API/XPathExpression/evaluate MDN XPathExpression.evaluate documentation>
evaluate :: (MonadDOM m, IsNode contextNode) => XPathExpression -> contextNode -> Maybe Word -> Maybe XPathResult -> m XPathResult
evaluate self contextNode type' result' = liftDOM (((P.maybe (P.return jsUndefined) toJSVal type') >>= \a3' -> (toJSVal result') >>= \a4' -> js_evaluate (self) (Types.toNode contextNode) a3' a4'))

-- | <https://developer.mozilla.org/docs/Web/API/XPathExpression/evaluate MDN XPathExpression.evaluate documentation>
evaluate_ :: (MonadDOM m, IsNode contextNode) => XPathExpression -> contextNode -> Maybe Word -> Maybe XPathResult -> m ()
evaluate_ self contextNode type' result' = liftDOM (void (((P.maybe (P.return jsUndefined) toJSVal type') >>= \a3' -> (toJSVal result') >>= \a4' -> js_evaluate (self) (Types.toNode contextNode) a3' a4')))