ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/PropertyDefinition.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# 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 GHCJS.DOM.JSFFI.Generated.PropertyDefinition
(js_newPropertyDefinition, js_setName, js_getName, js_setSyntax, js_getSyntax, js_setInherits, js_getInherits, js_setInitialValue, js_getInitialValue, newPropertyDefinition, setName, getName, setSyntax, getSyntax, getSyntaxUnsafe, getSyntaxUnchecked, setInherits, getInherits, getInheritsUnsafe, getInheritsUnchecked, setInitialValue, getInitialValue, getInitialValueUnsafe, getInitialValueUnchecked, PropertyDefinition(..), gTypePropertyDefinition)
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) => { return ({\"name\": $1}); })"
js_newPropertyDefinition :: JSString -> IO PropertyDefinition
-- | <https://drafts.css-houdini.org/css-properties-values-api-1/#dictdef-propertydefinition PropertyDefinition specification>
newPropertyDefinition :: (MonadDOM m, ToJSString name) => name -> m PropertyDefinition
newPropertyDefinition name = liftDOM ((js_newPropertyDefinition (toJSString name)))
foreign import javascript safe "(($1, $2) => { $1[\"name\"] = $2; })"
js_setName :: PropertyDefinition -> JSString -> IO ()
-- | <https://drafts.css-houdini.org/css-properties-values-api-1/#dom-propertydefinition-name PropertyDefinition.name specification>
setName :: (MonadDOM m, ToJSString val) => PropertyDefinition -> val -> m ()
setName self val = liftDOM (void ((js_setName (self) (toJSString val))))
foreign import javascript unsafe "(($1) => { return $1[\"name\"]; })"
js_getName :: PropertyDefinition -> IO JSString
-- | <https://drafts.css-houdini.org/css-properties-values-api-1/#dom-propertydefinition-name PropertyDefinition.name specification>
getName :: (MonadDOM m, FromJSString result) => PropertyDefinition -> m result
getName self = liftDOM ((fromJSString <$> (js_getName (self))))
foreign import javascript safe "(($1, $2) => { $1[\"syntax\"] = $2; })"
js_setSyntax :: PropertyDefinition -> JSString -> IO ()
-- | <https://drafts.css-houdini.org/css-properties-values-api-1/#dom-propertydefinition-syntax PropertyDefinition.syntax specification>
setSyntax :: (MonadDOM m, ToJSString val) => PropertyDefinition -> val -> m ()
setSyntax self val = liftDOM (void ((js_setSyntax (self) (toJSString val))))
foreign import javascript unsafe "(($1) => { return $1[\"syntax\"]; })"
js_getSyntax :: PropertyDefinition -> IO JSVal
-- | <https://drafts.css-houdini.org/css-properties-values-api-1/#dom-propertydefinition-syntax PropertyDefinition.syntax specification>
getSyntax :: (MonadDOM m, FromJSString result) => PropertyDefinition -> m (Maybe result)
getSyntax self = liftDOM (((fromMaybeJSString . Nullable) <$> (js_getSyntax (self))))
-- | <https://drafts.css-houdini.org/css-properties-values-api-1/#dom-propertydefinition-syntax PropertyDefinition.syntax specification>
getSyntaxUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => PropertyDefinition -> m result
getSyntaxUnsafe self = liftDOM ((((fromMaybeJSString . Nullable) <$> (js_getSyntax (self))) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://drafts.css-houdini.org/css-properties-values-api-1/#dom-propertydefinition-syntax PropertyDefinition.syntax specification>
getSyntaxUnchecked :: (MonadDOM m, FromJSString result) => PropertyDefinition -> m result
getSyntaxUnchecked self = liftDOM ((pFromJSVal <$> (js_getSyntax (self))))
foreign import javascript safe "(($1, $2) => { $1[\"inherits\"] = $2; })"
js_setInherits :: PropertyDefinition -> Bool -> IO ()
-- | <https://drafts.css-houdini.org/css-properties-values-api-1/#dom-propertydefinition-inherits PropertyDefinition.inherits specification>
setInherits :: (MonadDOM m) => PropertyDefinition -> Bool -> m ()
setInherits self val = liftDOM (void ((js_setInherits (self) (val))))
foreign import javascript unsafe "(($1) => { return $1[\"inherits\"]; })"
js_getInherits :: PropertyDefinition -> IO JSVal
-- | <https://drafts.css-houdini.org/css-properties-values-api-1/#dom-propertydefinition-inherits PropertyDefinition.inherits specification>
getInherits :: (MonadDOM m) => PropertyDefinition -> m (Maybe Bool)
getInherits self = liftDOM (((js_getInherits (self)) >>= fromJSValUnchecked))
-- | <https://drafts.css-houdini.org/css-properties-values-api-1/#dom-propertydefinition-inherits PropertyDefinition.inherits specification>
getInheritsUnsafe :: (MonadDOM m, HasCallStack) => PropertyDefinition -> m Bool
getInheritsUnsafe self = liftDOM ((((js_getInherits (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://drafts.css-houdini.org/css-properties-values-api-1/#dom-propertydefinition-inherits PropertyDefinition.inherits specification>
getInheritsUnchecked :: (MonadDOM m) => PropertyDefinition -> m Bool
getInheritsUnchecked self = liftDOM ((pFromJSVal <$> (js_getInherits (self))))
foreign import javascript safe "(($1, $2) => { $1[\"initialValue\"] = $2; })"
js_setInitialValue :: PropertyDefinition -> JSString -> IO ()
-- | <https://drafts.css-houdini.org/css-properties-values-api-1/#dom-propertydefinition-initialvalue PropertyDefinition.initialValue specification>
setInitialValue :: (MonadDOM m, ToJSString val) => PropertyDefinition -> val -> m ()
setInitialValue self val = liftDOM (void ((js_setInitialValue (self) (toJSString val))))
foreign import javascript unsafe "(($1) => { return $1[\"initialValue\"]; })"
js_getInitialValue :: PropertyDefinition -> IO JSVal
-- | <https://drafts.css-houdini.org/css-properties-values-api-1/#dom-propertydefinition-initialvalue PropertyDefinition.initialValue specification>
getInitialValue :: (MonadDOM m, FromJSString result) => PropertyDefinition -> m (Maybe result)
getInitialValue self = liftDOM (((fromMaybeJSString . Nullable) <$> (js_getInitialValue (self))))
-- | <https://drafts.css-houdini.org/css-properties-values-api-1/#dom-propertydefinition-initialvalue PropertyDefinition.initialValue specification>
getInitialValueUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => PropertyDefinition -> m result
getInitialValueUnsafe self = liftDOM ((((fromMaybeJSString . Nullable) <$> (js_getInitialValue (self))) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://drafts.css-houdini.org/css-properties-values-api-1/#dom-propertydefinition-initialvalue PropertyDefinition.initialValue specification>
getInitialValueUnchecked :: (MonadDOM m, FromJSString result) => PropertyDefinition -> m result
getInitialValueUnchecked self = liftDOM ((pFromJSVal <$> (js_getInitialValue (self))))