packages feed

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

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from cssom-1 (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.CSSStyleDeclaration
       (js_getPropertyPriority, js_getPropertyValue, js_item, js_removeProperty, js_setProperty, js_setCssText, js_getCssText, js_getLength, js_getParentRule, 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 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 "(($1, $2) => { return $1[\"getPropertyPriority\"]($2); })"
        js_getPropertyPriority :: CSSStyleDeclaration -> JSString -> IO JSString
-- | <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 ((fromJSString <$> (js_getPropertyPriority ((Types.toCSSStyleDeclaration self)) (toJSString property))))

-- | <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 ((js_getPropertyPriority ((Types.toCSSStyleDeclaration self)) (toJSString property))))

foreign import javascript safe "(($1, $2) => { return $1[\"getPropertyValue\"]($2); })"
        js_getPropertyValue :: CSSStyleDeclaration -> JSString -> IO JSString
-- | <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 ((fromJSString <$> (js_getPropertyValue ((Types.toCSSStyleDeclaration self)) (toJSString property))))

-- | <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 ((js_getPropertyValue ((Types.toCSSStyleDeclaration self)) (toJSString property))))

foreign import javascript safe "(($1, $2) => { return $1[\"item\"]($2); })"
        js_item :: CSSStyleDeclaration -> Word -> IO JSString
-- | <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 ((fromJSString <$> (js_item ((Types.toCSSStyleDeclaration self)) (index))))

-- | <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 ((js_item ((Types.toCSSStyleDeclaration self)) (index))))

foreign import javascript safe "(($1, $2) => { return $1[\"removeProperty\"]($2); })"
        js_removeProperty :: CSSStyleDeclaration -> JSString -> IO JSString
-- | <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 ((fromJSString <$> (js_removeProperty ((Types.toCSSStyleDeclaration self)) (toJSString property))))

-- | <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 ((js_removeProperty ((Types.toCSSStyleDeclaration self)) (toJSString property))))

foreign import javascript safe "(($1, $2, $3, $4) => { return $1[\"setProperty\"]($2, $3, $4); })"
        js_setProperty :: CSSStyleDeclaration -> JSString -> JSString -> (Optional JSString) -> IO ()
-- | <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 ((js_setProperty ((Types.toCSSStyleDeclaration self)) (toJSString property) (toJSString value) (toOptionalJSString priority))))

foreign import javascript safe "(($1, $2) => { $1[\"cssText\"] = $2; })"
        js_setCssText :: CSSStyleDeclaration -> JSString -> IO ()
-- | <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 ((js_setCssText ((Types.toCSSStyleDeclaration self)) (toJSString val))))

foreign import javascript unsafe "(($1) => { return $1[\"cssText\"]; })"
        js_getCssText :: CSSStyleDeclaration -> IO JSString
-- | <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 ((fromJSString <$> (js_getCssText ((Types.toCSSStyleDeclaration self)))))

foreign import javascript unsafe "(($1) => { return $1[\"length\"]; })"
        js_getLength :: CSSStyleDeclaration -> IO Word
-- | <https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/length MDN CSSStyleDeclaration.length documentation>
getLength :: (MonadDOM m, IsCSSStyleDeclaration self) => self -> m Word
getLength self = liftDOM ((js_getLength ((Types.toCSSStyleDeclaration self))))

foreign import javascript unsafe "(($1) => { return $1[\"parentRule\"]; })"
        js_getParentRule :: CSSStyleDeclaration -> IO JSVal
-- | <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 (((js_getParentRule ((Types.toCSSStyleDeclaration self))) >>= 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 ((((js_getParentRule ((Types.toCSSStyleDeclaration self))) >>= 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 ((pFromJSVal <$> (js_getParentRule ((Types.toCSSStyleDeclaration self)))))