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

How to create index.d.ts for my code? #73

Closed
unional opened this issue Dec 12, 2015 · 2 comments
Closed

How to create index.d.ts for my code? #73

unional opened this issue Dec 12, 2015 · 2 comments

Comments

@unional
Copy link
Contributor

unional commented Dec 12, 2015

tsc --declaration src/index.ts --module commonjs wouldn't work because it doesn't know systemjs.

Is writing it by hand is the only way right now?

@frankwallis
Copy link
Owner

Even if it did work I don't think it would produce a single .d.ts file for your whole package (assuming your package is more than just this one file). To do that you need to use dts-generator or handcraft them. Hopefully this will get fixed by this issue

It should still be possible to generate the individual declaration files using tsc, even if the project is giving type errors. Maybe try tsc --declaration src/index.ts --module commonjs --moduleResolution classic? There is work being done to enable tsc to find the typings in jspm_packages (in the same way as it does currently in node_modules) and there is a related issue here

@unional
Copy link
Contributor Author

unional commented Dec 12, 2015

Thanks. I just post a comment on the last link. I agree that's what really needed. I have added logic on jspm to package a typescript module as-is into the jspm_packages, so with the resolution logic, I don't really need to generate the declaration files.

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