packages feed

jsaddle-dom-0.10.0.0: src/JSDOM/Generated/CSSPropertyRule.hs

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from css-properties-values-api-1 (webref). Do not edit.
module JSDOM.Generated.CSSPropertyRule
       (getName, getSyntax, getInherits, getInitialValue, getInitialValueUnsafe, getInitialValueUnchecked, CSSPropertyRule(..), gTypeCSSPropertyRule)
       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/CSSPropertyRule/name MDN CSSPropertyRule.name documentation>
getName :: (MonadDOM m, FromJSString result) => CSSPropertyRule -> m result
getName self = liftDOM (((self ^. js "name") >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/CSSPropertyRule/syntax MDN CSSPropertyRule.syntax documentation>
getSyntax :: (MonadDOM m, FromJSString result) => CSSPropertyRule -> m result
getSyntax self = liftDOM (((self ^. js "syntax") >>= fromJSValUnchecked))

-- | <https://developer.mozilla.org/docs/Web/API/CSSPropertyRule/inherits MDN CSSPropertyRule.inherits documentation>
getInherits :: (MonadDOM m) => CSSPropertyRule -> m Bool
getInherits self = liftDOM (((self ^. js "inherits") >>= valToBool))

-- | <https://developer.mozilla.org/docs/Web/API/CSSPropertyRule/initialValue MDN CSSPropertyRule.initialValue documentation>
getInitialValue :: (MonadDOM m, FromJSString result) => CSSPropertyRule -> m (Maybe result)
getInitialValue self = liftDOM (((self ^. js "initialValue") >>= fromMaybeJSString))

-- | <https://developer.mozilla.org/docs/Web/API/CSSPropertyRule/initialValue MDN CSSPropertyRule.initialValue documentation>
getInitialValueUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => CSSPropertyRule -> m result
getInitialValueUnsafe self = liftDOM ((((self ^. js "initialValue") >>= fromMaybeJSString) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://developer.mozilla.org/docs/Web/API/CSSPropertyRule/initialValue MDN CSSPropertyRule.initialValue documentation>
getInitialValueUnchecked :: (MonadDOM m, FromJSString result) => CSSPropertyRule -> m result
getInitialValueUnchecked self = liftDOM (((self ^. js "initialValue") >>= fromJSValUnchecked))