-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
@types/d3-hexbin and @types/d3 coexistence as global libraries #19402
Comments
Unfortunately, you are running into a known limitation of the TypeScript compiler. When creating a TS definition file which is meant to export a global, one adds a line such as: export as namespace d3; In the definitions for D3, this line is added to the definition file that re-exports all the constituent modules of the "standard" bundle. As a matter of TS compiler design, this statement can only be added once. Adding it a second time, e.g. in d3-hexbin, because D3 convention is to export into the same Workaround: So, I am afraid, the only suggestion I can make, is to write and use a custom definition file in your project which re-exports the D3 modules you require similar to the current D3 bundle definitions file and includes export * from 'd3-hexbin'; Then you have only one |
@hugoferreira Just checking in to see what the status of the issue is on your side? |
@hugoferreira Any update from your side? Can this issue be closed given the TS limitations/workaround outlined above, or do you require further issues management? Cheers, T |
Is this still an issue or can it be closed? Thx for a status confirmation. |
@andy-ms As a matter of maintaining open issues, could you kindly close this issue? There has been no update despite several inquiries. Thx in advance. @hugoferreira Feel free to provide any new status/information to trigger a re-opening. |
@types/d3-hexbin
package and had problems.Definitions by:
inindex.d.ts
) so they can respond.So, I'm using
d3
andd3-hexbin
as global libraries:... and referencing them in
.ts
as:However, although this works:
... this:
... fails with a :
By looking at the tests, I can see that:
Would export the
hexbin()
function directly into thed3Hexbin
namespace, but I'm unable to figure out how to conciliate this withd3-hexbin
as a global library.The text was updated successfully, but these errors were encountered: