What's the difference between declaring a module in TypeScript with quotes vs without?

后端 未结 1 1815
天涯浪人
天涯浪人 2021-01-17 20:35

I am a beginning at writing TypeScript definition files and would like to know the difference between the following two constructs:

declare module activedire         


        
1条回答
  •  伪装坚强ぢ
    2021-01-17 21:06

    The TypeScript team recognized the confusion, and that's why modules without quotes are now called namespaces.

    Going forward, internal modules will be called ‘namespace’. We chose to use this term because of the closeness between how this form works and namespaces in other languages [...] http://blogs.msdn.com/b/typescript/archive/2015/07/20/announcing-typescript-1-5.aspx

    The quoted modules are ES6 modules, and need to be be imported using an import statement like import 'activedirectory';

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