I have an ambient .d.ts
module which directly depends on Immutable:
///
Ambient external modules cannot be nested in other modules.
Using an import
or export
at the root of a file creates a file module. That explains the error nested module.
Fix: Import inside and not at the root of the file:
/// <reference path="../node_modules/immutable/dist/immutable.d.ts" />
declare module 'morearty' {
import I = require('immutable');
}