How to declare a function that throws an error in Typescript

后端 未结 4 907
孤独总比滥情好
孤独总比滥情好 2020-12-18 18:00

In Java I would declare a function like this:

public boolean Test(boolean test) throws Exception {
  if (test == true)
    return false;
  throw new Excepti         


        
4条回答
  •  遥遥无期
    2020-12-18 18:21

    It is not possible at this moment. You can check out this requested feature: https://github.com/microsoft/TypeScript/issues/13219

提交回复
热议问题