jsaddle-dom-0.10.0.0: src/JSDOM/Generated/HTMLDialogElement.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from html (webref). Do not edit.
module JSDOM.Generated.HTMLDialogElement
(close, requestClose, show, showModal, setOpen, getOpen, setReturnValue, getReturnValue, setClosedBy, getClosedBy, HTMLDialogElement(..), gTypeHTMLDialogElement)
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/HTMLDialogElement/close MDN HTMLDialogElement.close documentation>
close :: (MonadDOM m, ToJSString returnValue) => HTMLDialogElement -> Maybe returnValue -> m ()
close self returnValue = liftDOM (void (self ^. jsf "close" [P.maybe (P.return jsUndefined) toJSVal returnValue]))
-- | <https://developer.mozilla.org/docs/Web/API/HTMLDialogElement/requestClose MDN HTMLDialogElement.requestClose documentation>
requestClose :: (MonadDOM m, ToJSString returnValue) => HTMLDialogElement -> Maybe returnValue -> m ()
requestClose self returnValue = liftDOM (void (self ^. jsf "requestClose" [P.maybe (P.return jsUndefined) toJSVal returnValue]))
-- | <https://developer.mozilla.org/docs/Web/API/HTMLDialogElement/show MDN HTMLDialogElement.show documentation>
show :: (MonadDOM m) => HTMLDialogElement -> m ()
show self = liftDOM (void (self ^. jsf "show" ()))
-- | <https://developer.mozilla.org/docs/Web/API/HTMLDialogElement/showModal MDN HTMLDialogElement.showModal documentation>
showModal :: (MonadDOM m) => HTMLDialogElement -> m ()
showModal self = liftDOM (void (self ^. jsf "showModal" ()))
-- | <https://developer.mozilla.org/docs/Web/API/HTMLDialogElement/open MDN HTMLDialogElement.open documentation>
setOpen :: (MonadDOM m) => HTMLDialogElement -> Bool -> m ()
setOpen self val = liftDOM (void (self ^. jss "open" (toJSVal val)))
-- | <https://developer.mozilla.org/docs/Web/API/HTMLDialogElement/open MDN HTMLDialogElement.open documentation>
getOpen :: (MonadDOM m) => HTMLDialogElement -> m Bool
getOpen self = liftDOM (((self ^. js "open") >>= valToBool))
-- | <https://developer.mozilla.org/docs/Web/API/HTMLDialogElement/returnValue MDN HTMLDialogElement.returnValue documentation>
setReturnValue :: (MonadDOM m, ToJSString val) => HTMLDialogElement -> val -> m ()
setReturnValue self val = liftDOM (void (self ^. jss "returnValue" (toJSVal val)))
-- | <https://developer.mozilla.org/docs/Web/API/HTMLDialogElement/returnValue MDN HTMLDialogElement.returnValue documentation>
getReturnValue :: (MonadDOM m, FromJSString result) => HTMLDialogElement -> m result
getReturnValue self = liftDOM (((self ^. js "returnValue") >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/HTMLDialogElement/closedBy MDN HTMLDialogElement.closedBy documentation>
setClosedBy :: (MonadDOM m, ToJSString val) => HTMLDialogElement -> val -> m ()
setClosedBy self val = liftDOM (void (self ^. jss "closedBy" (toJSVal val)))
-- | <https://developer.mozilla.org/docs/Web/API/HTMLDialogElement/closedBy MDN HTMLDialogElement.closedBy documentation>
getClosedBy :: (MonadDOM m, FromJSString result) => HTMLDialogElement -> m result
getClosedBy self = liftDOM (((self ^. js "closedBy") >>= fromJSValUnchecked))