Wrap immutable.d.ts type declarations in a module to avoid a global declaration #1869
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The problem:
When using the type-definitions, you provide right now, this is possible and does not get detected not even by running

tsc
:Notice, there's no import statement. When the code is run, it errors out, unless ProvidePlugin is used in WebPack to add the necessary import.
This is due to the global nature of the namespace declaration.
The solution:
Take the namespace declaration out of the global.


With the type definitions proposed in the pull request this happens:
Despite the form of import being proposed when imported the prefered way, it works just fine.
Tests pass as far as they can on a windows machine. Your npm scripts for
build:prepare
are not windows compatible as the shebang notation has no effect on windows. But maybe adding the shebang to the package.json directly, resulting in"build:prepare": "sh -e ./resources/prepare-dist.sh"
might help. Most unix-based devices have alias for "sh" to the preferred shell. Be itksh
on a mac orbash
on linux machines.