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