ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/ScrollIntoViewOptions.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from cssom-view-1 (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.ScrollIntoViewOptions
(js_newScrollIntoViewOptions, js_setBlock, js_getBlock, js_setInline, js_getInline, js_setContainer, js_getContainer, newScrollIntoViewOptions, setBlock, getBlock, getBlockUnsafe, getBlockUnchecked, setInline, getInline, getInlineUnsafe, getInlineUnchecked, setContainer, getContainer, getContainerUnsafe, getContainerUnchecked, ScrollIntoViewOptions(..), gTypeScrollIntoViewOptions)
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 "(() => { return ({}); })"
js_newScrollIntoViewOptions :: IO ScrollIntoViewOptions
-- | <https://drafts.csswg.org/cssom-view-1/#dictdef-scrollintoviewoptions ScrollIntoViewOptions specification>
newScrollIntoViewOptions :: (MonadDOM m) => m ScrollIntoViewOptions
newScrollIntoViewOptions = liftDOM ((js_newScrollIntoViewOptions))
foreign import javascript safe "(($1, $2) => { $1[\"block\"] = $2; })"
js_setBlock :: ScrollIntoViewOptions -> JSVal -> IO ()
-- | <https://drafts.csswg.org/cssom-view-1/#dom-scrollintoviewoptions-block ScrollIntoViewOptions.block specification>
setBlock :: (MonadDOM m) => ScrollIntoViewOptions -> ScrollLogicalPosition -> m ()
setBlock self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setBlock (self) a2')))
foreign import javascript unsafe "(($1) => { return $1[\"block\"]; })"
js_getBlock :: ScrollIntoViewOptions -> IO JSVal
-- | <https://drafts.csswg.org/cssom-view-1/#dom-scrollintoviewoptions-block ScrollIntoViewOptions.block specification>
getBlock :: (MonadDOM m) => ScrollIntoViewOptions -> m (Maybe ScrollLogicalPosition)
getBlock self = liftDOM (((js_getBlock (self)) >>= fromJSValUnchecked))
-- | <https://drafts.csswg.org/cssom-view-1/#dom-scrollintoviewoptions-block ScrollIntoViewOptions.block specification>
getBlockUnsafe :: (MonadDOM m, HasCallStack) => ScrollIntoViewOptions -> m ScrollLogicalPosition
getBlockUnsafe self = liftDOM ((((js_getBlock (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://drafts.csswg.org/cssom-view-1/#dom-scrollintoviewoptions-block ScrollIntoViewOptions.block specification>
getBlockUnchecked :: (MonadDOM m) => ScrollIntoViewOptions -> m ScrollLogicalPosition
getBlockUnchecked self = liftDOM ((pFromJSVal <$> (js_getBlock (self))))
foreign import javascript safe "(($1, $2) => { $1[\"inline\"] = $2; })"
js_setInline :: ScrollIntoViewOptions -> JSVal -> IO ()
-- | <https://drafts.csswg.org/cssom-view-1/#dom-scrollintoviewoptions-inline ScrollIntoViewOptions.inline specification>
setInline :: (MonadDOM m) => ScrollIntoViewOptions -> ScrollLogicalPosition -> m ()
setInline self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setInline (self) a2')))
foreign import javascript unsafe "(($1) => { return $1[\"inline\"]; })"
js_getInline :: ScrollIntoViewOptions -> IO JSVal
-- | <https://drafts.csswg.org/cssom-view-1/#dom-scrollintoviewoptions-inline ScrollIntoViewOptions.inline specification>
getInline :: (MonadDOM m) => ScrollIntoViewOptions -> m (Maybe ScrollLogicalPosition)
getInline self = liftDOM (((js_getInline (self)) >>= fromJSValUnchecked))
-- | <https://drafts.csswg.org/cssom-view-1/#dom-scrollintoviewoptions-inline ScrollIntoViewOptions.inline specification>
getInlineUnsafe :: (MonadDOM m, HasCallStack) => ScrollIntoViewOptions -> m ScrollLogicalPosition
getInlineUnsafe self = liftDOM ((((js_getInline (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://drafts.csswg.org/cssom-view-1/#dom-scrollintoviewoptions-inline ScrollIntoViewOptions.inline specification>
getInlineUnchecked :: (MonadDOM m) => ScrollIntoViewOptions -> m ScrollLogicalPosition
getInlineUnchecked self = liftDOM ((pFromJSVal <$> (js_getInline (self))))
foreign import javascript safe "(($1, $2) => { $1[\"container\"] = $2; })"
js_setContainer :: ScrollIntoViewOptions -> JSVal -> IO ()
-- | <https://drafts.csswg.org/cssom-view-1/#dom-scrollintoviewoptions-container ScrollIntoViewOptions.container specification>
setContainer :: (MonadDOM m) => ScrollIntoViewOptions -> ScrollIntoViewContainer -> m ()
setContainer self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setContainer (self) a2')))
foreign import javascript unsafe "(($1) => { return $1[\"container\"]; })"
js_getContainer :: ScrollIntoViewOptions -> IO JSVal
-- | <https://drafts.csswg.org/cssom-view-1/#dom-scrollintoviewoptions-container ScrollIntoViewOptions.container specification>
getContainer :: (MonadDOM m) => ScrollIntoViewOptions -> m (Maybe ScrollIntoViewContainer)
getContainer self = liftDOM (((js_getContainer (self)) >>= fromJSValUnchecked))
-- | <https://drafts.csswg.org/cssom-view-1/#dom-scrollintoviewoptions-container ScrollIntoViewOptions.container specification>
getContainerUnsafe :: (MonadDOM m, HasCallStack) => ScrollIntoViewOptions -> m ScrollIntoViewContainer
getContainerUnsafe self = liftDOM ((((js_getContainer (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://drafts.csswg.org/cssom-view-1/#dom-scrollintoviewoptions-container ScrollIntoViewOptions.container specification>
getContainerUnchecked :: (MonadDOM m) => ScrollIntoViewOptions -> m ScrollIntoViewContainer
getContainerUnchecked self = liftDOM ((pFromJSVal <$> (js_getContainer (self))))