Js_of_ocaml_lwt.Lwt_js_eventsProgramming mouse or keyboard events handlers using Lwt
Reminder: Event capturing starts with the outer most element in the DOM and works inwards to the HTML element the event took place on (capture phase) and then out again (bubbling phase).
Examples of use:
Waiting for a click on elt1 before continuing:
let%lwt _ = Lwt_js_events.click elt1 inDoing some operation for each value change in input element inp:
Lwt_js_events.(async (fun () ->
clicks inp1 (fun ev _ -> ...)
))Defining a thread that waits for ESC key on an element:
let rec esc elt =
let%lwt ev = keydown elt in
if ev##.keyCode = 27
then Lwt.return ev
else esc eltWaiting for a click or escape key before continuing:
let%lwt () =
Lwt.pick [(let%lwt _ = esc Dom_html.document in Lwt.return ());
(let%lwt _ = click Dom_html.document in Lwt.return ())]
in ...val make_event :
Js_of_ocaml.Dom_html.event as 'a Js_of_ocaml.Js.t
Js_of_ocaml.Dom_html.Event.typ ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
'a Js_of_ocaml.Js.t Lwt.tmake_event ev target creates a Lwt thread that waits for the event ev to happen on target (once). This thread isa cancellable using Lwt.cancel. If you set the optional parameter ~use_capture:true, the event will be caught during the capture phase, otherwise it is caught during the bubbling phase (default). If you set the optional parameter ~passive:true, the user agent will ignore preventDefault calls inside the event callback.
val seq_loop :
(?use_capture:bool -> ?passive:bool -> 'target -> 'event Lwt.t) ->
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
'target ->
('event -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tseq_loop (make_event ev) target handler creates a looping Lwt thread that waits for the event ev to happen on target, then execute handler, and start again waiting for the event. Events happening during the execution of the handler are ignored. See async_loop and buffered_loop for alternative semantics.
For example, the clicks function below is defined by:
let clicks ?use_capture ?passive t = seq_loop click ?use_capture ?passive t
The thread returned is cancellable using Lwt.cancel. In order for the loop thread to be canceled from within the handler, the latter receives the former as its second parameter.
By default, cancelling the loop will not cancel the potential currently running handler. This behaviour can be changed by setting the cancel_handler parameter to true.
val async_loop :
(?use_capture:bool -> ?passive:bool -> 'target -> 'event Lwt.t) ->
?use_capture:bool ->
?passive:bool ->
'target ->
('event -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tasync_loop is similar to seq_loop, but each handler runs independently. No event is thus missed, but since several instances of the handler can be run concurrently, it is up to the programmer to ensure that they interact correctly.
Cancelling the loop will not cancel the potential currently running handlers.
val buffered_loop :
(?use_capture:bool -> ?passive:bool -> 'target -> 'event Lwt.t) ->
?cancel_handler:bool ->
?cancel_queue:bool ->
?use_capture:bool ->
?passive:bool ->
'target ->
('event -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tbuffered_loop is similar to seq_loop, but any event that occurs during an execution of the handler is queued instead of being ignored.
No event is thus missed, but there can be a non predictable delay between its trigger and its treatment. It is thus a good idea to use this loop with handlers whose running time is short, so the memorized event still makes sense when the handler is eventually executed. It is also up to the programmer to ensure that event handlers terminate so the queue will eventually be emptied.
By default, cancelling the loop will not cancel the (potential) currently running handler, but any other queued event will be dropped. This behaviour can be customized using the two optional parameters cancel_handler and cancel_queue.
async t records a thread to be executed later. It is implemented by calling yield, then Lwt.async. This is useful if you want to create a new event listener when you are inside an event handler. This avoids the current event to be caught by the new event handler (if it propagates).
val func_limited_loop :
(?use_capture:bool -> ?passive:bool -> 'a -> 'b Lwt.t) ->
(unit -> 'a Lwt.t) ->
?use_capture:bool ->
?passive:bool ->
'a ->
('b -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tfunc_limited_loop event delay_fun target handler will behave like Lwt_js_events.async_loop event target handler but it will run delay_fun first, and execute handler only when delay_fun is finished and no other event occurred in the meantime.
This allows to limit the number of events caught.
Be careful, it is an asynchrone loop, so if you give too little time, several instances of your handler could be run in same time *
val limited_loop :
(?use_capture:bool -> ?passive:bool -> 'a -> 'b Lwt.t) ->
?elapsed_time:float ->
?use_capture:bool ->
?passive:bool ->
'a ->
('b -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tSame as func_limited_loop but take time instead of function By default elapsed_time = 0.1s = 100ms *
val click :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.mouseEvent Js_of_ocaml.Js.t Lwt.tval copy :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.clipboardEvent Js_of_ocaml.Js.t Lwt.tval cut :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.clipboardEvent Js_of_ocaml.Js.t Lwt.tval paste :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.clipboardEvent Js_of_ocaml.Js.t Lwt.tval dblclick :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.mouseEvent Js_of_ocaml.Js.t Lwt.tval mousedown :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.mouseEvent Js_of_ocaml.Js.t Lwt.tval mouseup :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.mouseEvent Js_of_ocaml.Js.t Lwt.tval mouseover :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.mouseEvent Js_of_ocaml.Js.t Lwt.tval mousemove :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.mouseEvent Js_of_ocaml.Js.t Lwt.tval mouseout :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.mouseEvent Js_of_ocaml.Js.t Lwt.tval keypress :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.keyboardEvent Js_of_ocaml.Js.t Lwt.tval keydown :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.keyboardEvent Js_of_ocaml.Js.t Lwt.tval keyup :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.keyboardEvent Js_of_ocaml.Js.t Lwt.tval input :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t Lwt.tval timeupdate :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t Lwt.tval change :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t Lwt.tval dragstart :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.dragEvent Js_of_ocaml.Js.t Lwt.tval dragend :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.dragEvent Js_of_ocaml.Js.t Lwt.tval dragenter :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.dragEvent Js_of_ocaml.Js.t Lwt.tval dragover :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.dragEvent Js_of_ocaml.Js.t Lwt.tval dragleave :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.dragEvent Js_of_ocaml.Js.t Lwt.tval drag :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.dragEvent Js_of_ocaml.Js.t Lwt.tval drop :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.dragEvent Js_of_ocaml.Js.t Lwt.tval focus :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.focusEvent Js_of_ocaml.Js.t Lwt.tval blur :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.focusEvent Js_of_ocaml.Js.t Lwt.tval scroll :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t Lwt.tval submit :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.submitEvent Js_of_ocaml.Js.t Lwt.tval select :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t Lwt.tval mousewheel :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.mouseEvent Js_of_ocaml.Js.t * (int * int)) Lwt.tThis function returns the event, together with the numbers of ticks the mouse wheel moved. Positive means down or right. This interface is compatible with all (recent) browsers.
val wheel :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.mousewheelEvent Js_of_ocaml.Js.t Lwt.tval touchstart :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.touchEvent Js_of_ocaml.Js.t Lwt.tval touchmove :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.touchEvent Js_of_ocaml.Js.t Lwt.tval touchend :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.touchEvent Js_of_ocaml.Js.t Lwt.tval touchcancel :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.touchEvent Js_of_ocaml.Js.t Lwt.tval lostpointercapture :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.pointerEvent Js_of_ocaml.Js.t Lwt.tval gotpointercapture :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.pointerEvent Js_of_ocaml.Js.t Lwt.tval pointerenter :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.pointerEvent Js_of_ocaml.Js.t Lwt.tval pointercancel :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.pointerEvent Js_of_ocaml.Js.t Lwt.tval pointerdown :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.pointerEvent Js_of_ocaml.Js.t Lwt.tval pointerleave :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.pointerEvent Js_of_ocaml.Js.t Lwt.tval pointermove :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.pointerEvent Js_of_ocaml.Js.t Lwt.tval pointerout :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.pointerEvent Js_of_ocaml.Js.t Lwt.tval pointerover :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.pointerEvent Js_of_ocaml.Js.t Lwt.tval pointerup :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.pointerEvent Js_of_ocaml.Js.t Lwt.tval transitionend :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.transitionEvent Js_of_ocaml.Js.t Lwt.tReturns when a CSS transition terminates on the element.
val transitionstart :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.transitionEvent Js_of_ocaml.Js.t Lwt.tval transitionrun :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.transitionEvent Js_of_ocaml.Js.t Lwt.tval transitioncancel :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.transitionEvent Js_of_ocaml.Js.t Lwt.tval load :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.imageElement Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t Lwt.tval error :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.imageElement Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t Lwt.tval abort :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.imageElement Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t Lwt.tval canplay :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t Lwt.tval canplaythrough :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t Lwt.tval durationchange :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t Lwt.tval emptied :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t Lwt.tval ended :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t Lwt.tval loadeddata :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t Lwt.tval loadedmetadata :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t Lwt.tval loadstart :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t Lwt.tval pause :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t Lwt.tval play :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t Lwt.tval playing :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t Lwt.tval ratechange :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t Lwt.tval seeked :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t Lwt.tval seeking :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t Lwt.tval stalled :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t Lwt.tval suspend :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t Lwt.tval volumechange :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t Lwt.tval waiting :
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t Lwt.tval clicks :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.mouseEvent Js_of_ocaml.Js.t ->
unit Lwt.t ->
unit Lwt.t) ->
unit Lwt.tval copies :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.clipboardEvent Js_of_ocaml.Js.t ->
unit Lwt.t ->
unit Lwt.t) ->
unit Lwt.tval cuts :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.clipboardEvent Js_of_ocaml.Js.t ->
unit Lwt.t ->
unit Lwt.t) ->
unit Lwt.tval pastes :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.clipboardEvent Js_of_ocaml.Js.t ->
unit Lwt.t ->
unit Lwt.t) ->
unit Lwt.tval dblclicks :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.mouseEvent Js_of_ocaml.Js.t ->
unit Lwt.t ->
unit Lwt.t) ->
unit Lwt.tval mousedowns :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.mouseEvent Js_of_ocaml.Js.t ->
unit Lwt.t ->
unit Lwt.t) ->
unit Lwt.tval mouseups :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.mouseEvent Js_of_ocaml.Js.t ->
unit Lwt.t ->
unit Lwt.t) ->
unit Lwt.tval mouseovers :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.mouseEvent Js_of_ocaml.Js.t ->
unit Lwt.t ->
unit Lwt.t) ->
unit Lwt.tval mousemoves :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.mouseEvent Js_of_ocaml.Js.t ->
unit Lwt.t ->
unit Lwt.t) ->
unit Lwt.tval mouseouts :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.mouseEvent Js_of_ocaml.Js.t ->
unit Lwt.t ->
unit Lwt.t) ->
unit Lwt.tval keypresses :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.keyboardEvent Js_of_ocaml.Js.t ->
unit Lwt.t ->
unit Lwt.t) ->
unit Lwt.tval keydowns :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.keyboardEvent Js_of_ocaml.Js.t ->
unit Lwt.t ->
unit Lwt.t) ->
unit Lwt.tval keyups :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.keyboardEvent Js_of_ocaml.Js.t ->
unit Lwt.t ->
unit Lwt.t) ->
unit Lwt.tval inputs :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tval timeupdates :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tval changes :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tval dragstarts :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.dragEvent Js_of_ocaml.Js.t -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tval dragends :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.dragEvent Js_of_ocaml.Js.t -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tval dragenters :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.dragEvent Js_of_ocaml.Js.t -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tval dragovers :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.dragEvent Js_of_ocaml.Js.t -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tval dragleaves :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.dragEvent Js_of_ocaml.Js.t -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tval drags :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.dragEvent Js_of_ocaml.Js.t -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tval drops :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.dragEvent Js_of_ocaml.Js.t -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tval mousewheels :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
((Js_of_ocaml.Dom_html.mouseEvent Js_of_ocaml.Js.t * (int * int)) ->
unit Lwt.t ->
unit Lwt.t) ->
unit Lwt.tval wheels :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.mousewheelEvent Js_of_ocaml.Js.t ->
unit Lwt.t ->
unit Lwt.t) ->
unit Lwt.tval touchstarts :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.touchEvent Js_of_ocaml.Js.t ->
unit Lwt.t ->
unit Lwt.t) ->
unit Lwt.tval touchmoves :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.touchEvent Js_of_ocaml.Js.t ->
unit Lwt.t ->
unit Lwt.t) ->
unit Lwt.tval touchends :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.touchEvent Js_of_ocaml.Js.t ->
unit Lwt.t ->
unit Lwt.t) ->
unit Lwt.tval touchcancels :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.touchEvent Js_of_ocaml.Js.t ->
unit Lwt.t ->
unit Lwt.t) ->
unit Lwt.tval focuses :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.focusEvent Js_of_ocaml.Js.t ->
unit Lwt.t ->
unit Lwt.t) ->
unit Lwt.tval blurs :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.focusEvent Js_of_ocaml.Js.t ->
unit Lwt.t ->
unit Lwt.t) ->
unit Lwt.tval scrolls :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tval submits :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.submitEvent Js_of_ocaml.Js.t ->
unit Lwt.t ->
unit Lwt.t) ->
unit Lwt.tval selects :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tval loads :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.imageElement Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tval errors :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.imageElement Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tval aborts :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.imageElement Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tval canplays :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tval canplaythroughs :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tval durationchanges :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tval emptieds :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tval endeds :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tval loadeddatas :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tval loadedmetadatas :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tval loadstarts :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tval pauses :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tval plays :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tval playings :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tval ratechanges :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tval seekeds :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tval seekings :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tval stalleds :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tval suspends :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tval volumechanges :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tval waitings :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tval lostpointercaptures :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.pointerEvent Js_of_ocaml.Js.t ->
unit Lwt.t ->
unit Lwt.t) ->
unit Lwt.tval gotpointercaptures :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.pointerEvent Js_of_ocaml.Js.t ->
unit Lwt.t ->
unit Lwt.t) ->
unit Lwt.tval pointerenters :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.pointerEvent Js_of_ocaml.Js.t ->
unit Lwt.t ->
unit Lwt.t) ->
unit Lwt.tval pointercancels :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.pointerEvent Js_of_ocaml.Js.t ->
unit Lwt.t ->
unit Lwt.t) ->
unit Lwt.tval pointerdowns :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.pointerEvent Js_of_ocaml.Js.t ->
unit Lwt.t ->
unit Lwt.t) ->
unit Lwt.tval pointerleaves :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.pointerEvent Js_of_ocaml.Js.t ->
unit Lwt.t ->
unit Lwt.t) ->
unit Lwt.tval pointermoves :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.pointerEvent Js_of_ocaml.Js.t ->
unit Lwt.t ->
unit Lwt.t) ->
unit Lwt.tval pointerouts :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.pointerEvent Js_of_ocaml.Js.t ->
unit Lwt.t ->
unit Lwt.t) ->
unit Lwt.tval pointerovers :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.pointerEvent Js_of_ocaml.Js.t ->
unit Lwt.t ->
unit Lwt.t) ->
unit Lwt.tval pointerups :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.pointerEvent Js_of_ocaml.Js.t ->
unit Lwt.t ->
unit Lwt.t) ->
unit Lwt.tval transitionends :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.transitionEvent Js_of_ocaml.Js.t ->
unit Lwt.t ->
unit Lwt.t) ->
unit Lwt.tval transitionstarts :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.transitionEvent Js_of_ocaml.Js.t ->
unit Lwt.t ->
unit Lwt.t) ->
unit Lwt.tval transitionruns :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.transitionEvent Js_of_ocaml.Js.t ->
unit Lwt.t ->
unit Lwt.t) ->
unit Lwt.tval transitioncancels :
?cancel_handler:bool ->
?use_capture:bool ->
?passive:bool ->
Js_of_ocaml.Dom_html.eventTarget Js_of_ocaml.Js.t ->
(Js_of_ocaml.Dom_html.transitionEvent Js_of_ocaml.Js.t ->
unit Lwt.t ->
unit Lwt.t) ->
unit Lwt.tReturns when a repaint of the window by the browser starts. (see JS method window.requestAnimationFrame)
val onload : unit -> Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t Lwt.tReturns when the page is loaded
val onunload : unit -> Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t Lwt.tval onbeforeunload : unit -> Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t Lwt.tval onresize : unit -> Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t Lwt.tval onorientationchange :
unit ->
Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t Lwt.tval onpopstate :
unit ->
Js_of_ocaml.Dom_html.popStateEvent Js_of_ocaml.Js.t Lwt.tval onhashchange :
unit ->
Js_of_ocaml.Dom_html.hashChangeEvent Js_of_ocaml.Js.t Lwt.tval onorientationchange_or_onresize :
unit ->
Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t Lwt.tval onresizes :
(Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tval onorientationchanges :
(Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tval onpopstates :
(Js_of_ocaml.Dom_html.popStateEvent Js_of_ocaml.Js.t ->
unit Lwt.t ->
unit Lwt.t) ->
unit Lwt.tval onhashchanges :
(Js_of_ocaml.Dom_html.hashChangeEvent Js_of_ocaml.Js.t ->
unit Lwt.t ->
unit Lwt.t) ->
unit Lwt.tval onorientationchanges_or_onresizes :
(Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tval limited_onresizes :
?elapsed_time:float ->
(Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tval limited_onorientationchanges :
?elapsed_time:float ->
(Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.tval limited_onorientationchanges_or_onresizes :
?elapsed_time:float ->
(Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t -> unit Lwt.t -> unit Lwt.t) ->
unit Lwt.t