Support searching for package types TypeScript / Flow
See original GitHub issueAllow to search for main entry types file from package.json if exists, or link to definitelytyped if exists
Candidates for keywords
- ~
t
not available (list of git tags)~ dt
from definitelytypeddts
from *.d.tsts
typescript types *.tsft
flow typedflow
flow types *.flowtypes
for both TypeScript and Flow, but better to have them separated
Think would be better to have different keywords for TypeScript and Flow
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Support for TypeScript definition files · Issue #7 · facebook/flow
I've been thinking about creating a bot that would send PR's to npm packages with both Flow and TypeScript type definitions, with instructions ......
Read more >Documentation - ECMAScript Modules in Node.js - TypeScript
Node.js supports a new setting in package.json called type . "type" can be set to either "module" or "commonjs" . ... This setting...
Read more >Documentation - Type Declarations - TypeScript
TypeScript automatically finds type definitions under node_modules/@types , so there's no other step needed to get these types available in your program. Your ......
Read more >Documentation - TypeScript 4.7
Node.js supports a new setting in package.json called type . ... Under the mode "auto" , TypeScript will not only look for import...
Read more >Documentation - Module Resolution - TypeScript
These strategies tell the compiler where to look for moduleA . ... TypeScript will also use a field in package.json named types to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You are killing all my PR’s 😄
Actually I did not thought to search for
njt @types/PACKAGE
. It makes sense. Thanks for making this clear to me I think this can be closed.Thanks again for
njt
🙂I’ll go and add a OpenSearch definition for https://www.typescriptlang.org/dt/search?search=
How do you do this without njt? At what stage and what for?
My workflow:
Add a package I’m interested in
Add an import into one of my project files
If autocompletion kicks in, typings are there so I don’t need to do anything. If VSCode highlights the first character of the import with a dashed line, this means that the package missing the typings. In that case, I do
njt @types/PACKAGE
, take a quick glance at the number of weekly downloads andyarn add -D @types/PACKAGE
.If I need to refer to a typing of a particular package resource, I command+click on the symbol and get straight to a corresponding
.d.ts
file innode_modules
. No need to manually navigate to the package repo or explore the@types/PACKAGE
folder on GitHub.If the presence of typings affects the decision to install a package, then https://www.typescriptlang.org/dt/search is the tool to check. If a package is found, typings are available. A hexagon icon means that they are built in, a square with DT in it means that the typings are in DefinietelyTyped repo.
If you still believe that there is scope for a new feature in
njt
, happy to discuss the added value, the use cases and the spec. Note that adding keywords of 2+ chars affects the simplicity of the tool, so this leap needs to be really well justified.