The TypeScript docs are an open source project. For example, we can use the never as a return type when we are sure that the function will never return any value. is this blue one called 'threshold? A namespace is a way to logically group related code. As an example, you will create a DatabaseEntity namespace to hold database entities, as if you were using an Objectrelational mapping (ORM) library. This post outlines the various ways to organize your code using namespaces (previously internal modules) in TypeScript. "allowJs": true, How to rename a file based on a directory name? Perhaps for you this might work? We can create a namespace by using the namespace keyword followed by the namespace_name. Help us improve these pages by sending a Pull Request , How to provide types to functions in JavaScript, How to provide a type shape to JavaScript objects, How TypeScript infers types based on runtime behavior, How to create and type JavaScript variables, An overview of building a TypeScript web app, All the configuration options for a project, How to provide types to JavaScript ES6 classes, Made with in Redmond, Boston, SF & Dublin. Note: All other issues here on SO that I've found are Angular related and/or have an entirely different setup than this. Can state or city police officers enforce the FCC regulations? So, you don't instantiate the type, you merely cast the runtime variable (in your case loginResult) to the type you need to cast it to.