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

Typescript #12

Open
theoparis opened this issue Feb 1, 2021 · 7 comments
Open

Typescript #12

theoparis opened this issue Feb 1, 2021 · 7 comments

Comments

@theoparis
Copy link
Contributor

Is it possible to have typescript declarations implemented in this project? I really like that its up to date (9 days ago) and that there's a lot of options/customizablilty. However, it doesn't seem like its ts-compatible :/

** Can you make these changes in a PR **
I could make a PR if you need me to.

@Irrelon
Copy link
Owner

Irrelon commented Feb 1, 2021

Hi there. Most of the functions are typed already via JSDoc. Are you able to read types from that?

@theoparis
Copy link
Contributor Author

Yes, however my ide complains that it does have declaration types. Maybe there's a way to generate them from jsdoc?

The error:

Could not find a declaration file for module '@irrelon/path'. 

@theoparis
Copy link
Contributor Author

I think I found a way to do this, I am going to create pr if it works.

@theoparis
Copy link
Contributor Author

Also, shouldn't the main field in package.json point to dist instead of src?

@Irrelon
Copy link
Owner

Irrelon commented Feb 1, 2021

Cool let me know how it goes.

@Irrelon
Copy link
Owner

Irrelon commented Feb 1, 2021

As far as dist vs src, dist is for browser compat. Src works in node and any projects that have Babel or es6 capability. Requiring the package from node and having it load from dist would include a bunch of module compatibility wrapper code that is totally not required. That’s the rationale. I think there is a browser field that points to dist if I remember correctly.

@theoparis
Copy link
Contributor Author

theoparis commented Feb 1, 2021

Closed by #13

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

2 participants