{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module JSDOM.Generated.Navigator
(requestMediaKeySystemAccess, requestMediaKeySystemAccess_,
getGamepads, getGamepads_, getUserMedia, registerProtocolHandler,
isProtocolHandlerRegistered, isProtocolHandlerRegistered_,
unregisterProtocolHandler, vibratePattern, vibratePattern_,
vibrate, vibrate_, javaEnabled, javaEnabled_, getStorageUpdates,
getGeolocation, getMediaDevices, getWebkitTemporaryStorage,
getWebkitPersistentStorage, getWebdriver, getPlugins, getMimeTypes,
getCookieEnabled, Navigator(..), gTypeNavigator)
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 Data.Traversable (mapM)
import Language.Javascript.JSaddle (JSM(..), JSVal(..), JSString, strictEqual, toJSVal, valToStr, valToNumber, valToBool, js, jss, jsf, jsg, function, asyncFunction, new, array, jsUndefined, (!), (!!))
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, unsafeEventNameAsync)
import JSDOM.Enums
requestMediaKeySystemAccess ::
(MonadDOM m, ToJSString keySystem) =>
Navigator ->
keySystem ->
[MediaKeySystemConfiguration] -> m MediaKeySystemAccess
requestMediaKeySystemAccess self keySystem supportedConfiguration
= liftDOM
(((self ^. jsf "requestMediaKeySystemAccess"
[toJSVal keySystem, toJSVal (array supportedConfiguration)])
>>= readPromise)
>>= fromJSValUnchecked)
requestMediaKeySystemAccess_ ::
(MonadDOM m, ToJSString keySystem) =>
Navigator -> keySystem -> [MediaKeySystemConfiguration] -> m ()
requestMediaKeySystemAccess_ self keySystem supportedConfiguration
= liftDOM
(void
(self ^. jsf "requestMediaKeySystemAccess"
[toJSVal keySystem, toJSVal (array supportedConfiguration)]))
getGamepads :: (MonadDOM m) => Navigator -> m [Gamepad]
getGamepads self
= liftDOM ((self ^. jsf "getGamepads" ()) >>= fromJSArrayUnchecked)
getGamepads_ :: (MonadDOM m) => Navigator -> m ()
getGamepads_ self = liftDOM (void (self ^. jsf "getGamepads" ()))
getUserMedia ::
(MonadDOM m) =>
Navigator ->
MediaStreamConstraints ->
NavigatorUserMediaSuccessCallback ->
NavigatorUserMediaErrorCallback -> m ()
getUserMedia self constraints successCallback errorCallback
= liftDOM
(void
(self ^. jsf "getUserMedia"
[toJSVal constraints, toJSVal successCallback,
toJSVal errorCallback]))
registerProtocolHandler ::
(MonadDOM m, ToJSString scheme, ToJSString url,
ToJSString title) =>
Navigator -> scheme -> url -> title -> m ()
registerProtocolHandler self scheme url title
= liftDOM
(void
(self ^. jsf "registerProtocolHandler"
[toJSVal scheme, toJSVal url, toJSVal title]))
isProtocolHandlerRegistered ::
(MonadDOM m, ToJSString scheme, ToJSString url,
FromJSString result) =>
Navigator -> scheme -> url -> m result
isProtocolHandlerRegistered self scheme url
= liftDOM
((self ^. jsf "isProtocolHandlerRegistered"
[toJSVal scheme, toJSVal url])
>>= fromJSValUnchecked)
isProtocolHandlerRegistered_ ::
(MonadDOM m, ToJSString scheme, ToJSString url) =>
Navigator -> scheme -> url -> m ()
isProtocolHandlerRegistered_ self scheme url
= liftDOM
(void
(self ^. jsf "isProtocolHandlerRegistered"
[toJSVal scheme, toJSVal url]))
unregisterProtocolHandler ::
(MonadDOM m, ToJSString scheme, ToJSString url) =>
Navigator -> scheme -> url -> m ()
unregisterProtocolHandler self scheme url
= liftDOM
(void
(self ^. jsf "unregisterProtocolHandler"
[toJSVal scheme, toJSVal url]))
vibratePattern :: (MonadDOM m) => Navigator -> [Word] -> m Bool
vibratePattern self pattern'
= liftDOM
((self ^. jsf "vibrate" [toJSVal (array pattern')]) >>= valToBool)
vibratePattern_ :: (MonadDOM m) => Navigator -> [Word] -> m ()
vibratePattern_ self pattern'
= liftDOM (void (self ^. jsf "vibrate" [toJSVal (array pattern')]))
vibrate :: (MonadDOM m) => Navigator -> Word -> m Bool
vibrate self time
= liftDOM ((self ^. jsf "vibrate" [toJSVal time]) >>= valToBool)
vibrate_ :: (MonadDOM m) => Navigator -> Word -> m ()
vibrate_ self time
= liftDOM (void (self ^. jsf "vibrate" [toJSVal time]))
javaEnabled :: (MonadDOM m) => Navigator -> m Bool
javaEnabled self
= liftDOM ((self ^. jsf "javaEnabled" ()) >>= valToBool)
javaEnabled_ :: (MonadDOM m) => Navigator -> m ()
javaEnabled_ self = liftDOM (void (self ^. jsf "javaEnabled" ()))
getStorageUpdates :: (MonadDOM m) => Navigator -> m ()
getStorageUpdates self
= liftDOM (void (self ^. jsf "getStorageUpdates" ()))
getGeolocation :: (MonadDOM m) => Navigator -> m Geolocation
getGeolocation self
= liftDOM ((self ^. js "geolocation") >>= fromJSValUnchecked)
getMediaDevices :: (MonadDOM m) => Navigator -> m MediaDevices
getMediaDevices self
= liftDOM ((self ^. js "mediaDevices") >>= fromJSValUnchecked)
getWebkitTemporaryStorage ::
(MonadDOM m) => Navigator -> m StorageQuota
getWebkitTemporaryStorage self
= liftDOM
((self ^. js "webkitTemporaryStorage") >>= fromJSValUnchecked)
getWebkitPersistentStorage ::
(MonadDOM m) => Navigator -> m StorageQuota
getWebkitPersistentStorage self
= liftDOM
((self ^. js "webkitPersistentStorage") >>= fromJSValUnchecked)
getWebdriver :: (MonadDOM m) => Navigator -> m Bool
getWebdriver self
= liftDOM ((self ^. js "webdriver") >>= valToBool)
getPlugins :: (MonadDOM m) => Navigator -> m PluginArray
getPlugins self
= liftDOM ((self ^. js "plugins") >>= fromJSValUnchecked)
getMimeTypes :: (MonadDOM m) => Navigator -> m MimeTypeArray
getMimeTypes self
= liftDOM ((self ^. js "mimeTypes") >>= fromJSValUnchecked)
getCookieEnabled :: (MonadDOM m) => Navigator -> m Bool
getCookieEnabled self
= liftDOM ((self ^. js "cookieEnabled") >>= valToBool)