jsaddle-dom-0.10.0.0: src/JSDOM/Generated/DOMImplementation.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.DOMImplementation
(createDocument, createDocument_, createDocumentType, createDocumentType_, createHTMLDocument, createHTMLDocument_, hasFeature, hasFeature_, DOMImplementation(..), gTypeDOMImplementation)
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/DOMImplementation/createDocument MDN DOMImplementation.createDocument documentation>
createDocument :: (MonadDOM m, ToJSString namespace, ToJSString qualifiedName) => DOMImplementation -> Maybe namespace -> qualifiedName -> Maybe DocumentType -> m XMLDocument
createDocument self namespace qualifiedName doctype = liftDOM (((self ^. jsf "createDocument" [toJSVal namespace, toJSVal qualifiedName, toJSVal doctype]) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/DOMImplementation/createDocument MDN DOMImplementation.createDocument documentation>
createDocument_ :: (MonadDOM m, ToJSString namespace, ToJSString qualifiedName) => DOMImplementation -> Maybe namespace -> qualifiedName -> Maybe DocumentType -> m ()
createDocument_ self namespace qualifiedName doctype = liftDOM (void (self ^. jsf "createDocument" [toJSVal namespace, toJSVal qualifiedName, toJSVal doctype]))
-- | <https://developer.mozilla.org/docs/Web/API/DOMImplementation/createDocumentType MDN DOMImplementation.createDocumentType documentation>
createDocumentType :: (MonadDOM m, ToJSString name, ToJSString publicId, ToJSString systemId) => DOMImplementation -> name -> publicId -> systemId -> m DocumentType
createDocumentType self name publicId systemId = liftDOM (((self ^. jsf "createDocumentType" [toJSVal name, toJSVal publicId, toJSVal systemId]) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/DOMImplementation/createDocumentType MDN DOMImplementation.createDocumentType documentation>
createDocumentType_ :: (MonadDOM m, ToJSString name, ToJSString publicId, ToJSString systemId) => DOMImplementation -> name -> publicId -> systemId -> m ()
createDocumentType_ self name publicId systemId = liftDOM (void (self ^. jsf "createDocumentType" [toJSVal name, toJSVal publicId, toJSVal systemId]))
-- | <https://developer.mozilla.org/docs/Web/API/DOMImplementation/createHTMLDocument MDN DOMImplementation.createHTMLDocument documentation>
createHTMLDocument :: (MonadDOM m, ToJSString title) => DOMImplementation -> Maybe title -> m Document
createHTMLDocument self title = liftDOM (((self ^. jsf "createHTMLDocument" [P.maybe (P.return jsUndefined) toJSVal title]) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/DOMImplementation/createHTMLDocument MDN DOMImplementation.createHTMLDocument documentation>
createHTMLDocument_ :: (MonadDOM m, ToJSString title) => DOMImplementation -> Maybe title -> m ()
createHTMLDocument_ self title = liftDOM (void (self ^. jsf "createHTMLDocument" [P.maybe (P.return jsUndefined) toJSVal title]))
-- | <https://developer.mozilla.org/docs/Web/API/DOMImplementation/hasFeature MDN DOMImplementation.hasFeature documentation>
hasFeature :: (MonadDOM m) => DOMImplementation -> m Bool
hasFeature self = liftDOM (((self ^. jsf "hasFeature" ()) >>= valToBool))
-- | <https://developer.mozilla.org/docs/Web/API/DOMImplementation/hasFeature MDN DOMImplementation.hasFeature documentation>
hasFeature_ :: (MonadDOM m) => DOMImplementation -> m ()
hasFeature_ self = liftDOM (void (self ^. jsf "hasFeature" ()))