ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/CookieStoreGetOptions.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from cookiestore (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.CookieStoreGetOptions
(js_newCookieStoreGetOptions, js_setName, js_getName, js_setUrl, js_getUrl, newCookieStoreGetOptions, setName, getName, getNameUnsafe, getNameUnchecked, setUrl, getUrl, getUrlUnsafe, getUrlUnchecked, CookieStoreGetOptions(..), gTypeCookieStoreGetOptions)
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_newCookieStoreGetOptions :: IO CookieStoreGetOptions
-- | <https://cookiestore.spec.whatwg.org/#dictdef-cookiestoregetoptions CookieStoreGetOptions specification>
newCookieStoreGetOptions :: (MonadDOM m) => m CookieStoreGetOptions
newCookieStoreGetOptions = liftDOM ((js_newCookieStoreGetOptions))
foreign import javascript safe "(($1, $2) => { $1[\"name\"] = $2; })"
js_setName :: CookieStoreGetOptions -> JSString -> IO ()
-- | <https://cookiestore.spec.whatwg.org/#dom-cookiestoregetoptions-name CookieStoreGetOptions.name specification>
setName :: (MonadDOM m, ToJSString val) => CookieStoreGetOptions -> val -> m ()
setName self val = liftDOM (void ((js_setName (self) (toJSString val))))
foreign import javascript unsafe "(($1) => { return $1[\"name\"]; })"
js_getName :: CookieStoreGetOptions -> IO JSVal
-- | <https://cookiestore.spec.whatwg.org/#dom-cookiestoregetoptions-name CookieStoreGetOptions.name specification>
getName :: (MonadDOM m, FromJSString result) => CookieStoreGetOptions -> m (Maybe result)
getName self = liftDOM (((fromMaybeJSString . Nullable) <$> (js_getName (self))))
-- | <https://cookiestore.spec.whatwg.org/#dom-cookiestoregetoptions-name CookieStoreGetOptions.name specification>
getNameUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => CookieStoreGetOptions -> m result
getNameUnsafe self = liftDOM ((((fromMaybeJSString . Nullable) <$> (js_getName (self))) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://cookiestore.spec.whatwg.org/#dom-cookiestoregetoptions-name CookieStoreGetOptions.name specification>
getNameUnchecked :: (MonadDOM m, FromJSString result) => CookieStoreGetOptions -> m result
getNameUnchecked self = liftDOM ((pFromJSVal <$> (js_getName (self))))
foreign import javascript safe "(($1, $2) => { $1[\"url\"] = $2; })"
js_setUrl :: CookieStoreGetOptions -> JSString -> IO ()
-- | <https://cookiestore.spec.whatwg.org/#dom-cookiestoregetoptions-url CookieStoreGetOptions.url specification>
setUrl :: (MonadDOM m, ToJSString val) => CookieStoreGetOptions -> val -> m ()
setUrl self val = liftDOM (void ((js_setUrl (self) (toJSString val))))
foreign import javascript unsafe "(($1) => { return $1[\"url\"]; })"
js_getUrl :: CookieStoreGetOptions -> IO JSVal
-- | <https://cookiestore.spec.whatwg.org/#dom-cookiestoregetoptions-url CookieStoreGetOptions.url specification>
getUrl :: (MonadDOM m, FromJSString result) => CookieStoreGetOptions -> m (Maybe result)
getUrl self = liftDOM (((fromMaybeJSString . Nullable) <$> (js_getUrl (self))))
-- | <https://cookiestore.spec.whatwg.org/#dom-cookiestoregetoptions-url CookieStoreGetOptions.url specification>
getUrlUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => CookieStoreGetOptions -> m result
getUrlUnsafe self = liftDOM ((((fromMaybeJSString . Nullable) <$> (js_getUrl (self))) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://cookiestore.spec.whatwg.org/#dom-cookiestoregetoptions-url CookieStoreGetOptions.url specification>
getUrlUnchecked :: (MonadDOM m, FromJSString result) => CookieStoreGetOptions -> m result
getUrlUnchecked self = liftDOM ((pFromJSVal <$> (js_getUrl (self))))