Sree11
Sree11

Reputation: 1007

Modules vs Typings in Typescript?

I have tried researching everywhere .but i couldn't understand what is the actual difference between modules and typings in typescript?I'm new to typescript ,can someone explain it in a brief?

Upvotes: 1

Views: 39

Answers (1)

Amid
Amid

Reputation: 22342

Lets give it a try:

  • Modules are an actual piece of code that gets compiled down to javascript and can be executed. Typescript modules also contains all type information needed - and this a big plus as it helps to see many of the possible bugs at compile time + nice intellisence features in your IDE.

  • Typings are just description of some other javascript code. They are never compiled down to any javascript and serve only declarative purpose of providing missing type information for already existing javascript libraries.

Upvotes: 2

Related Questions