packages feed

ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/ShowPopoverOptions.hs

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from html (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.ShowPopoverOptions
       (js_newShowPopoverOptions, js_setSource, js_getSource, newShowPopoverOptions, setSource, getSource, getSourceUnsafe, getSourceUnchecked, ShowPopoverOptions(..), gTypeShowPopoverOptions, IsShowPopoverOptions, toShowPopoverOptions)
       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 "(() => { return ({}); })"
        js_newShowPopoverOptions :: IO ShowPopoverOptions
-- | <https://html.spec.whatwg.org/multipage/dom.html#showpopoveroptions ShowPopoverOptions specification>
newShowPopoverOptions :: (MonadDOM m) => m ShowPopoverOptions
newShowPopoverOptions = liftDOM ((js_newShowPopoverOptions))

foreign import javascript safe "(($1, $2) => { $1[\"source\"] = $2; })"
        js_setSource :: ShowPopoverOptions -> HTMLElement -> IO ()
-- | <https://html.spec.whatwg.org/multipage/dom.html#dom-showpopoveroptions-source ShowPopoverOptions.source specification>
setSource :: (MonadDOM m, IsShowPopoverOptions self, IsHTMLElement val) => self -> val -> m ()
setSource self val = liftDOM (void ((js_setSource ((Types.toShowPopoverOptions self)) (Types.toHTMLElement val))))

foreign import javascript unsafe "(($1) => { return $1[\"source\"]; })"
        js_getSource :: ShowPopoverOptions -> IO JSVal
-- | <https://html.spec.whatwg.org/multipage/dom.html#dom-showpopoveroptions-source ShowPopoverOptions.source specification>
getSource :: (MonadDOM m, IsShowPopoverOptions self) => self -> m (Maybe HTMLElement)
getSource self = liftDOM (((js_getSource ((Types.toShowPopoverOptions self))) >>= fromJSValUnchecked))

-- | <https://html.spec.whatwg.org/multipage/dom.html#dom-showpopoveroptions-source ShowPopoverOptions.source specification>
getSourceUnsafe :: (MonadDOM m, IsShowPopoverOptions self, HasCallStack) => self -> m HTMLElement
getSourceUnsafe self = liftDOM ((((js_getSource ((Types.toShowPopoverOptions self))) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://html.spec.whatwg.org/multipage/dom.html#dom-showpopoveroptions-source ShowPopoverOptions.source specification>
getSourceUnchecked :: (MonadDOM m, IsShowPopoverOptions self) => self -> m HTMLElement
getSourceUnchecked self = liftDOM ((pFromJSVal <$> (js_getSource ((Types.toShowPopoverOptions self)))))