TypeScript definitions
See original GitHub issueIn working on the release notes, I realize a lot of the documentation involves being very specific about all the different overloads we support.
For TypeScript users – and indeed many non-TS users whose editors interpret the TypeScript defs – the type definitions will be the most useful way to understand how to use the functions.
I’d like to propose that we bring the type definitions in house and maintain them in this repository. This should make it easier to keep the types in sync with the API as it changes, increases the likelihood that the types are correct, and lets use ship up-to-date types in unreleased branches (e.g. future beta
branches).
As TypeScript has become really common, I think it’s reasonable to consider it a core part of the library’s use case, rather than a fringe part.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:6 (3 by maintainers)
import nock from 'nock'
is all it takes.As a dev who uses nock with TS almost exclusively, I would be a fan of this decision.
I’m one of the “owners” of the types currently in DT, and I’ve gone through the process of migrating and decommissioning DT types before, so I’d be happy to work on this.
relates to: #1589