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

Using TSCC As an Externs Generator #619

Open
yishayw opened this issue Nov 12, 2021 · 1 comment
Open

Using TSCC As an Externs Generator #619

yishayw opened this issue Nov 12, 2021 · 1 comment

Comments

@yishayw
Copy link

yishayw commented Nov 12, 2021

I'd like to use tscc tp generate some externs files from d.ts files, similar to what's found on the closure externs repo, using definitely typed as input. Do you think that's viable? If so, do you have some pointers on how to achieve that? Thanks!

@theseanl
Copy link
Owner

Most of existing d.ts files are module, not script s. tsickle generate correct externs for script d.ts files, but currently there are several bugs in tsickle regarding generation of externs from module d.ts files, such as angular/tsickle#1202 angular/tsickle#1135 angular/tsickle#1203.

Also, there are always typescript types that cannot be translated to closure types.

Viability would depend on your goal -- if you are trying to generate correct externs, tsickle is still incomplete in several aspects. If the generated externs just need to work with closure compiler, I'd say it is viable (except for export * in module d.ts.), because minor issues with generated externs don't affect compilation much, and you can workaround minor type incompatibility issues by carefully typing things.

I have submitted several PRs to the upstream tsickle repository to fix above issues, but after some time they all stalled with no further response from tsickle devs.

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