packages feed

ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/ClientQueryOptions.hs

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from service-workers (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.ClientQueryOptions
       (js_newClientQueryOptions, js_setIncludeUncontrolled, js_getIncludeUncontrolled, js_setType, js_getType, newClientQueryOptions, setIncludeUncontrolled, getIncludeUncontrolled, getIncludeUncontrolledUnsafe, getIncludeUncontrolledUnchecked, setType, getType, getTypeUnsafe, getTypeUnchecked, ClientQueryOptions(..), gTypeClientQueryOptions)
       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_newClientQueryOptions :: IO ClientQueryOptions
-- | <https://w3c.github.io/ServiceWorker/#dictdef-clientqueryoptions ClientQueryOptions specification>
newClientQueryOptions :: (MonadDOM m) => m ClientQueryOptions
newClientQueryOptions = liftDOM ((js_newClientQueryOptions))

foreign import javascript safe "(($1, $2) => { $1[\"includeUncontrolled\"] = $2; })"
        js_setIncludeUncontrolled :: ClientQueryOptions -> Bool -> IO ()
-- | <https://w3c.github.io/ServiceWorker/#dom-clientqueryoptions-includeuncontrolled ClientQueryOptions.includeUncontrolled specification>
setIncludeUncontrolled :: (MonadDOM m) => ClientQueryOptions -> Bool -> m ()
setIncludeUncontrolled self val = liftDOM (void ((js_setIncludeUncontrolled (self) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"includeUncontrolled\"]; })"
        js_getIncludeUncontrolled :: ClientQueryOptions -> IO JSVal
-- | <https://w3c.github.io/ServiceWorker/#dom-clientqueryoptions-includeuncontrolled ClientQueryOptions.includeUncontrolled specification>
getIncludeUncontrolled :: (MonadDOM m) => ClientQueryOptions -> m (Maybe Bool)
getIncludeUncontrolled self = liftDOM (((js_getIncludeUncontrolled (self)) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/ServiceWorker/#dom-clientqueryoptions-includeuncontrolled ClientQueryOptions.includeUncontrolled specification>
getIncludeUncontrolledUnsafe :: (MonadDOM m, HasCallStack) => ClientQueryOptions -> m Bool
getIncludeUncontrolledUnsafe self = liftDOM ((((js_getIncludeUncontrolled (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/ServiceWorker/#dom-clientqueryoptions-includeuncontrolled ClientQueryOptions.includeUncontrolled specification>
getIncludeUncontrolledUnchecked :: (MonadDOM m) => ClientQueryOptions -> m Bool
getIncludeUncontrolledUnchecked self = liftDOM ((pFromJSVal <$> (js_getIncludeUncontrolled (self))))

foreign import javascript safe "(($1, $2) => { $1[\"type\"] = $2; })"
        js_setType :: ClientQueryOptions -> JSVal -> IO ()
-- | <https://w3c.github.io/ServiceWorker/#dom-clientqueryoptions-type ClientQueryOptions.type specification>
setType :: (MonadDOM m) => ClientQueryOptions -> ClientType -> m ()
setType self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setType (self) a2')))

foreign import javascript unsafe "(($1) => { return $1[\"type\"]; })"
        js_getType :: ClientQueryOptions -> IO JSVal
-- | <https://w3c.github.io/ServiceWorker/#dom-clientqueryoptions-type ClientQueryOptions.type specification>
getType :: (MonadDOM m) => ClientQueryOptions -> m (Maybe ClientType)
getType self = liftDOM (((js_getType (self)) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/ServiceWorker/#dom-clientqueryoptions-type ClientQueryOptions.type specification>
getTypeUnsafe :: (MonadDOM m, HasCallStack) => ClientQueryOptions -> m ClientType
getTypeUnsafe self = liftDOM ((((js_getType (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/ServiceWorker/#dom-clientqueryoptions-type ClientQueryOptions.type specification>
getTypeUnchecked :: (MonadDOM m) => ClientQueryOptions -> m ClientType
getTypeUnchecked self = liftDOM ((pFromJSVal <$> (js_getType (self))))