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

configure package.json to emit typescript declarations #468

Closed
wants to merge 2 commits into from

Conversation

quachc
Copy link

@quachc quachc commented Jul 1, 2022

Proposal to fix #285.
Sadly, tsc fails because of private classes which are (implicitly?) imported.
Execute npm run ts-declarations (I didn't use Yarn) to show the error messages.

You can change --outFile dist/index.d.ts to --outDir dist/types to generate .d.ts files for each JavaScript file.

@bjornharrtell
Copy link
Owner

Hmm interesting.. so there could be value to let tsc compile and create the type declarations even if those would be "any" all over the place (I guess?)

@quachc
Copy link
Author

quachc commented Jul 11, 2022

It kinda slipped my mind, but you can do a lot with JSDoc (which I believe you already migrate from JavaDoc); https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html

@bjornharrtell
Copy link
Owner

@quachc I don't think it's less work to process and generate jsdoc vs generate TS directly, the latter being more desirable. Both require a serious effort though.

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.

Publish TypeScript typings
2 participants