Closed spiffytech closed 8 years ago
@spiffytech The vast majority of the individual modules are now available through the @types organization in their first version. The key exceptions are d3-dsv, d3-request and the definition file for the the standard D3 bundle d3. These are currently in a PR on DefinitelyTyped, as a couple of transition issues need to be addressed with respect to legacy version definitions for d3 (version 3.5.17) and d3-dsv. Hopefully, they can be resolved in a timely matter.
If you have a look at the Module-Level Status section of the README, you will find an updated status. Where in initial version is available on @types, you can simply install the definition with e.g.
npm install @types/d3-selection --save
When you install them this way, TS2 will resolve the definitions correctly without any need for typings to be used.
I will in short order push a few minor follow-ups through a PR to these initial files, which will eventually also propagate to @types.
In turn, while I appreciate your comment and the offered PR, the above should address your issue.
(Assuming you are using D3 modules in a module import pattern and not as vanilla scripts with the d3
global. In which case, I am already tracking an issue for the vanilla script scenario.)
So I would prefer not to make the change to this repo at present. Provided all migration related issues can be addressed satisfactorily, there should be no need for it. I would only consider restructuring this repo for "production use", if a material issue cannot be addressed with DefinitelyTyped being the primary source (feeding @types).
Ah, TIL. I misunderstood the relationship between typings
and @types, and got confused when typings search
showed some, but not all, d3 typings available from npm.
I've installed directly from npm as you directed, and all is well. Thanks!
http://stackoverflow.com/questions/39344686/using-typescript-2-types-with-typescript-1-8-10
i'll be happy to get an answer if possible.
Since DefinitelyTyped branch types-2.0 doesn't look deployed yet, I'm trying to install the v4 typings directly from GitHub.
typings
is getting confused byd3-zoom
andd3-drag
's reference tod3-selection
, since it's not correctly guessingd3-selection
is a folder it should peek inside of.The following fix inside
d3-drag
&d3-zoom
works locally:Is this fix acceptable (I can submit a PR). Else, is there a better way to get the v4 definitions before DT has caught up?