ocsigen / ts2ocaml

Generate OCaml bindings from TypeScript definitions via the TypeScript compiler API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Emit [@@js.builder] if the interface is POJO (i.e. no methods)

cannorin opened this issue · comments

interface Person {
  name: string;
  age: number;
  children?: Person[];
}
module Person: sig
  type t
  val create: ~name:string -> ~age:int -> ?children:t list -> t [@@js.builder]
end

Maybe we should add unsafe cast functions too?