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

Make TypeScript declaration files usable in Node projects #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alex-ng-wesoft
Copy link

PR #19 added a type declaration file for the library, but didn't add it in a way that TypeScript is able to find per https://www.typescriptlang.org/docs/handbook/module-resolution.html#how-typescript-resolves-modules.

It's likely that in 2017 this was fine, but in 2022 it means code like this:

import "gasparesganga-jquery-loading-overlay";

... will not result in type definitions being included as well, which is annoying.

This commit fixes this by taking the strategy outlined by https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html#including-declarations-in-your-npm-package where package.json is updated to point to the declaration file.

PR gasparesganga#19 added a type declaration file for the library, but didn't add it
in a way that TypeScript is able to find per
https://www.typescriptlang.org/docs/handbook/module-resolution.html#how-typescript-resolves-modules .

It's likely that in 2017 this was fine, but in 2022 it means code like
this:
```TypeScript
import "gasparesganga-jquery-loading-overlay";
```
... will not result in type definitions being included as well, which is
annoying.

This commit fixes this by taking the strategy outlined by
https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html#including-declarations-in-your-npm-package
where `package.json` is updated to point to the declaration file.
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

Successfully merging this pull request may close these issues.

1 participant