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

Bundle TypeScript definitions #102

Closed
bradleyayers opened this issue Nov 8, 2016 · 5 comments · Fixed by #103
Closed

Bundle TypeScript definitions #102

bradleyayers opened this issue Nov 8, 2016 · 5 comments · Fixed by #103

Comments

@bradleyayers
Copy link
Contributor

Would you be open to bundling a .d.ts TypeScript definition for this package, so that it can seamlessly be used from TypeScript?

There are existing definitions https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/classnames that could be copied over, so it should be fairly trivial.

@dcousens
Copy link
Collaborator

dcousens commented Nov 8, 2016

@bradleyayers I'm not opposed to the idea, its just a matter of the slippery slope.
Is there any reason why the DefinitelyTyped types wouldn't be suitable?

@bradleyayers
Copy link
Contributor Author

I went the DefinitelyTyped route initially, but hit a blocker because my project has two transitive dependencies on @types/classnames, which pulls in two sets of definitions that conflict (because they're global definitions).

I don't know of another solution here other than bundling the declaration files in the npm package.

@dcousens
Copy link
Collaborator

dcousens commented Nov 9, 2016

@bradleyayers how will this solve that unless everyone uses this packages type definitions?

@bradleyayers
Copy link
Contributor Author

I'm not sure I understand the question, but…

TypeScript automatically uses type definitions that are bundled in NPM packages, but someone could still use @types/classnames if they want (but they probably wouldn't want to, since it's more overhead).

The key difference with packaged definitions is that they don't need to introduce definitions globally. This means that multiple instances of a package can be used at the same, each providing their own definitions.

@dcousens
Copy link
Collaborator

dcousens commented Dec 8, 2016

Closing in favour of #103

@dcousens dcousens closed this as completed Dec 8, 2016
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 a pull request may close this issue.

2 participants