Skip to main content

Posts

Showing posts with the label Named Internal Modules TypeScript

TypeScript - Named Internal Modules

What’s an Internal Module? You can define modules within your typescript files and all variables defined within the module are scoped to the module and removed from the global scope. You can access the variable outside the module using the export keyword and also you can extend internal modules, share them across files, and reference them using the triple slash.  Syntax - ( /// ) Named Internal Modules – Internal modules are come in earlier version of the Typescript and it was basically used to logically group classes, interfaces, and functions into one unit and it can be export in another module. Now this logically group named call “namespace” in latest version of TypeScript. So we can use namespace instead of internal modules in the TypeScript. As per me, this one is the best coding practice but don’t mind the internal modules are also supporting, if you want can use it. Example using module - module System.modules { //this function can be access...