How to include ambient module declarations inside another ambient module?

后端 未结 1 1439
孤街浪徒
孤街浪徒 2021-01-11 20:19

I have an ambient .d.ts module which directly depends on Immutable:

/// 

        
1条回答
  •  天涯浪人
    2021-01-11 20:53

    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:

    /// 
    
    declare module 'morearty' {
        import I = require('immutable');
    }
    

    0 讨论(0)
提交回复
热议问题