module JSDOM.Generated.URLUtils
(toString, toString_, setHref, getHref, getOrigin, setProtocol,
getProtocol, getProtocolUnsafe, getProtocolUnchecked, setUsername,
getUsername, getUsernameUnsafe, getUsernameUnchecked, setPassword,
getPassword, getPasswordUnsafe, getPasswordUnchecked, setHost,
getHost, getHostUnsafe, getHostUnchecked, setHostname, getHostname,
getHostnameUnsafe, getHostnameUnchecked, setPort, getPort,
getPortUnsafe, getPortUnchecked, setPathname, getPathname,
getPathnameUnsafe, getPathnameUnchecked, setSearch, getSearch,
getSearchUnsafe, getSearchUnchecked, setHash, getHash,
getHashUnsafe, getHashUnchecked, URLUtils(..), gTypeURLUtils)
where
import Prelude ((.), (==), (>>=), return, IO, Int, Float, Double, Bool(..), Maybe, maybe, fromIntegral, round, realToFrac, fmap, Show, Read, Eq, Ord, Maybe(..))
import qualified Prelude (error)
import Data.Typeable (Typeable)
import Language.Javascript.JSaddle (JSM(..), JSVal(..), JSString, strictEqual, toJSVal, valToStr, valToNumber, valToBool, js, jss, jsf, jsg, function, new, array)
import Data.Int (Int64)
import Data.Word (Word, Word64)
import JSDOM.Types
import Control.Applicative ((<$>))
import Control.Monad (void)
import Control.Lens.Operators ((^.))
import JSDOM.EventTargetClosures (EventName, unsafeEventName)
import JSDOM.Enums
toString ::
(MonadDOM m, FromJSString result) => URLUtils -> m result
toString self
= liftDOM ((self ^. jsf "toString" ()) >>= fromJSValUnchecked)
toString_ :: (MonadDOM m) => URLUtils -> m ()
toString_ self = liftDOM (void (self ^. jsf "toString" ()))
setHref :: (MonadDOM m, ToJSString val) => URLUtils -> val -> m ()
setHref self val = liftDOM (self ^. jss "href" (toJSVal val))
getHref ::
(MonadDOM m, FromJSString result) => URLUtils -> m result
getHref self = liftDOM ((self ^. js "href") >>= fromJSValUnchecked)
getOrigin ::
(MonadDOM m, FromJSString result) => URLUtils -> m result
getOrigin self
= liftDOM ((self ^. js "origin") >>= fromJSValUnchecked)
setProtocol ::
(MonadDOM m, ToJSString val) => URLUtils -> Maybe val -> m ()
setProtocol self val
= liftDOM (self ^. jss "protocol" (toJSVal val))
getProtocol ::
(MonadDOM m, FromJSString result) => URLUtils -> m (Maybe result)
getProtocol self
= liftDOM ((self ^. js "protocol") >>= fromMaybeJSString)
getProtocolUnsafe ::
(MonadDOM m, HasCallStack, FromJSString result) =>
URLUtils -> m result
getProtocolUnsafe self
= liftDOM
(((self ^. js "protocol") >>= fromMaybeJSString) >>=
maybe (Prelude.error "Nothing to return") return)
getProtocolUnchecked ::
(MonadDOM m, FromJSString result) => URLUtils -> m result
getProtocolUnchecked self
= liftDOM ((self ^. js "protocol") >>= fromJSValUnchecked)
setUsername ::
(MonadDOM m, ToJSString val) => URLUtils -> Maybe val -> m ()
setUsername self val
= liftDOM (self ^. jss "username" (toJSVal val))
getUsername ::
(MonadDOM m, FromJSString result) => URLUtils -> m (Maybe result)
getUsername self
= liftDOM ((self ^. js "username") >>= fromMaybeJSString)
getUsernameUnsafe ::
(MonadDOM m, HasCallStack, FromJSString result) =>
URLUtils -> m result
getUsernameUnsafe self
= liftDOM
(((self ^. js "username") >>= fromMaybeJSString) >>=
maybe (Prelude.error "Nothing to return") return)
getUsernameUnchecked ::
(MonadDOM m, FromJSString result) => URLUtils -> m result
getUsernameUnchecked self
= liftDOM ((self ^. js "username") >>= fromJSValUnchecked)
setPassword ::
(MonadDOM m, ToJSString val) => URLUtils -> Maybe val -> m ()
setPassword self val
= liftDOM (self ^. jss "password" (toJSVal val))
getPassword ::
(MonadDOM m, FromJSString result) => URLUtils -> m (Maybe result)
getPassword self
= liftDOM ((self ^. js "password") >>= fromMaybeJSString)
getPasswordUnsafe ::
(MonadDOM m, HasCallStack, FromJSString result) =>
URLUtils -> m result
getPasswordUnsafe self
= liftDOM
(((self ^. js "password") >>= fromMaybeJSString) >>=
maybe (Prelude.error "Nothing to return") return)
getPasswordUnchecked ::
(MonadDOM m, FromJSString result) => URLUtils -> m result
getPasswordUnchecked self
= liftDOM ((self ^. js "password") >>= fromJSValUnchecked)
setHost ::
(MonadDOM m, ToJSString val) => URLUtils -> Maybe val -> m ()
setHost self val = liftDOM (self ^. jss "host" (toJSVal val))
getHost ::
(MonadDOM m, FromJSString result) => URLUtils -> m (Maybe result)
getHost self = liftDOM ((self ^. js "host") >>= fromMaybeJSString)
getHostUnsafe ::
(MonadDOM m, HasCallStack, FromJSString result) =>
URLUtils -> m result
getHostUnsafe self
= liftDOM
(((self ^. js "host") >>= fromMaybeJSString) >>=
maybe (Prelude.error "Nothing to return") return)
getHostUnchecked ::
(MonadDOM m, FromJSString result) => URLUtils -> m result
getHostUnchecked self
= liftDOM ((self ^. js "host") >>= fromJSValUnchecked)
setHostname ::
(MonadDOM m, ToJSString val) => URLUtils -> Maybe val -> m ()
setHostname self val
= liftDOM (self ^. jss "hostname" (toJSVal val))
getHostname ::
(MonadDOM m, FromJSString result) => URLUtils -> m (Maybe result)
getHostname self
= liftDOM ((self ^. js "hostname") >>= fromMaybeJSString)
getHostnameUnsafe ::
(MonadDOM m, HasCallStack, FromJSString result) =>
URLUtils -> m result
getHostnameUnsafe self
= liftDOM
(((self ^. js "hostname") >>= fromMaybeJSString) >>=
maybe (Prelude.error "Nothing to return") return)
getHostnameUnchecked ::
(MonadDOM m, FromJSString result) => URLUtils -> m result
getHostnameUnchecked self
= liftDOM ((self ^. js "hostname") >>= fromJSValUnchecked)
setPort ::
(MonadDOM m, ToJSString val) => URLUtils -> Maybe val -> m ()
setPort self val = liftDOM (self ^. jss "port" (toJSVal val))
getPort ::
(MonadDOM m, FromJSString result) => URLUtils -> m (Maybe result)
getPort self = liftDOM ((self ^. js "port") >>= fromMaybeJSString)
getPortUnsafe ::
(MonadDOM m, HasCallStack, FromJSString result) =>
URLUtils -> m result
getPortUnsafe self
= liftDOM
(((self ^. js "port") >>= fromMaybeJSString) >>=
maybe (Prelude.error "Nothing to return") return)
getPortUnchecked ::
(MonadDOM m, FromJSString result) => URLUtils -> m result
getPortUnchecked self
= liftDOM ((self ^. js "port") >>= fromJSValUnchecked)
setPathname ::
(MonadDOM m, ToJSString val) => URLUtils -> Maybe val -> m ()
setPathname self val
= liftDOM (self ^. jss "pathname" (toJSVal val))
getPathname ::
(MonadDOM m, FromJSString result) => URLUtils -> m (Maybe result)
getPathname self
= liftDOM ((self ^. js "pathname") >>= fromMaybeJSString)
getPathnameUnsafe ::
(MonadDOM m, HasCallStack, FromJSString result) =>
URLUtils -> m result
getPathnameUnsafe self
= liftDOM
(((self ^. js "pathname") >>= fromMaybeJSString) >>=
maybe (Prelude.error "Nothing to return") return)
getPathnameUnchecked ::
(MonadDOM m, FromJSString result) => URLUtils -> m result
getPathnameUnchecked self
= liftDOM ((self ^. js "pathname") >>= fromJSValUnchecked)
setSearch ::
(MonadDOM m, ToJSString val) => URLUtils -> Maybe val -> m ()
setSearch self val = liftDOM (self ^. jss "search" (toJSVal val))
getSearch ::
(MonadDOM m, FromJSString result) => URLUtils -> m (Maybe result)
getSearch self
= liftDOM ((self ^. js "search") >>= fromMaybeJSString)
getSearchUnsafe ::
(MonadDOM m, HasCallStack, FromJSString result) =>
URLUtils -> m result
getSearchUnsafe self
= liftDOM
(((self ^. js "search") >>= fromMaybeJSString) >>=
maybe (Prelude.error "Nothing to return") return)
getSearchUnchecked ::
(MonadDOM m, FromJSString result) => URLUtils -> m result
getSearchUnchecked self
= liftDOM ((self ^. js "search") >>= fromJSValUnchecked)
setHash ::
(MonadDOM m, ToJSString val) => URLUtils -> Maybe val -> m ()
setHash self val = liftDOM (self ^. jss "hash" (toJSVal val))
getHash ::
(MonadDOM m, FromJSString result) => URLUtils -> m (Maybe result)
getHash self = liftDOM ((self ^. js "hash") >>= fromMaybeJSString)
getHashUnsafe ::
(MonadDOM m, HasCallStack, FromJSString result) =>
URLUtils -> m result
getHashUnsafe self
= liftDOM
(((self ^. js "hash") >>= fromMaybeJSString) >>=
maybe (Prelude.error "Nothing to return") return)
getHashUnchecked ::
(MonadDOM m, FromJSString result) => URLUtils -> m result
getHashUnchecked self
= liftDOM ((self ^. js "hash") >>= fromJSValUnchecked)