Module vs Namespace - Import vs Require Typescript

后端 未结 5 1249
攒了一身酷
攒了一身酷 2020-12-04 05:14

I am getting lot of confusion with module/namespace/export and import, require, reference usage. Being from Java background, Can someone explain me

5条回答
  •  隐瞒了意图╮
    2020-12-04 05:50

    1. module is for external packages 2. namespace is for internal packages

    Actually the module keyword has been replaced with the namespace keyword.

    A better statement is thus Modules are what used to be called external modules, namespace is what used to be called internal modules.

    More

    Hope this helps futher : https://basarat.gitbooks.io/typescript/content/docs/project/modules.html

提交回复
热议问题