packages feed

jsaddle-dom-0.10.0.0: src/JSDOM/Generated/CacheQueryOptions.hs

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from service-workers (webref). Do not edit.
module JSDOM.Generated.CacheQueryOptions
       (newCacheQueryOptions, setIgnoreSearch, getIgnoreSearch, getIgnoreSearchUnsafe, getIgnoreSearchUnchecked, setIgnoreMethod, getIgnoreMethod, getIgnoreMethodUnsafe, getIgnoreMethodUnchecked, setIgnoreVary, getIgnoreVary, getIgnoreVaryUnsafe, getIgnoreVaryUnchecked, CacheQueryOptions(..), gTypeCacheQueryOptions, IsCacheQueryOptions, toCacheQueryOptions)
       where
import Prelude ((.), (==), (>>=), (<$>), (++), Bool(..), Maybe(..), IO, Int, Word, Double, Float)
import qualified Prelude as P
import Control.Monad (void)
import Control.Lens.Operators ((^.))
import Language.Javascript.JSaddle (JSM, JSVal, JSString, toJSVal, valToBool, valToNumber, js, jss, jsf, jsg, new, function, asyncFunction, jsUndefined, jsNull)
import JSDOM.Types
import qualified JSDOM.Types as Types
import JSDOM.EventTargetClosures (EventName, unsafeEventName, unsafeEventNameAsync)
import JSDOM.Generated.Enums

-- | <https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions CacheQueryOptions specification>
newCacheQueryOptions :: (MonadDOM m) => m CacheQueryOptions
newCacheQueryOptions = liftDOM ((((new (jsg "Object") () >>= \o -> P.return o)) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/ServiceWorker/#dom-cachequeryoptions-ignoresearch CacheQueryOptions.ignoreSearch specification>
setIgnoreSearch :: (MonadDOM m, IsCacheQueryOptions self) => self -> Bool -> m ()
setIgnoreSearch self val = liftDOM (void ((Types.toCacheQueryOptions self) ^. jss "ignoreSearch" (toJSVal val)))

-- | <https://w3c.github.io/ServiceWorker/#dom-cachequeryoptions-ignoresearch CacheQueryOptions.ignoreSearch specification>
getIgnoreSearch :: (MonadDOM m, IsCacheQueryOptions self) => self -> m (Maybe Bool)
getIgnoreSearch self = liftDOM ((((Types.toCacheQueryOptions self) ^. js "ignoreSearch") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/ServiceWorker/#dom-cachequeryoptions-ignoresearch CacheQueryOptions.ignoreSearch specification>
getIgnoreSearchUnsafe :: (MonadDOM m, IsCacheQueryOptions self, HasCallStack) => self -> m Bool
getIgnoreSearchUnsafe self = liftDOM (((((Types.toCacheQueryOptions self) ^. js "ignoreSearch") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/ServiceWorker/#dom-cachequeryoptions-ignoresearch CacheQueryOptions.ignoreSearch specification>
getIgnoreSearchUnchecked :: (MonadDOM m, IsCacheQueryOptions self) => self -> m Bool
getIgnoreSearchUnchecked self = liftDOM ((((Types.toCacheQueryOptions self) ^. js "ignoreSearch") >>= valToBool))

-- | <https://w3c.github.io/ServiceWorker/#dom-cachequeryoptions-ignoremethod CacheQueryOptions.ignoreMethod specification>
setIgnoreMethod :: (MonadDOM m, IsCacheQueryOptions self) => self -> Bool -> m ()
setIgnoreMethod self val = liftDOM (void ((Types.toCacheQueryOptions self) ^. jss "ignoreMethod" (toJSVal val)))

-- | <https://w3c.github.io/ServiceWorker/#dom-cachequeryoptions-ignoremethod CacheQueryOptions.ignoreMethod specification>
getIgnoreMethod :: (MonadDOM m, IsCacheQueryOptions self) => self -> m (Maybe Bool)
getIgnoreMethod self = liftDOM ((((Types.toCacheQueryOptions self) ^. js "ignoreMethod") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/ServiceWorker/#dom-cachequeryoptions-ignoremethod CacheQueryOptions.ignoreMethod specification>
getIgnoreMethodUnsafe :: (MonadDOM m, IsCacheQueryOptions self, HasCallStack) => self -> m Bool
getIgnoreMethodUnsafe self = liftDOM (((((Types.toCacheQueryOptions self) ^. js "ignoreMethod") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/ServiceWorker/#dom-cachequeryoptions-ignoremethod CacheQueryOptions.ignoreMethod specification>
getIgnoreMethodUnchecked :: (MonadDOM m, IsCacheQueryOptions self) => self -> m Bool
getIgnoreMethodUnchecked self = liftDOM ((((Types.toCacheQueryOptions self) ^. js "ignoreMethod") >>= valToBool))

-- | <https://w3c.github.io/ServiceWorker/#dom-cachequeryoptions-ignorevary CacheQueryOptions.ignoreVary specification>
setIgnoreVary :: (MonadDOM m, IsCacheQueryOptions self) => self -> Bool -> m ()
setIgnoreVary self val = liftDOM (void ((Types.toCacheQueryOptions self) ^. jss "ignoreVary" (toJSVal val)))

-- | <https://w3c.github.io/ServiceWorker/#dom-cachequeryoptions-ignorevary CacheQueryOptions.ignoreVary specification>
getIgnoreVary :: (MonadDOM m, IsCacheQueryOptions self) => self -> m (Maybe Bool)
getIgnoreVary self = liftDOM ((((Types.toCacheQueryOptions self) ^. js "ignoreVary") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/ServiceWorker/#dom-cachequeryoptions-ignorevary CacheQueryOptions.ignoreVary specification>
getIgnoreVaryUnsafe :: (MonadDOM m, IsCacheQueryOptions self, HasCallStack) => self -> m Bool
getIgnoreVaryUnsafe self = liftDOM (((((Types.toCacheQueryOptions self) ^. js "ignoreVary") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/ServiceWorker/#dom-cachequeryoptions-ignorevary CacheQueryOptions.ignoreVary specification>
getIgnoreVaryUnchecked :: (MonadDOM m, IsCacheQueryOptions self) => self -> m Bool
getIgnoreVaryUnchecked self = liftDOM ((((Types.toCacheQueryOptions self) ^. js "ignoreVary") >>= valToBool))