{-# LANGUAGE PatternSynonyms #-} -- For HasCallStack compatibility {-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} module JSDOM.Generated.WorkerGlobalScope (close, importScripts, getSelf, getSelfUnsafe, getSelfUnchecked, getLocation, getLocationUnsafe, getLocationUnchecked, error, offline, online, getNavigator, getNavigatorUnsafe, getNavigatorUnchecked, WorkerGlobalScope(..), gTypeWorkerGlobalScope, IsWorkerGlobalScope, toWorkerGlobalScope) 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 -- | close :: (MonadDOM m, IsWorkerGlobalScope self) => self -> m () close self = liftDOM (void ((toWorkerGlobalScope self) ^. jsf "close" ())) -- | importScripts :: (MonadDOM m, IsWorkerGlobalScope self) => self -> m () importScripts self = liftDOM (void ((toWorkerGlobalScope self) ^. jsf "importScripts" ())) -- | getSelf :: (MonadDOM m, IsWorkerGlobalScope self) => self -> m (Maybe WorkerGlobalScope) getSelf self = liftDOM (((toWorkerGlobalScope self) ^. js "self") >>= fromJSVal) -- | getSelfUnsafe :: (MonadDOM m, IsWorkerGlobalScope self, HasCallStack) => self -> m WorkerGlobalScope getSelfUnsafe self = liftDOM ((((toWorkerGlobalScope self) ^. js "self") >>= fromJSVal) >>= maybe (Prelude.error "Nothing to return") return) -- | getSelfUnchecked :: (MonadDOM m, IsWorkerGlobalScope self) => self -> m WorkerGlobalScope getSelfUnchecked self = liftDOM (((toWorkerGlobalScope self) ^. js "self") >>= fromJSValUnchecked) -- | getLocation :: (MonadDOM m, IsWorkerGlobalScope self) => self -> m (Maybe WorkerLocation) getLocation self = liftDOM (((toWorkerGlobalScope self) ^. js "location") >>= fromJSVal) -- | getLocationUnsafe :: (MonadDOM m, IsWorkerGlobalScope self, HasCallStack) => self -> m WorkerLocation getLocationUnsafe self = liftDOM ((((toWorkerGlobalScope self) ^. js "location") >>= fromJSVal) >>= maybe (Prelude.error "Nothing to return") return) -- | getLocationUnchecked :: (MonadDOM m, IsWorkerGlobalScope self) => self -> m WorkerLocation getLocationUnchecked self = liftDOM (((toWorkerGlobalScope self) ^. js "location") >>= fromJSValUnchecked) -- | 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") -- | getNavigator :: (MonadDOM m, IsWorkerGlobalScope self) => self -> m (Maybe WorkerNavigator) getNavigator self = liftDOM (((toWorkerGlobalScope self) ^. js "navigator") >>= fromJSVal) -- | getNavigatorUnsafe :: (MonadDOM m, IsWorkerGlobalScope self, HasCallStack) => self -> m WorkerNavigator getNavigatorUnsafe self = liftDOM ((((toWorkerGlobalScope self) ^. js "navigator") >>= fromJSVal) >>= maybe (Prelude.error "Nothing to return") return) -- | getNavigatorUnchecked :: (MonadDOM m, IsWorkerGlobalScope self) => self -> m WorkerNavigator getNavigatorUnchecked self = liftDOM (((toWorkerGlobalScope self) ^. js "navigator") >>= fromJSValUnchecked)