Should TypeScript Interfaces Be Defined in *.d.ts Files

前端 未结 3 1183
我在风中等你
我在风中等你 2021-02-04 00:00

TypeScript newbie question. In our project, we are using some external JavaScript libraries where we needed to add *.d.ts files. I understand this use case and the reason why we

3条回答
  •  余生分开走
    2021-02-04 00:53

    Are you using typings? That seems to be the community way to manage third party types. That way you don't have to manage defining other developers' APIs.

    As a point of reference the Node environment d.ts appears to just define the (err, res) callbacks throughout the API (https://github.com/typed-typings/env-node/blob/master/6/node.d.ts)

提交回复
热议问题