question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeScript definitions

See original GitHub issue

In 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:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
mastermattcommented, Jan 18, 2022

import nock from 'nock' is all it takes.

1reaction
mastermattcommented, Aug 15, 2019

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation - Type Declarations - TypeScript
Built-in Type Definitions. TypeScript includes declaration files for all of the standardized built-in APIs available in JavaScript runtimes.
Read more >
Documentation - Advanced Types - TypeScript
This page lists some of the more advanced ways in which you can model types, it works in tandem with the Utility Types...
Read more >
Documentation - Introduction - TypeScript
The Declaration Files section is designed to teach you how to write a high-quality TypeScript Declaration File. We need to assume basic familiarity...
Read more >
The repository for high quality TypeScript type definitions.
The repository for high quality TypeScript type definitions. - GitHub - DefinitelyTyped/DefinitelyTyped: The repository for high quality TypeScript type ...
Read more >
TypeScript Definitions | Developer's Guide - GrapeCity
Hence, all the DataViewsJS packages on npm include TypeScript definitions. These TypeScript declaration (d.ts) files provide the type checking and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found