-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Custom Typings - How To #11329
Comments
What do you mean by "Custom Typings"? what are you looking for specifically? |
meaning that if I create a NPM library that isn't hosted in NPM but rather a private repo. |
so it doesn't appear in the typings folder |
is it a module? |
Yes it is |
so let's say you have your declaration file for the module in {
"compilerOptions": {
"baseUrl": "./",
"paths":{
"@private/*": ["types/@private/*"]
}
}
} would this work? |
The ideal case would be the use of |
So what the "paths" options is designed for? That confuses me. |
what are you trying to do? |
@towertop The |
Alternatively: Since your packages are private, write your own private @types/module-name package, then point npm at it via your package.json. Its higher effort, but, IMO, a much neater solution than managing mappings within your tsconfig. Since your package is private, why not have a private package for its types? |
Thanks @DanielRosenwasser , I got it. @mhegazy I was confused which is preferred when "typeRoots" and "paths" both help to patch declarations for external module. |
Can someone please once and for all post how to do custom typings in Typescript 2.0+. I have seen multiple answers all over stackoverflow and other sites all of which are wrong. Can someone from the team please let me know what the deal is?
The text was updated successfully, but these errors were encountered: