packages feed

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

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from urlpattern (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.URLPatternOptions
       (js_newURLPatternOptions, js_setIgnoreCase, js_getIgnoreCase, newURLPatternOptions, setIgnoreCase, getIgnoreCase, getIgnoreCaseUnsafe, getIgnoreCaseUnchecked, URLPatternOptions(..), gTypeURLPatternOptions)
       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_newURLPatternOptions :: IO URLPatternOptions
-- | <https://urlpattern.spec.whatwg.org/#dictdef-urlpatternoptions URLPatternOptions specification>
newURLPatternOptions :: (MonadDOM m) => m URLPatternOptions
newURLPatternOptions = liftDOM ((js_newURLPatternOptions))

foreign import javascript safe "(($1, $2) => { $1[\"ignoreCase\"] = $2; })"
        js_setIgnoreCase :: URLPatternOptions -> Bool -> IO ()
-- | <https://urlpattern.spec.whatwg.org/#dom-urlpatternoptions-ignorecase URLPatternOptions.ignoreCase specification>
setIgnoreCase :: (MonadDOM m) => URLPatternOptions -> Bool -> m ()
setIgnoreCase self val = liftDOM (void ((js_setIgnoreCase (self) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"ignoreCase\"]; })"
        js_getIgnoreCase :: URLPatternOptions -> IO JSVal
-- | <https://urlpattern.spec.whatwg.org/#dom-urlpatternoptions-ignorecase URLPatternOptions.ignoreCase specification>
getIgnoreCase :: (MonadDOM m) => URLPatternOptions -> m (Maybe Bool)
getIgnoreCase self = liftDOM (((js_getIgnoreCase (self)) >>= fromJSValUnchecked))

-- | <https://urlpattern.spec.whatwg.org/#dom-urlpatternoptions-ignorecase URLPatternOptions.ignoreCase specification>
getIgnoreCaseUnsafe :: (MonadDOM m, HasCallStack) => URLPatternOptions -> m Bool
getIgnoreCaseUnsafe self = liftDOM ((((js_getIgnoreCase (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://urlpattern.spec.whatwg.org/#dom-urlpatternoptions-ignorecase URLPatternOptions.ignoreCase specification>
getIgnoreCaseUnchecked :: (MonadDOM m) => URLPatternOptions -> m Bool
getIgnoreCaseUnchecked self = liftDOM ((pFromJSVal <$> (js_getIgnoreCase (self))))