packages feed

jsaddle-dom-0.10.0.0: src/JSDOM/Generated/ShadowRootInit.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.ShadowRootInit
       (newShadowRootInit, setMode, getMode, setDelegatesFocus, getDelegatesFocus, getDelegatesFocusUnsafe, getDelegatesFocusUnchecked, setSerializable, getSerializable, getSerializableUnsafe, getSerializableUnchecked, setSlotAssignment, getSlotAssignment, getSlotAssignmentUnsafe, getSlotAssignmentUnchecked, setClonable, getClonable, getClonableUnsafe, getClonableUnchecked, setCustomElementRegistry, getCustomElementRegistry, getCustomElementRegistryUnsafe, getCustomElementRegistryUnchecked, ShadowRootInit(..), gTypeShadowRootInit)
       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://dom.spec.whatwg.org/#dictdef-shadowrootinit ShadowRootInit specification>
newShadowRootInit :: (MonadDOM m) => ShadowRootMode -> m ShadowRootInit
newShadowRootInit mode = liftDOM ((((new (jsg "Object") () >>= \o -> (o ^. jss "mode" (toJSVal mode)) P.>> P.return o)) >>= fromJSValUnchecked))

-- | <https://dom.spec.whatwg.org/#dom-shadowrootinit-mode ShadowRootInit.mode specification>
setMode :: (MonadDOM m) => ShadowRootInit -> ShadowRootMode -> m ()
setMode self val = liftDOM (void (self ^. jss "mode" (toJSVal val)))

-- | <https://dom.spec.whatwg.org/#dom-shadowrootinit-mode ShadowRootInit.mode specification>
getMode :: (MonadDOM m) => ShadowRootInit -> m ShadowRootMode
getMode self = liftDOM (((self ^. js "mode") >>= fromJSValUnchecked))

-- | <https://dom.spec.whatwg.org/#dom-shadowrootinit-delegatesfocus ShadowRootInit.delegatesFocus specification>
setDelegatesFocus :: (MonadDOM m) => ShadowRootInit -> Bool -> m ()
setDelegatesFocus self val = liftDOM (void (self ^. jss "delegatesFocus" (toJSVal val)))

-- | <https://dom.spec.whatwg.org/#dom-shadowrootinit-delegatesfocus ShadowRootInit.delegatesFocus specification>
getDelegatesFocus :: (MonadDOM m) => ShadowRootInit -> m (Maybe Bool)
getDelegatesFocus self = liftDOM (((self ^. js "delegatesFocus") >>= fromJSValUnchecked))

-- | <https://dom.spec.whatwg.org/#dom-shadowrootinit-delegatesfocus ShadowRootInit.delegatesFocus specification>
getDelegatesFocusUnsafe :: (MonadDOM m, HasCallStack) => ShadowRootInit -> m Bool
getDelegatesFocusUnsafe self = liftDOM ((((self ^. js "delegatesFocus") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://dom.spec.whatwg.org/#dom-shadowrootinit-delegatesfocus ShadowRootInit.delegatesFocus specification>
getDelegatesFocusUnchecked :: (MonadDOM m) => ShadowRootInit -> m Bool
getDelegatesFocusUnchecked self = liftDOM (((self ^. js "delegatesFocus") >>= valToBool))

-- | <https://dom.spec.whatwg.org/#dom-shadowrootinit-serializable ShadowRootInit.serializable specification>
setSerializable :: (MonadDOM m) => ShadowRootInit -> Bool -> m ()
setSerializable self val = liftDOM (void (self ^. jss "serializable" (toJSVal val)))

-- | <https://dom.spec.whatwg.org/#dom-shadowrootinit-serializable ShadowRootInit.serializable specification>
getSerializable :: (MonadDOM m) => ShadowRootInit -> m (Maybe Bool)
getSerializable self = liftDOM (((self ^. js "serializable") >>= fromJSValUnchecked))

-- | <https://dom.spec.whatwg.org/#dom-shadowrootinit-serializable ShadowRootInit.serializable specification>
getSerializableUnsafe :: (MonadDOM m, HasCallStack) => ShadowRootInit -> m Bool
getSerializableUnsafe self = liftDOM ((((self ^. js "serializable") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://dom.spec.whatwg.org/#dom-shadowrootinit-serializable ShadowRootInit.serializable specification>
getSerializableUnchecked :: (MonadDOM m) => ShadowRootInit -> m Bool
getSerializableUnchecked self = liftDOM (((self ^. js "serializable") >>= valToBool))

-- | <https://dom.spec.whatwg.org/#dom-shadowrootinit-slotassignment ShadowRootInit.slotAssignment specification>
setSlotAssignment :: (MonadDOM m) => ShadowRootInit -> SlotAssignmentMode -> m ()
setSlotAssignment self val = liftDOM (void (self ^. jss "slotAssignment" (toJSVal val)))

-- | <https://dom.spec.whatwg.org/#dom-shadowrootinit-slotassignment ShadowRootInit.slotAssignment specification>
getSlotAssignment :: (MonadDOM m) => ShadowRootInit -> m (Maybe SlotAssignmentMode)
getSlotAssignment self = liftDOM (((self ^. js "slotAssignment") >>= fromJSValUnchecked))

-- | <https://dom.spec.whatwg.org/#dom-shadowrootinit-slotassignment ShadowRootInit.slotAssignment specification>
getSlotAssignmentUnsafe :: (MonadDOM m, HasCallStack) => ShadowRootInit -> m SlotAssignmentMode
getSlotAssignmentUnsafe self = liftDOM ((((self ^. js "slotAssignment") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://dom.spec.whatwg.org/#dom-shadowrootinit-slotassignment ShadowRootInit.slotAssignment specification>
getSlotAssignmentUnchecked :: (MonadDOM m) => ShadowRootInit -> m SlotAssignmentMode
getSlotAssignmentUnchecked self = liftDOM (((self ^. js "slotAssignment") >>= fromJSValUnchecked))

-- | <https://dom.spec.whatwg.org/#dom-shadowrootinit-clonable ShadowRootInit.clonable specification>
setClonable :: (MonadDOM m) => ShadowRootInit -> Bool -> m ()
setClonable self val = liftDOM (void (self ^. jss "clonable" (toJSVal val)))

-- | <https://dom.spec.whatwg.org/#dom-shadowrootinit-clonable ShadowRootInit.clonable specification>
getClonable :: (MonadDOM m) => ShadowRootInit -> m (Maybe Bool)
getClonable self = liftDOM (((self ^. js "clonable") >>= fromJSValUnchecked))

-- | <https://dom.spec.whatwg.org/#dom-shadowrootinit-clonable ShadowRootInit.clonable specification>
getClonableUnsafe :: (MonadDOM m, HasCallStack) => ShadowRootInit -> m Bool
getClonableUnsafe self = liftDOM ((((self ^. js "clonable") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://dom.spec.whatwg.org/#dom-shadowrootinit-clonable ShadowRootInit.clonable specification>
getClonableUnchecked :: (MonadDOM m) => ShadowRootInit -> m Bool
getClonableUnchecked self = liftDOM (((self ^. js "clonable") >>= valToBool))

-- | <https://dom.spec.whatwg.org/#dom-shadowrootinit-customelementregistry ShadowRootInit.customElementRegistry specification>
setCustomElementRegistry :: (MonadDOM m) => ShadowRootInit -> Maybe CustomElementRegistry -> m ()
setCustomElementRegistry self val = liftDOM (void (self ^. jss "customElementRegistry" (toJSVal val)))

-- | <https://dom.spec.whatwg.org/#dom-shadowrootinit-customelementregistry ShadowRootInit.customElementRegistry specification>
getCustomElementRegistry :: (MonadDOM m) => ShadowRootInit -> m (Maybe CustomElementRegistry)
getCustomElementRegistry self = liftDOM (((self ^. js "customElementRegistry") >>= fromJSValUnchecked))

-- | <https://dom.spec.whatwg.org/#dom-shadowrootinit-customelementregistry ShadowRootInit.customElementRegistry specification>
getCustomElementRegistryUnsafe :: (MonadDOM m, HasCallStack) => ShadowRootInit -> m CustomElementRegistry
getCustomElementRegistryUnsafe self = liftDOM ((((self ^. js "customElementRegistry") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://dom.spec.whatwg.org/#dom-shadowrootinit-customelementregistry ShadowRootInit.customElementRegistry specification>
getCustomElementRegistryUnchecked :: (MonadDOM m) => ShadowRootInit -> m CustomElementRegistry
getCustomElementRegistryUnchecked self = liftDOM (((self ^. js "customElementRegistry") >>= fromJSValUnchecked))