jfcere / ngx-malihu-scrollbar

Angular 2+ scrollbar customization using Malihu jQuery Custom Scrollbar plugin
https://jfcere.github.io/ngx-malihu-scrollbar
MIT License
58 stars 17 forks source link

Add field to package.json that tells TSC where to find type declarations #36

Closed quigleyj97 closed 6 years ago

quigleyj97 commented 6 years ago

This is necessary due to the way Typescript resolves declaration files in modules. Essentially, if there isn't a @types package found for it in /node_modules and there isn't any overrides found in the relevant tsconfig.json, then it will look for a field "types" in the module's package.json.

If it can't find the type declarations, you'll see an error on import if you have --noImplicitAny, and in either case TypeScript will fail to pull in the correct types.

Fixes #35

Relevant documentation: https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html

And a relevant issue: https://github.com/Microsoft/TypeScript/issues/9854

jfcere commented 6 years ago

Thanks for the PR!