jsaddle-dom-0.10.0.0: src/JSDOM/Generated/CSSStyleDeclaration.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from cssom-1 (webref). Do not edit.
module JSDOM.Generated.CSSStyleDeclaration
(getPropertyPriority, getPropertyPriority_, getPropertyValue, getPropertyValue_, item, item_, removeProperty, removeProperty_, setProperty, setCssText, getCssText, getLength, getParentRule, getParentRuleUnsafe, getParentRuleUnchecked, CSSStyleDeclaration(..), gTypeCSSStyleDeclaration, IsCSSStyleDeclaration, toCSSStyleDeclaration)
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/CSSStyleDeclaration/getPropertyPriority MDN CSSStyleDeclaration.getPropertyPriority documentation>
getPropertyPriority :: (MonadDOM m, IsCSSStyleDeclaration self, ToJSString property, FromJSString result) => self -> property -> m result
getPropertyPriority self property = liftDOM ((((Types.toCSSStyleDeclaration self) ^. jsf "getPropertyPriority" [toJSVal property]) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/getPropertyPriority MDN CSSStyleDeclaration.getPropertyPriority documentation>
getPropertyPriority_ :: (MonadDOM m, IsCSSStyleDeclaration self, ToJSString property) => self -> property -> m ()
getPropertyPriority_ self property = liftDOM (void ((Types.toCSSStyleDeclaration self) ^. jsf "getPropertyPriority" [toJSVal property]))
-- | <https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/getPropertyValue MDN CSSStyleDeclaration.getPropertyValue documentation>
getPropertyValue :: (MonadDOM m, IsCSSStyleDeclaration self, ToJSString property, FromJSString result) => self -> property -> m result
getPropertyValue self property = liftDOM ((((Types.toCSSStyleDeclaration self) ^. jsf "getPropertyValue" [toJSVal property]) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/getPropertyValue MDN CSSStyleDeclaration.getPropertyValue documentation>
getPropertyValue_ :: (MonadDOM m, IsCSSStyleDeclaration self, ToJSString property) => self -> property -> m ()
getPropertyValue_ self property = liftDOM (void ((Types.toCSSStyleDeclaration self) ^. jsf "getPropertyValue" [toJSVal property]))
-- | <https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/item MDN CSSStyleDeclaration.item documentation>
item :: (MonadDOM m, IsCSSStyleDeclaration self, FromJSString result) => self -> Word -> m result
item self index = liftDOM ((((Types.toCSSStyleDeclaration self) ^. jsf "item" [toJSVal index]) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/item MDN CSSStyleDeclaration.item documentation>
item_ :: (MonadDOM m, IsCSSStyleDeclaration self) => self -> Word -> m ()
item_ self index = liftDOM (void ((Types.toCSSStyleDeclaration self) ^. jsf "item" [toJSVal index]))
-- | <https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/removeProperty MDN CSSStyleDeclaration.removeProperty documentation>
removeProperty :: (MonadDOM m, IsCSSStyleDeclaration self, ToJSString property, FromJSString result) => self -> property -> m result
removeProperty self property = liftDOM ((((Types.toCSSStyleDeclaration self) ^. jsf "removeProperty" [toJSVal property]) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/removeProperty MDN CSSStyleDeclaration.removeProperty documentation>
removeProperty_ :: (MonadDOM m, IsCSSStyleDeclaration self, ToJSString property) => self -> property -> m ()
removeProperty_ self property = liftDOM (void ((Types.toCSSStyleDeclaration self) ^. jsf "removeProperty" [toJSVal property]))
-- | <https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/setProperty MDN CSSStyleDeclaration.setProperty documentation>
setProperty :: (MonadDOM m, IsCSSStyleDeclaration self, ToJSString property, ToJSString value, ToJSString priority) => self -> property -> value -> Maybe priority -> m ()
setProperty self property value priority = liftDOM (void ((Types.toCSSStyleDeclaration self) ^. jsf "setProperty" [toJSVal property, toJSVal value, P.maybe (P.return jsUndefined) toJSVal priority]))
-- | <https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/cssText MDN CSSStyleDeclaration.cssText documentation>
setCssText :: (MonadDOM m, IsCSSStyleDeclaration self, ToJSString val) => self -> val -> m ()
setCssText self val = liftDOM (void ((Types.toCSSStyleDeclaration self) ^. jss "cssText" (toJSVal val)))
-- | <https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/cssText MDN CSSStyleDeclaration.cssText documentation>
getCssText :: (MonadDOM m, IsCSSStyleDeclaration self, FromJSString result) => self -> m result
getCssText self = liftDOM ((((Types.toCSSStyleDeclaration self) ^. js "cssText") >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/length MDN CSSStyleDeclaration.length documentation>
getLength :: (MonadDOM m, IsCSSStyleDeclaration self) => self -> m Word
getLength self = liftDOM ((P.round <$> (((Types.toCSSStyleDeclaration self) ^. js "length") >>= valToNumber)))
-- | <https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/parentRule MDN CSSStyleDeclaration.parentRule documentation>
getParentRule :: (MonadDOM m, IsCSSStyleDeclaration self) => self -> m (Maybe CSSRule)
getParentRule self = liftDOM ((((Types.toCSSStyleDeclaration self) ^. js "parentRule") >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/parentRule MDN CSSStyleDeclaration.parentRule documentation>
getParentRuleUnsafe :: (MonadDOM m, IsCSSStyleDeclaration self, HasCallStack) => self -> m CSSRule
getParentRuleUnsafe self = liftDOM (((((Types.toCSSStyleDeclaration self) ^. js "parentRule") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/parentRule MDN CSSStyleDeclaration.parentRule documentation>
getParentRuleUnchecked :: (MonadDOM m, IsCSSStyleDeclaration self) => self -> m CSSRule
getParentRuleUnchecked self = liftDOM ((((Types.toCSSStyleDeclaration self) ^. js "parentRule") >>= fromJSValUnchecked))