Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support type definition packages #25633

Open
happyhunter7 opened this issue Sep 14, 2024 · 0 comments
Open

Support type definition packages #25633

happyhunter7 opened this issue Sep 14, 2024 · 0 comments

Comments

@happyhunter7
Copy link

Let's say I install a package from npm by adding this to my deno.json imports (Any package, just as example)

"@types/yargs": "npm:@types/yargs",
"yargs": "npm:yargs"

Now in my code where I use the import I always have to add the types comment to it in order to have correct IDE complition and properly understand what method and what arguments and what types it takes

// @deno-types="@types/yargs"
import yargs from 'yargs'

My proposal is, may be to support something like that in the imports statements:

imports: {
   "yargs": {
       "types":  "npm:@types/yargs",
       "package": "npm:yargs"
   }
}

At least this)
ideally Deno should resolve the type definitions as Node js does, an not have to do all these workasounds
But at least something rather than adding comments in the code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant