on fda1d2f help sign in
elk/libraries/JavaScript.elm
56 lines 1.2 kB history raw
2module JavaScript where
4import Native.JavaScript as Native
5import open Basics
7data JSNumber = JSNumber
8data JSBool = JSBool
9data JSString = JSString
10data JSArray a = JSArray a
11data JSDomNode = JSDomNode
12data JSObject = JSObject
14-- Requires that the input array be uniform (all members have the same type)
15toList : JSArray a -> [a]
16toList = Native.toList
18toInt : JSNumber -> Int
19toInt = Native.toInt
21toFloat : JSNumber -> Float
22toFloat = Native.toFloat
24toBool : JSBool -> Bool
25toBool = Native.toBool
27toString : JSString -> String
28toString = Native.toString
31-- Produces a uniform JavaScript array with all members of the same type.
32fromList : [a] -> JSArray a
33fromList = Native.fromList
35fromInt : Int -> JSNumber
36fromInt = Native.fromInt
38fromFloat : Float -> JSNumber
39fromFloat = Native.fromFloat
41fromBool : Bool -> JSBool
42fromBool = Native.fromBool
44fromString : String -> JSString
45fromString = Native.fromString
47{--
48-- Turn an `Element` into a plain old DOM node.
49fromElement : Element -> JSDomNode
50fromElement = Native.fromElement
52-- Turn a DOM node into an `Element`. You can resize the node
53-- using the normal `width` and `height` functions.
54toElement : Int -> Int -> JSDomNode -> Element
55toElement = Native.toElement
56--}