ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/PopStateEventInit.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from html (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.PopStateEventInit
(js_newPopStateEventInit, js_setState, js_getState, js_setHasUAVisualTransition, js_getHasUAVisualTransition, newPopStateEventInit, setState, getState, setHasUAVisualTransition, getHasUAVisualTransition, getHasUAVisualTransitionUnsafe, getHasUAVisualTransitionUnchecked, PopStateEventInit(..), gTypePopStateEventInit)
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_newPopStateEventInit :: IO PopStateEventInit
-- | <https://html.spec.whatwg.org/multipage/nav-history-apis.html#popstateeventinit PopStateEventInit specification>
newPopStateEventInit :: (MonadDOM m) => m PopStateEventInit
newPopStateEventInit = liftDOM ((js_newPopStateEventInit))
foreign import javascript safe "(($1, $2) => { $1[\"state\"] = $2; })"
js_setState :: PopStateEventInit -> JSVal -> IO ()
-- | <https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-popstateeventinit-state PopStateEventInit.state specification>
setState :: (MonadDOM m) => PopStateEventInit -> JSVal -> m ()
setState self val = liftDOM (void ((js_setState (self) (val))))
foreign import javascript unsafe "(($1) => { return $1[\"state\"]; })"
js_getState :: PopStateEventInit -> IO JSVal
-- | <https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-popstateeventinit-state PopStateEventInit.state specification>
getState :: (MonadDOM m) => PopStateEventInit -> m JSVal
getState self = liftDOM ((js_getState (self)))
foreign import javascript safe "(($1, $2) => { $1[\"hasUAVisualTransition\"] = $2; })"
js_setHasUAVisualTransition :: PopStateEventInit -> Bool -> IO ()
-- | <https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-popstateeventinit-hasuavisualtransition PopStateEventInit.hasUAVisualTransition specification>
setHasUAVisualTransition :: (MonadDOM m) => PopStateEventInit -> Bool -> m ()
setHasUAVisualTransition self val = liftDOM (void ((js_setHasUAVisualTransition (self) (val))))
foreign import javascript unsafe "(($1) => { return $1[\"hasUAVisualTransition\"]; })"
js_getHasUAVisualTransition :: PopStateEventInit -> IO JSVal
-- | <https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-popstateeventinit-hasuavisualtransition PopStateEventInit.hasUAVisualTransition specification>
getHasUAVisualTransition :: (MonadDOM m) => PopStateEventInit -> m (Maybe Bool)
getHasUAVisualTransition self = liftDOM (((js_getHasUAVisualTransition (self)) >>= fromJSValUnchecked))
-- | <https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-popstateeventinit-hasuavisualtransition PopStateEventInit.hasUAVisualTransition specification>
getHasUAVisualTransitionUnsafe :: (MonadDOM m, HasCallStack) => PopStateEventInit -> m Bool
getHasUAVisualTransitionUnsafe self = liftDOM ((((js_getHasUAVisualTransition (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-popstateeventinit-hasuavisualtransition PopStateEventInit.hasUAVisualTransition specification>
getHasUAVisualTransitionUnchecked :: (MonadDOM m) => PopStateEventInit -> m Bool
getHasUAVisualTransitionUnchecked self = liftDOM ((pFromJSVal <$> (js_getHasUAVisualTransition (self))))