What is namespace in Typescript? How to declare a namespace in Typescript?

devquora
devquora

Posted On: Feb 22, 2018

 

Internal Modules are known as namespaces in Typescript.Namespaces are used to maintain the legacy code of typescript interally. A namespace is simply a way to logically group related classes or interfaces in a wrapper.
Synatax for creating namespace in Typescript
namespace YourNameSpace { 
   export class Class1 {  }  
   export class Class2 {  }  
} 

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    Typescript Interview Questions

    What is Typescript?

    Typescript is a free and open-source programming language which is designed and developed by Microsoft. It was designed ..

    Typescript Interview Questions

    List some features of Typescript?

    Features of Typescript are:- Typescript can be compiled to all major versions of Javascript(ES3,ES5,ES6,ES7). Typescrip..

    Typescript Interview Questions

    List some benefits of using Typescript?

    Following are some benefits of using Typescript One of the biggest advantages of Typescript is its code completion and ..