gen_js_api icon indicating copy to clipboard operation
gen_js_api copied to clipboard

Error: Unbound value Js_browser.Event.kind_to_js

Open bikallem opened this issue 1 year ago • 2 comments

Hi,

I am getting a build error in the title when I try to bind the following code,

module XMLHttpRequestUpload : sig
  type t
  val t_of_js: Ojs.t -> t
  val t_to_js: t -> Ojs.t

  val add_event_listener: t -> Event.kind -> (Event.t -> unit) -> bool -> unit [@@js.call]
end

Am I missing something here?

bikallem avatar Dec 02 '24 19:12 bikallem

The Event module is from https://github.com/LexiFi/ocaml-vdom/blob/master/lib/js_browser.mli#L166

bikallem avatar Dec 02 '24 19:12 bikallem

The Event module does not currently expose the _to_js / _of_js for its kind type, even though they are generated (and used) in the implementation. I think the fix would be to add those functions to interface.

alainfrisch avatar Dec 16 '24 13:12 alainfrisch