Up

module EventSource

: sig

EventSource binding

#
type state =
# | CONNECTING
# | OPEN
# | CLOSED
#
class type ['a] messageEvent =
inherit ['a] Dom.event
#
method data : Js.js_string Js.t Js.readonly_prop
#
method origin : Js.js_string Js.t Js.readonly_prop
#
method lastEventId : Js.js_string Js.t Js.readonly_prop
#
class type eventSource = ('self)
#
method url : string Js.t Js.readonly_prop
#
method withCredentials : bool Js.t Js.readonly_prop
#
method readyState : state Js.readonly_prop
#
method close : unit Js.meth
#
method onopen : ('self Js.t, 'self messageEvent Js.t) Dom.event_listener Js.writeonly_prop
#
method onmessage : ('self Js.t, 'self messageEvent Js.t) Dom.event_listener Js.writeonly_prop
#
method onerror : ('self Js.t, 'self messageEvent Js.t) Dom.event_listener Js.writeonly_prop
#
class type options =
#
method withCredentials : bool Js.t Js.writeonly_prop
#
val withCredentials : bool -> options Js.t
#
val eventSource : (Js.js_string Js.t -> eventSource Js.t) Js.constr
#
val eventSource_options : (Js.js_string Js.t -> options Js.t -> eventSource Js.t) Js.constr
#
val addEventListener : (eventSource Js.t as 'a) -> 'b Dom.Event.typ -> ('a, 'b) Dom.event_listener -> bool Js.t -> Dom.event_listener_id

Add an event listener. This function matches the addEventListener DOM method, except that it returns an id for removing the listener.

end