jsaddle-dom-0.10.0.0: src/JSDOM/Generated/HTMLOutputElement.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.HTMLOutputElement
(checkValidity, checkValidity_, reportValidity, reportValidity_, setCustomValidity, getHtmlFor, getForm, getFormUnsafe, getFormUnchecked, setName, getName, getType, setDefaultValue, getDefaultValue, setValue, getValue, getWillValidate, getValidity, getValidationMessage, getLabels, HTMLOutputElement(..), gTypeHTMLOutputElement)
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/HTMLOutputElement/checkValidity MDN HTMLOutputElement.checkValidity documentation>
checkValidity :: (MonadDOM m) => HTMLOutputElement -> m Bool
checkValidity self = liftDOM (((self ^. jsf "checkValidity" ()) >>= valToBool))
-- | <https://developer.mozilla.org/docs/Web/API/HTMLOutputElement/checkValidity MDN HTMLOutputElement.checkValidity documentation>
checkValidity_ :: (MonadDOM m) => HTMLOutputElement -> m ()
checkValidity_ self = liftDOM (void (self ^. jsf "checkValidity" ()))
-- | <https://developer.mozilla.org/docs/Web/API/HTMLOutputElement/reportValidity MDN HTMLOutputElement.reportValidity documentation>
reportValidity :: (MonadDOM m) => HTMLOutputElement -> m Bool
reportValidity self = liftDOM (((self ^. jsf "reportValidity" ()) >>= valToBool))
-- | <https://developer.mozilla.org/docs/Web/API/HTMLOutputElement/reportValidity MDN HTMLOutputElement.reportValidity documentation>
reportValidity_ :: (MonadDOM m) => HTMLOutputElement -> m ()
reportValidity_ self = liftDOM (void (self ^. jsf "reportValidity" ()))
-- | <https://developer.mozilla.org/docs/Web/API/HTMLOutputElement/setCustomValidity MDN HTMLOutputElement.setCustomValidity documentation>
setCustomValidity :: (MonadDOM m, ToJSString error) => HTMLOutputElement -> error -> m ()
setCustomValidity self error = liftDOM (void (self ^. jsf "setCustomValidity" [toJSVal error]))
-- | <https://developer.mozilla.org/docs/Web/API/HTMLOutputElement/htmlFor MDN HTMLOutputElement.htmlFor documentation>
getHtmlFor :: (MonadDOM m) => HTMLOutputElement -> m DOMTokenList
getHtmlFor self = liftDOM (((self ^. js "htmlFor") >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/HTMLOutputElement/form MDN HTMLOutputElement.form documentation>
getForm :: (MonadDOM m) => HTMLOutputElement -> m (Maybe HTMLFormElement)
getForm self = liftDOM (((self ^. js "form") >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/HTMLOutputElement/form MDN HTMLOutputElement.form documentation>
getFormUnsafe :: (MonadDOM m, HasCallStack) => HTMLOutputElement -> m HTMLFormElement
getFormUnsafe self = liftDOM ((((self ^. js "form") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://developer.mozilla.org/docs/Web/API/HTMLOutputElement/form MDN HTMLOutputElement.form documentation>
getFormUnchecked :: (MonadDOM m) => HTMLOutputElement -> m HTMLFormElement
getFormUnchecked self = liftDOM (((self ^. js "form") >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/HTMLOutputElement/name MDN HTMLOutputElement.name documentation>
setName :: (MonadDOM m, ToJSString val) => HTMLOutputElement -> val -> m ()
setName self val = liftDOM (void (self ^. jss "name" (toJSVal val)))
-- | <https://developer.mozilla.org/docs/Web/API/HTMLOutputElement/name MDN HTMLOutputElement.name documentation>
getName :: (MonadDOM m, FromJSString result) => HTMLOutputElement -> m result
getName self = liftDOM (((self ^. js "name") >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/HTMLOutputElement/type MDN HTMLOutputElement.type documentation>
getType :: (MonadDOM m, FromJSString result) => HTMLOutputElement -> m result
getType self = liftDOM (((self ^. js "type") >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/HTMLOutputElement/defaultValue MDN HTMLOutputElement.defaultValue documentation>
setDefaultValue :: (MonadDOM m, ToJSString val) => HTMLOutputElement -> val -> m ()
setDefaultValue self val = liftDOM (void (self ^. jss "defaultValue" (toJSVal val)))
-- | <https://developer.mozilla.org/docs/Web/API/HTMLOutputElement/defaultValue MDN HTMLOutputElement.defaultValue documentation>
getDefaultValue :: (MonadDOM m, FromJSString result) => HTMLOutputElement -> m result
getDefaultValue self = liftDOM (((self ^. js "defaultValue") >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/HTMLOutputElement/value MDN HTMLOutputElement.value documentation>
setValue :: (MonadDOM m, ToJSString val) => HTMLOutputElement -> val -> m ()
setValue self val = liftDOM (void (self ^. jss "value" (toJSVal val)))
-- | <https://developer.mozilla.org/docs/Web/API/HTMLOutputElement/value MDN HTMLOutputElement.value documentation>
getValue :: (MonadDOM m, FromJSString result) => HTMLOutputElement -> m result
getValue self = liftDOM (((self ^. js "value") >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/HTMLOutputElement/willValidate MDN HTMLOutputElement.willValidate documentation>
getWillValidate :: (MonadDOM m) => HTMLOutputElement -> m Bool
getWillValidate self = liftDOM (((self ^. js "willValidate") >>= valToBool))
-- | <https://developer.mozilla.org/docs/Web/API/HTMLOutputElement/validity MDN HTMLOutputElement.validity documentation>
getValidity :: (MonadDOM m) => HTMLOutputElement -> m ValidityState
getValidity self = liftDOM (((self ^. js "validity") >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/HTMLOutputElement/validationMessage MDN HTMLOutputElement.validationMessage documentation>
getValidationMessage :: (MonadDOM m, FromJSString result) => HTMLOutputElement -> m result
getValidationMessage self = liftDOM (((self ^. js "validationMessage") >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/HTMLOutputElement/labels MDN HTMLOutputElement.labels documentation>
getLabels :: (MonadDOM m) => HTMLOutputElement -> m NodeList
getLabels self = liftDOM (((self ^. js "labels") >>= fromJSValUnchecked))