@@ -1,74 +0,0 @@
2−module JavaScript where
4−{-|This library does basic conversions between Elm and JS values. This allows
5−the internal data structures of Elm to change and improve with no impact on JS
8−It is intended to be imported as `import JavaScript as JS`. That way functions
9−like `JS.toInt` convert JavaScript *to* Elm integers and functions like
10−`JS.fromString` gets JavaScript *from* Elm strings.
13−@docs toString, toInt, toFloat, toBool, toList
16−@docs fromString, fromInt, fromFloat, fromBool, fromList
19−# DOM Nodes and Elements
20−@docs toElement, fromElement
23−import Native.JavaScript
25−data JSNumber = JSNumber
27−data JSString = JSString
28−data JSArray a = JSArray a
29−data JSDomNode = JSDomNode
30−data JSObject = JSObject
32−{-| Requires that the input array be uniform (all members have the same type) -}
33−toList : JSArray a -> [a]
34−toList = Native.JavaScript.toList
36−toInt : JSNumber -> Int
37−toInt = Native.JavaScript.toInt
39−toFloat : JSNumber -> Float
40−toFloat = Native.JavaScript.toFloat
42−toBool : JSBool -> Bool
43−toBool = Native.JavaScript.toBool
45−toString : JSString -> String
46−toString = Native.JavaScript.toString
49−{-| Produces a uniform JavaScript array with all members of the same type. -}
50−fromList : [a] -> JSArray a
51−fromList = Native.JavaScript.fromList
53−fromInt : Int -> JSNumber
54−fromInt = Native.JavaScript.fromInt
56−fromFloat : Float -> JSNumber
57−fromFloat = Native.JavaScript.fromFloat
59−fromBool : Bool -> JSBool
60−fromBool = Native.JavaScript.fromBool
62−fromString : String -> JSString
63−fromString = Native.JavaScript.fromString
66−{-| Turn an `Element` into a DOM node. -}
67−fromElement : Element -> JSDomNode
68−fromElement = Native.JavaScript.fromElement
70−{-| Turn a DOM node into an `Element`. You can resize the node
71−using the normal `width` and `height` functions. -}
72−toElement : Int -> Int -> JSDomNode -> Element
73−toElement = Native.JavaScript.toElement