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

Add typings #22

Closed
NULLx76 opened this issue Feb 27, 2019 · 6 comments
Closed

Add typings #22

NULLx76 opened this issue Feb 27, 2019 · 6 comments

Comments

@NULLx76
Copy link

NULLx76 commented Feb 27, 2019

It would be great if the types were also generated upon build and added to the dist so that when using the plugin with TS people can make use of the typings

@alecgibson
Copy link
Collaborator

I've had a very quick look at this, but getting the TypeScript definitions to play nicely with Webpack appears to be non-trivial. I've tried the following with no success:

I think this isn't working because we use default exports, which don't work very well when being combined into a single d.ts file. We could potentially move away from that, but it would be a breaking change, so I'd be inclined to leave it for if we want to make more big changes.

I probably don't have a lot of time to look into this, as it's a nice-to-have. Please feel free to raise a PR if you think you can crack it, though.

@RobbinBaauw
Copy link

A trivial but ugly solution (until it is possible to move away from default exports) would be making a definition file by hand. As there are not that many methods this should be very easy and quick. Thoughts on that?

@alecgibson
Copy link
Collaborator

Making one by hand is a bit icky in my opinion. I think I'd rather remove our default exports. I guess it's arguable that it's not a breaking change, because consumers shouldn't really have been trying to use anything other than the single point of entry into the module, and so long a that stays consistent, then it's fine. Or we just bump to v3 anyway. I guess it doesn't matter too much.

@pedrosanta
Copy link
Collaborator

Or we just bump to v3 anyway. I guess it doesn't matter too much.

Yeap. If it can be breaking better to bump, IMO.

@alecgibson
Copy link
Collaborator

Should now hopefully be fixed by #54

Release coming soon.

@vlazh
Copy link
Contributor

vlazh commented Feb 8, 2020

@alecgibson, can't wait for release!

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

5 participants