gen_js_api
gen_js_api copied to clipboard
Easy OCaml bindings for Javascript libraries
To support effect handlers, we are changing the calling convention of OCaml functions. See https://github.com/ocsigen/js_of_ocaml/pull/1340. Wrapping Ocaml functions is now mandatory to use them from JavaScript.
TypeScript very often has the following unions defined: ```typescript export type AccessorDeclaration = GetAccessorDeclaration | SetAccessorDeclaration; export interface TypeOperatorNode extends TypeNode { readonly kind: SyntaxKind.TypeOperator; readonly operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword...
Typescript definitions often define ad-hoc object types for parameters or return values, like this for example: ```typescript class TimeUuid extends Uuid { /* ... */ getDatePrecision(): { date: Date, ticks:...
It's possible to wrap JS class with OCaml one, and it's possible to have some other OCaml class inherit from that base JS class and provide alternative implementation for some...
I'm trying to bind the following TypeScript definition: ```typescript export type ValueCallback = (err: Error, val: T) => void; ``` Naive approach results in this error: ``` File "out.mli", line...
When a gen_js_api function is called there is currently no way to know which is the Javascript code executed when the function is used. This renders the definition of the...
It's recommended that every library has a single toplevel module, and `(wrapped false)` is only there to help people transition to dune. Would it be ok to break compatibility and...
Input (`.ml` file): ```ml include [%js: module M: sig type t end ] ``` Generates (simplified): ```ml include ( struct module M = struct type t = Ojs.t let rec...
There are JavaScript functions that expect the value `undefined` to be passed to them, not `null`. gen_js_api doesn't provide (as far as I know) a way to do this, as...
All information about how works the require attribute are in the document REQUIRE.md; it contains three kind of usage, and the meaning of each automatic rules when under the require...