In TypeScript, how to specify method chaining result type if methods can alter that type?

前端 未结 0 342
独厮守ぢ
独厮守ぢ 2021-01-31 03:12

Suppose I want to achieve the following behavior:

const x = new ChainableClass();
x.get(); // -> any[] (default)
x.all().get(); // -> any[]
x.sin         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题