-
Notifications
You must be signed in to change notification settings - Fork 40
/
common.mli
62 lines (51 loc) · 2.2 KB
/
common.mli
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
(******************************************************************************)
(* _ __ * The Kappa Language *)
(* | |/ / * Copyright 2010-2020 CNRS - Harvard Medical School - INRIA - IRIF *)
(* | ' / *********************************************************************)
(* | . \ * This file is distributed under the terms of the *)
(* |_|\_\ * GNU Lesser General Public License Version 3 *)
(******************************************************************************)
val toss : 'a -> 'b
val id : 'a -> 'b
val debug : 'a -> 'b
val info : 'a -> 'b
val notice : 'a -> 'b
val warning : 'a -> 'b
val error : 'a -> 'b
val fatal : 'a -> 'b
val jquery_on : string -> string -> 'a -> 'b
val option_string : string option -> Js.js_string Js.t Js.opt
val plotPNG : ?plotStyleId:string -> string -> string -> string -> unit
val plotSVG : ?plotStyleId:string -> string -> string -> string -> unit
val saveFile : data:'a Js.t -> mime:string -> filename:string -> unit
type meth = [ `DELETE | `GET | `HEAD | `OPTIONS | `PATCH | `POST | `PUT ]
val method_to_string : meth -> string
val ajax_request :
?timeout:float ->
url:string ->
meth:meth ->
?data:string ->
handler:(int -> string -> unit) ->
'a
val async : string -> (unit -> unit Lwt.t) -> unit
val guid : unit -> string
val modal : id:string -> action:string -> unit
val element_data : Dom_html.element Js.t -> string -> Js.js_string Js.t Js.opt
val create_sort : string -> (Dom_html.event Js.t -> 'b -> unit) -> unit
val children_value :
Dom_html.element Js.t -> string -> (Dom_html.element Js.t -> 'a) -> 'a list
val hide_codemirror : unit -> unit
val show_codemirror : unit -> unit
(** Attach hooks to a value, called when value changes
*
* Can be used to imitate the React signals logic, but avoiding to be "GC'ed" *)
module Hooked : sig
type 'a t
val make : ?eq:('a -> 'a -> bool) -> 'a -> 'a t
val register : 'a t -> ('a -> unit) -> unit
val v : 'a t -> 'a
val set : 'a t -> 'a -> unit
val create : 'a t -> ('a -> 'b) -> 'b t
(** Create new hooked built on changes of this one, mimicking the propagation of the signal *)
val to_signal : 'a t -> 'a React.signal
end