Specify method's type without converting the method to property

前端 未结 1 717
小鲜肉
小鲜肉 2020-11-29 14:11

Let\'s say, I have a method that delegates its functionality to some method from external library, and I have a type for that external method, e.g. LibDoStuffMethodTyp

相关标签:
1条回答
  • 2020-11-29 14:26

    There's an existing suggestion to allow function statements (and presumably method definitions) to be typed using a function/callable type alias or interface. Doesn't look like there's much traction there, but if you believe you have a strong use case, you might want to go there and give it a

    0 讨论(0)
提交回复
热议问题