I wanted to move to TypeScript from traditional JS because I like the C#-like syntax. My problem is that I can\'t find out how to declare static classes in TypeScript.
With ES6 external modules this can be achieved like so:
// privately scoped array
let arr = [];
export let ArrayModule = {
add: x => arr.push(x),
print: () => console.log(arr),
}
This prevents the use of internal modules and namespaces which is considered bad practice by TSLint [1] [2], allows private and public scoping and prevents the initialisation of unwanted class objects.