Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file value_intf.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960moduletypeVALUE=sig(** Javascript Values
Javascript values are necessary to comunicate with the javascript world.
In order to send a message to the surrounding javascript
(see {!val: Task.send_to_javascript}) a javascript value is needed.
The following functions can be used to construct arbitrary javascript
values (no functions, just data).
E.g. if you want to construct the javascript object
{v
{first_name: "John", last_name: "Doe", age: 45}
v}
you just write
{[
record
[|
"first_name", string "John"
; "last_name", string "Doe"
; "age", int 45
|]
]}
*)typet(** Type of a javascript value. *)valnull:t(** The javascript value [null] *)valstring:string->t(** [string str] The javascript string [str] *)valint:int->t(** [int 5] The javascript number [5]. *)valbool:bool->t(** [bool true] The javascript value [true]. *)valfloat:float->t(** [float 5] The javascript number [5]. *)valrecord:(string*t)array->t(** [record [| "a", int 5; "b", string "hello"|]] is the javascript value
[{a: 5, b: 'hello'}|].
*)valarray:tarray->t(** [array [|int 5; string "hello"; bool true|] ] is the javascript array
[[5, "hello", true]].
*)valstringify:t->t(** Serialize the javascript object. The result is a javascript string
representing the json encoding of the javascript object.
*)end