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

Type Definitions missing #121

Closed
Crisfole opened this issue Jul 10, 2023 · 3 comments
Closed

Type Definitions missing #121

Crisfole opened this issue Jul 10, 2023 · 3 comments

Comments

@Crisfole
Copy link

Crisfole commented Jul 10, 2023

I'm trying to use precinct from typescript, but it complains that:

Could not find a declaration file for module 'precinct'.

I think it'd be well worth adding some jsdoc style type definitions and distributing them. Since you already have jsdoc style type definitions you should extract them and distribute them. The package.json can add a types field to point typescript at the right location.

@Crisfole
Copy link
Author

@Crisfole
Copy link
Author

npx tsc index.js --declaration --allowJs --emitDeclarationOnly --outDir types

OK, I've tested the above. Works beautifully. Then you can do "types": "types/index.d.ts" in package.json and make all us type nerds happy ;)

@XhmikosR
Copy link
Member

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