JsThis library provides bindings and necessary support for JS FFI. It contains all bindings into Js namespace.
[| 1;2;3;4|]
|. Js.Array2.map (fun x -> x + 1 )
|. Js.Array2.reduce (+) 0
|. Js.logTypes for JS objects
This used to be mark a Js object type. It is not needed any more, it is kept here for compatibility reasons
module Fn : sig ... endnullable, value of this type can be either null or 'a this type is the same as type t in Null
value of this type can be either undefined or 'a this type is the same as type t in Undefined
value of this type can be undefined, null or 'a this type is the same as type t n Null_undefined
type +'a null_undefined = 'a nullableval toOption : 'a nullable -> 'a optionval undefinedToOption : 'a undefined -> 'a optionval nullToOption : 'a null -> 'a optionval isNullable : 'a nullable -> boolval undefined : 'a undefinedThe same as empty Js.Undefined will be compiled as undefined
typeof x will be compiled as typeof x in JS Please consider functions in Types for a type safe way of reflection
val eqNull : 'a -> 'a null -> boolval eqUndefined : 'a -> 'a undefined -> boolval eqNullable : 'a -> 'a nullable -> boolunsafe_lt a b will be compiled as a < b. It is marked as unsafe, since it is impossible to give a proper semantics for comparision which applies to any type
unsafe_le a b will be compiled as a <= b. See also unsafe_lt
unsafe_gt a b will be compiled as a > b. See also unsafe_lt
unsafe_ge a b will be compiled as a >= b. See also unsafe_lt
module Null = Js_nullProvide utilities around 'a null
module Undefined = Js_undefinedProvide utilities around undefined
module Nullable = Js_null_undefinedProvide utilities around null_undefined
module Null_undefined = Js_null_undefinedmodule Exn = Js_exnProvide utilities for dealing with Js exceptions
module Array = Js_arrayProvide bindings to Js array
module Array2 = Js_array2Provide bindings to Js array
module String = Js_stringProvide bindings to JS string
module String2 = Js_string2Provide bindings to JS string
module Re = Js_reProvide bindings to Js regex expression
module Promise = Js_promiseProvide bindings to JS promise
module Date = Js_dateProvide bindings for JS Date
module Dict = Js_dictProvide utilities for JS dictionary object
module Global = Js_globalProvide bindings to JS global functions in global namespace
module Json = Js_jsonProvide utilities for json
module Math = Js_mathProvide bindings for JS Math object
module Typed_array = Js_typed_arrayProvide bindings for JS typed array
module TypedArray2 = Js_typed_array2Provide bindings for JS typed array
module Types = Js_typesProvide utilities for manipulating JS types
module Float = Js_floatProvide utilities for JS float
module Int = Js_intProvide utilities for int
module Bigint = Js_bigintProvide utilities for bigint
module Option = Js_optionProvide utilities for option
module Result = Js_resultDefine the interface for result
module List = Js_listProvide utilities for list
module Vector = Js_vectormodule Console = Js_consolemodule Set = Js_setProvides bindings for ES6 Set
module WeakSet = Js_weaksetProvides bindings for ES6 WeakSet
module Map = Js_mapProvides bindings for ES6 Map
module WeakMap = Js_weakmapProvides bindings for ES6 WeakMap