ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/ElementCreationOptions.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.ElementCreationOptions
(js_newElementCreationOptions, js_setCustomElementRegistry, js_getCustomElementRegistry, js_setIs, js_getIs, newElementCreationOptions, setCustomElementRegistry, getCustomElementRegistry, getCustomElementRegistryUnsafe, getCustomElementRegistryUnchecked, setIs, getIs, getIsUnsafe, getIsUnchecked, ElementCreationOptions(..), gTypeElementCreationOptions)
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_newElementCreationOptions :: IO ElementCreationOptions
-- | <https://dom.spec.whatwg.org/#dictdef-elementcreationoptions ElementCreationOptions specification>
newElementCreationOptions :: (MonadDOM m) => m ElementCreationOptions
newElementCreationOptions = liftDOM ((js_newElementCreationOptions))
foreign import javascript safe "(($1, $2) => { $1[\"customElementRegistry\"] = $2; })"
js_setCustomElementRegistry :: ElementCreationOptions -> JSVal -> IO ()
-- | <https://dom.spec.whatwg.org/#dom-elementcreationoptions-customelementregistry ElementCreationOptions.customElementRegistry specification>
setCustomElementRegistry :: (MonadDOM m) => ElementCreationOptions -> Maybe CustomElementRegistry -> m ()
setCustomElementRegistry self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setCustomElementRegistry (self) a2')))
foreign import javascript unsafe "(($1) => { return $1[\"customElementRegistry\"]; })"
js_getCustomElementRegistry :: ElementCreationOptions -> IO JSVal
-- | <https://dom.spec.whatwg.org/#dom-elementcreationoptions-customelementregistry ElementCreationOptions.customElementRegistry specification>
getCustomElementRegistry :: (MonadDOM m) => ElementCreationOptions -> m (Maybe CustomElementRegistry)
getCustomElementRegistry self = liftDOM (((js_getCustomElementRegistry (self)) >>= fromJSValUnchecked))
-- | <https://dom.spec.whatwg.org/#dom-elementcreationoptions-customelementregistry ElementCreationOptions.customElementRegistry specification>
getCustomElementRegistryUnsafe :: (MonadDOM m, HasCallStack) => ElementCreationOptions -> m CustomElementRegistry
getCustomElementRegistryUnsafe self = liftDOM ((((js_getCustomElementRegistry (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://dom.spec.whatwg.org/#dom-elementcreationoptions-customelementregistry ElementCreationOptions.customElementRegistry specification>
getCustomElementRegistryUnchecked :: (MonadDOM m) => ElementCreationOptions -> m CustomElementRegistry
getCustomElementRegistryUnchecked self = liftDOM ((pFromJSVal <$> (js_getCustomElementRegistry (self))))
foreign import javascript safe "(($1, $2) => { $1[\"is\"] = $2; })"
js_setIs :: ElementCreationOptions -> JSString -> IO ()
-- | <https://dom.spec.whatwg.org/#dom-elementcreationoptions-is ElementCreationOptions.is specification>
setIs :: (MonadDOM m, ToJSString val) => ElementCreationOptions -> val -> m ()
setIs self val = liftDOM (void ((js_setIs (self) (toJSString val))))
foreign import javascript unsafe "(($1) => { return $1[\"is\"]; })"
js_getIs :: ElementCreationOptions -> IO JSVal
-- | <https://dom.spec.whatwg.org/#dom-elementcreationoptions-is ElementCreationOptions.is specification>
getIs :: (MonadDOM m, FromJSString result) => ElementCreationOptions -> m (Maybe result)
getIs self = liftDOM (((fromMaybeJSString . Nullable) <$> (js_getIs (self))))
-- | <https://dom.spec.whatwg.org/#dom-elementcreationoptions-is ElementCreationOptions.is specification>
getIsUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => ElementCreationOptions -> m result
getIsUnsafe self = liftDOM ((((fromMaybeJSString . Nullable) <$> (js_getIs (self))) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://dom.spec.whatwg.org/#dom-elementcreationoptions-is ElementCreationOptions.is specification>
getIsUnchecked :: (MonadDOM m, FromJSString result) => ElementCreationOptions -> m result
getIsUnchecked self = liftDOM ((pFromJSVal <$> (js_getIs (self))))