How do I search for TypeScript typings in my web browser?

460 views Asked by At

I feel like this should be obvious and at least already asked, but after search for it both on DefinitelyTyped and here I couldn't find anything.

How do I search for TypeScript typings for libraries I'm trying to use, without resorting to a command-line tool? I feel like there should be a search bar on DefinitelyTyped.org, but I can only find a link to the GitHub repo containing typings, but that's truncated so I can't see all typings.

What obvious thing am I missing?

2

There are 2 answers

1
toskv On BEST ANSWER

If you use the @types feature you can search for them here.

1
alechill On

As @toskv has already correctly commented you can use the @types search, but just wanted to add... do be aware that the defs in @types are still undergoing some migration via the DefinitelyTyped types-2.0 branch, and so doesn't necessarily have all the definition files that the main registry does, nor is completely up to date with bug fixes etc.

For example just today I was migrating some defs from typings to @types and found that the react-dnd-test-backend.d.ts defs have not made it into @types yet

In these cases, obvious as it may be, I would simply use the search bound to the GitHub DefinitelyTyped repo using the module name (as they are always identified by them, so yields quick results), and then use typings to manage it during the transition, which can be used perfectly well in addition to @types