module Language.Javascript.JSaddle.Types (
JSVal
, MutableJSArray
, Object(..)
, JSPropertyNameArray
, JSPropertyAttributes
, JSContextRef
, JSString
, Index
, Nullable(..)
, JSM
) where
import Control.Monad.Trans.Reader (ReaderT(..))
#ifdef ghcjs_HOST_OS
import GHCJS.Types
import JavaScript.Object.Internal (Object(..))
import JavaScript.Array (MutableJSArray)
import Data.Word (Word(..))
import GHCJS.Nullable (Nullable(..))
#else
import Foreign.ForeignPtr (ForeignPtr)
import Graphics.UI.Gtk.WebKit.JavaScriptCore.JSBase
(OpaqueJSString, JSValueRefRef,
JSContextRef, JSPropertyNameArrayRef, OpaqueJSValue)
import Graphics.UI.Gtk.WebKit.JavaScriptCore.JSObjectRef (JSPropertyAttributes)
import Foreign.C (CUInt(..))
#endif
#ifdef ghcjs_HOST_OS
newtype JSPropertyNameArray = JSPropertyNameArray { unJSPropertyNameArrayRef :: JSVal }
type JSPropertyAttributes = Word
type JSContextRef = ()
type Index = Int
#else
type JSVal = ForeignPtr OpaqueJSValue
type MutableJSArray = JSValueRefRef
type JSPropertyNameArray = JSPropertyNameArrayRef
type Index = CUInt
newtype Object = Object (ForeignPtr OpaqueJSValue)
type JSString = ForeignPtr OpaqueJSString
newtype Nullable a = Nullable a
#endif
type JSM = ReaderT JSContextRef IO