blob: db30c9daef91038af44b4e70f35e9c0618901265 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
module JavaScript.Window (
Window, IsWindow(..),
globalWindow,
) where
import JavaScript.Event
import JavaScript.Val
newtype Window = Window JSVal
deriving (ToJSVal, FromJSVal)
class IsWindow a where
toWindow :: a -> Window
instance IsWindow Window where
toWindow = id
instance IsEventTarget Window where
toEventTarget = fromJSValUnchecked . toJSVal
globalWindow :: Window
globalWindow = Window js_window
foreign import javascript unsafe "window"
js_window :: JSVal
|