module GHCJS.DOM.JSFFI.Generated.WorkerGlobalScope
(js_close, close, js_importScripts, importScripts, js_getSelf,
getSelf, getSelfUnsafe, getSelfUnchecked, js_getLocation,
getLocation, getLocationUnsafe, getLocationUnchecked, error,
offline, online, js_getNavigator, getNavigator, getNavigatorUnsafe,
getNavigatorUnchecked, WorkerGlobalScope(..),
gTypeWorkerGlobalScope, IsWorkerGlobalScope, toWorkerGlobalScope)
where
import Prelude ((.), (==), (>>=), return, IO, Int, Float, Double, Bool(..), Maybe, maybe, fromIntegral, round, fmap, Show, Read, Eq, Ord)
import qualified Prelude (error)
import Data.Typeable (Typeable)
import GHCJS.Types (JSVal(..), JSString)
import GHCJS.Foreign (jsNull)
import GHCJS.Foreign.Callback (syncCallback, asyncCallback, syncCallback1, asyncCallback1, syncCallback2, asyncCallback2, OnBlocked(..))
import GHCJS.Marshal (ToJSVal(..), FromJSVal(..))
import GHCJS.Marshal.Pure (PToJSVal(..), PFromJSVal(..))
import Control.Monad (void)
import Control.Monad.IO.Class (MonadIO(..))
import Data.Int (Int64)
import Data.Word (Word, Word64)
import Data.Maybe (fromJust)
import GHCJS.DOM.Types
import Control.Applicative ((<$>))
import GHCJS.DOM.EventTargetClosures (EventName, unsafeEventName)
import GHCJS.DOM.JSFFI.Generated.Enums
foreign import javascript unsafe "$1[\"close\"]()" js_close ::
WorkerGlobalScope -> IO ()
close :: (MonadIO m, IsWorkerGlobalScope self) => self -> m ()
close self = liftIO (js_close (toWorkerGlobalScope self))
foreign import javascript unsafe "$1[\"importScripts\"]()"
js_importScripts :: WorkerGlobalScope -> IO ()
importScripts ::
(MonadIO m, IsWorkerGlobalScope self) => self -> m ()
importScripts self
= liftIO (js_importScripts (toWorkerGlobalScope self))
foreign import javascript unsafe "$1[\"self\"]" js_getSelf ::
WorkerGlobalScope -> IO (Nullable WorkerGlobalScope)
getSelf ::
(MonadIO m, IsWorkerGlobalScope self) =>
self -> m (Maybe WorkerGlobalScope)
getSelf self
= liftIO
(nullableToMaybe <$> (js_getSelf (toWorkerGlobalScope self)))
getSelfUnsafe ::
(MonadIO m, IsWorkerGlobalScope self, HasCallStack) =>
self -> m WorkerGlobalScope
getSelfUnsafe self
= liftIO
((nullableToMaybe <$> (js_getSelf (toWorkerGlobalScope self))) >>=
maybe (Prelude.error "Nothing to return") return)
getSelfUnchecked ::
(MonadIO m, IsWorkerGlobalScope self) =>
self -> m WorkerGlobalScope
getSelfUnchecked self
= liftIO
(fromJust . nullableToMaybe <$>
(js_getSelf (toWorkerGlobalScope self)))
foreign import javascript unsafe "$1[\"location\"]" js_getLocation
:: WorkerGlobalScope -> IO (Nullable WorkerLocation)
getLocation ::
(MonadIO m, IsWorkerGlobalScope self) =>
self -> m (Maybe WorkerLocation)
getLocation self
= liftIO
(nullableToMaybe <$> (js_getLocation (toWorkerGlobalScope self)))
getLocationUnsafe ::
(MonadIO m, IsWorkerGlobalScope self, HasCallStack) =>
self -> m WorkerLocation
getLocationUnsafe self
= liftIO
((nullableToMaybe <$> (js_getLocation (toWorkerGlobalScope self)))
>>= maybe (Prelude.error "Nothing to return") return)
getLocationUnchecked ::
(MonadIO m, IsWorkerGlobalScope self) => self -> m WorkerLocation
getLocationUnchecked self
= liftIO
(fromJust . nullableToMaybe <$>
(js_getLocation (toWorkerGlobalScope self)))
error ::
(IsWorkerGlobalScope self, IsEventTarget self) =>
EventName self UIEvent
error = unsafeEventName (toJSString "error")
offline ::
(IsWorkerGlobalScope self, IsEventTarget self) =>
EventName self Event
offline = unsafeEventName (toJSString "offline")
online ::
(IsWorkerGlobalScope self, IsEventTarget self) =>
EventName self Event
online = unsafeEventName (toJSString "online")
foreign import javascript unsafe "$1[\"navigator\"]"
js_getNavigator ::
WorkerGlobalScope -> IO (Nullable WorkerNavigator)
getNavigator ::
(MonadIO m, IsWorkerGlobalScope self) =>
self -> m (Maybe WorkerNavigator)
getNavigator self
= liftIO
(nullableToMaybe <$> (js_getNavigator (toWorkerGlobalScope self)))
getNavigatorUnsafe ::
(MonadIO m, IsWorkerGlobalScope self, HasCallStack) =>
self -> m WorkerNavigator
getNavigatorUnsafe self
= liftIO
((nullableToMaybe <$> (js_getNavigator (toWorkerGlobalScope self)))
>>= maybe (Prelude.error "Nothing to return") return)
getNavigatorUnchecked ::
(MonadIO m, IsWorkerGlobalScope self) => self -> m WorkerNavigator
getNavigatorUnchecked self
= liftIO
(fromJust . nullableToMaybe <$>
(js_getNavigator (toWorkerGlobalScope self)))