jsaddle-dom-0.10.0.0: src/JSDOM/Generated/URLPatternOptions.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from urlpattern (webref). Do not edit.
module JSDOM.Generated.URLPatternOptions
(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 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://urlpattern.spec.whatwg.org/#dictdef-urlpatternoptions URLPatternOptions specification>
newURLPatternOptions :: (MonadDOM m) => m URLPatternOptions
newURLPatternOptions = liftDOM ((((new (jsg "Object") () >>= \o -> P.return o)) >>= fromJSValUnchecked))
-- | <https://urlpattern.spec.whatwg.org/#dom-urlpatternoptions-ignorecase URLPatternOptions.ignoreCase specification>
setIgnoreCase :: (MonadDOM m) => URLPatternOptions -> Bool -> m ()
setIgnoreCase self val = liftDOM (void (self ^. jss "ignoreCase" (toJSVal val)))
-- | <https://urlpattern.spec.whatwg.org/#dom-urlpatternoptions-ignorecase URLPatternOptions.ignoreCase specification>
getIgnoreCase :: (MonadDOM m) => URLPatternOptions -> m (Maybe Bool)
getIgnoreCase self = liftDOM (((self ^. js "ignoreCase") >>= fromJSValUnchecked))
-- | <https://urlpattern.spec.whatwg.org/#dom-urlpatternoptions-ignorecase URLPatternOptions.ignoreCase specification>
getIgnoreCaseUnsafe :: (MonadDOM m, HasCallStack) => URLPatternOptions -> m Bool
getIgnoreCaseUnsafe self = liftDOM ((((self ^. js "ignoreCase") >>= 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 (((self ^. js "ignoreCase") >>= valToBool))