Repository navigation
Add ability to generate ambient declarations for external commonjs modules #1236
Description
Activity
basarat commented
on Nov 21, 2014 ContributorAuthorMore actionscurrent workaround : https://github.com/TypeStrong/dts-bundle and https://github.com/TypeStrong/grunt-dts-bundle
This is related to, if not a duplicate of #575
Also I completely agree with emphasis. This is by far the biggest road block when trying to make use of Typescript within our organization.
Absolutely 👍
The dts-bundle package (an admitted kludge) is the only way I was able to find to make commonjs modules resusable across projects. It was painful enough that I just switched to internal modules and shoved all the dependency management into my build script. Would be awesome to have commonjs modules "just work".
- addedSuggestionAn idea for TypeScriptAn idea for TypeScriptNeeds ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.This issue needs a plan that clarifies the finer details of how it could be implemented.
on Nov 24, 2014 I believe this is a duplicate of, or very related to #17
We're using dts-bundle to get around this, it'd be great to have compiler support.
+1. We really really really need this.
+1. It would be really useful.
👍
We need tsc allow below syntax.$ cat index.d.ts // hand assemble declare module "foobar" { export * from "./lib/main"; }but, now we got below error message.
$ tsc --module commonjs index.d.ts index.d.ts(3,3): error TS2439: Import or export declaration in an ambient module declaration cannot reference module through relative module name.Reacted by Szymon Wygnański, Matt Filion and Dugagjin Lashi+1
basarat commented
on Mar 1, 2016 ContributorAuthorMore actionsNow that the compiler supports node module resolution this can be closed as far as I am concerned 🌹
- removedNeeds ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.This issue needs a plan that clarifies the finer details of how it could be implemented.
on Mar 1, 2016 RyanCavanaugh commented
on Mar 1, 2016 MemberMore actionsIf Basarat Ali Syed (@basarat) says it's good it's good with me too 😃
Basarat Ali Syed (@basarat) can you show how this can be done? I want to do the very thing the error is saying cannot be done. What is the alternative?
'Import or export declaration in an ambient module declaration cannot reference module through relative module name.'Reacted by Dugagjin Lashi+1
- locked and limited conversation to collaborators
on Jun 25, 2018
Badly needed for commonjs modules where you are more likely to ship JS code plus a generated
.d.tsfile.From codeplex : https://typescript.codeplex.com/workitem/2080