Gen_js_api: How to bind Js_of_ocaml.Js.t types

I want to bind a JS function that takes a Js_of_ocaml.Dom_html.document Js_of_ocaml.Js.t. Js.t is not “JS-able” since it does not have Js_of_ocaml.Js.t_to_js and t_of_js. Since gen_js_api uses the js_of_ocaml runtime, is the js_of_ocaml library treated in any special way? How would you write this binding in the most elegant way?

I will paraphrase the question: are 'a Js_of_ocaml.Js.t and Gen_js_api.Ojs.t conceptually the same thing? Can I cast freely one into the other?

I think so. This page should help :wink: