DefinitelyTyped / tsd

[DEPRECATED] TypeScript Definition manager for DefinitelyTyped
Apache License 2.0
1.12k stars 135 forks source link

Multiple version definitions for one library in tsd.d.ts - how references are resolved? #267

Closed cosmosb closed 8 years ago

cosmosb commented 8 years ago

I have project which uses node v0.12.x and I want to add type definitions only for this version of Node.

Running these two commands:

1 - tsd query node -v "=0.12.0" -rso --action install 2 - tsd install gulp -rso

produced following in tsd.d.ts:

/// <reference path="node/node-0.12.d.ts" />
/// <reference path="gulp/gulp.d.ts" />
/// <reference path="node/node.d.ts" />
/// <reference path="orchestrator/orchestrator.d.ts" />
/// <reference path="q/Q.d.ts" />

So there are multiple definitions for Node in tsd.d.ts. How would it be resolved? "node.d.ts" refers to latest node version. I'm using Visual Studio Code.

Thanks.

blakeembrey commented 8 years ago

@cosmosb I don't believe this will be solvable with TSD because each file has individual references to node.d.ts. If you're willing, you can use https://github.com/typings/typings to solve this.

basarat commented 8 years ago

@cosmosb There can be only one version of node definition.

 tsd query node -v "=0.12.0" -rso --action install

Don't specify a version flag. The other definitions explicitly depend on latest node.d.ts and you cannot do that without conflict :rose: