ghcjs-dom-jsffi 0.9.4.0 → 0.9.5.0
raw patch · 3 files changed
+50/−3 lines, 3 files
Files
- ghcjs-dom-jsffi.cabal +5/−2
- src/GHCJS/DOM.hs +9/−1
- src/GHCJS/DOM/Types.hs +36/−0
ghcjs-dom-jsffi.cabal view
@@ -1,5 +1,5 @@ name: ghcjs-dom-jsffi-version: 0.9.4.0+version: 0.9.5.0 cabal-version: >=1.24 build-type: Simple license: MIT@@ -9,8 +9,11 @@ description: Documentent Object Model (DOM) functions that work with GHCJS. author: Hamish Mackenzie-data-dir: "" category: Web++Tested-With:+ GHC == 8.8.1 || == 8.6.5 || == 8.4.4 || == 8.2.2 || == 8.0.2 || == 7.10.3,+ GHCJS == 8.4 || == 8.2 Source-Repository head type: git
src/GHCJS/DOM.hs view
@@ -1,7 +1,9 @@ {-# LANGUAGE CPP, ForeignFunctionInterface, OverloadedStrings #-} {-# LANGUAGE JavaScriptFFI #-} module GHCJS.DOM (- currentWindow+ globalThis+, globalThisUnchecked+, currentWindow , currentWindowUnchecked , currentDocument , currentDocumentUnchecked@@ -26,11 +28,17 @@ import GHCJS.DOM.Types +foreign import javascript unsafe "$r = globalThis"+ ghcjs_globalThis :: IO (Nullable GlobalThis) foreign import javascript unsafe "$r = window" ghcjs_currentWindow :: IO (Nullable Window) foreign import javascript unsafe "$r = document" ghcjs_currentDocument :: IO (Nullable Document) +globalThis :: MonadDOM m => m (Maybe GlobalThis)+globalThis = liftDOM $ nullableToMaybe <$> ghcjs_globalThis+globalThisUnchecked :: MonadDOM m => m GlobalThis+globalThisUnchecked = liftDOM $ fromJust <$> globalThis currentWindow :: MonadDOM m => m (Maybe Window) currentWindow = liftDOM $ nullableToMaybe <$> ghcjs_currentWindow currentWindowUnchecked :: MonadDOM m => m Window
src/GHCJS/DOM/Types.hs view
@@ -119,6 +119,8 @@ -- * Used for better error messages , HasCallStack + , GlobalThis(GlobalThis), unGlobalThis, noGlobalThis+ -- * Interface types from IDL files -- AUTO GENERATION STARTS HERE@@ -2145,6 +2147,40 @@ noGLclampf :: Maybe GLclampf noGLclampf = Nothing {-# INLINE noGLclampf #-}++-- This type is used to access the `globalThis` (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis)+newtype GlobalThis = GlobalThis { unGlobalThis :: JSVal }++instance Eq (GlobalThis) where+ (GlobalThis a) == (GlobalThis b) = js_eq a b++instance PToJSVal GlobalThis where+ pToJSVal = unGlobalThis+ {-# INLINE pToJSVal #-}++instance PFromJSVal GlobalThis where+ pFromJSVal = GlobalThis+ {-# INLINE pFromJSVal #-}++instance ToJSVal GlobalThis where+ toJSVal = return . unGlobalThis+ {-# INLINE toJSVal #-}++instance FromJSVal GlobalThis where+ fromJSVal = return . fmap GlobalThis . maybeJSNullOrUndefined+ {-# INLINE fromJSVal #-}++instance IsGObject GlobalThis where+ typeGType _ = error "Unable to get the JavaScript type of GlobalThis"++instance IsEventTarget GlobalThis+instance IsWindowOrWorkerGlobalScope GlobalThis+instance IsGlobalPerformance GlobalThis+instance IsGlobalEventHandlers GlobalThis+instance IsGlobalCrypto GlobalThis+noGlobalThis :: Maybe GlobalThis+noGlobalThis = Nothing+{-# INLINE noGlobalThis #-} -- AUTO GENERATION STARTS HERE -- The remainder of this file is generated from IDL files using domconv-webkit-jsffi