ocsigen / ts2ocaml

Generate OCaml bindings from TypeScript definitions via the TypeScript compiler API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TODOs

cannorin opened this issue · comments

  • PromiseLike, ArrayLike のような FooLike があるとき,Foo がそれを継承している扱いにする(ちゃんと包含関係になっているかは自前でチェックする)
  • クラス・インターフェースが [Symbol.iterator]() : Iterator<T> みたいなメンバを持っているとき,Iterator<T> を継承している扱いにする.(IterableIterator<T> の場合も同様)
  • polymorphic this をちゃんと polymorphic にする.以下のように this を定義してそれを使う:
type ('T1, 'T2, ..., 'tags) this = 'tags intf
  constraint 'tags = [> ('T1, 'T2, ...) tags]
[@@js.custom { of_js=(fun ... -> Obj.magic); to_js=(fun... -> Obj.magic) }]
  • --simplify-immediate-instance に ignore case モードを追加
  • 以下のようなやつをいい感じにする:
interface AnimationTimeline {
    readonly currentTime: number | null;
}

declare var AnimationTimeline: {
    prototype: AnimationTimeline;
    new(): AnimationTimeline;
};
  • 要検討: t_n types や tags_n types を Overloads みたいなサブモジュールに突っ込むべきか?
  • 要検討: A :> B かつ AB が相互再帰になっていないとき,A 内で include module type of B するべきか?
    • その際は メソッドのみを Methods みたいなサブモジュールに突っ込み,include module type of B.Methods とするべきか?
    • もし相互再帰だった場合どうするか?