TypeScript code similar to Revealing Module Pattern structure
I want to convert some JavaScript code I've written into TypeScript. I'm rather new to TypeScript syntax and way of thinking, as a JavaScript developer. What is giving me a headache is the hard time I've had to convert some piece of code that uses the Revealing Module Pattern into TypeScript. One example is the below: //JS Code var obj; //code... (function(){ function myFunction(){ //do work } function MyOtherConstructor(){ return { publicMethod: myFunction } } obj = new MyOtherConstructor(); })(); //use obj.publicMethod in code later One workaround I've thought was this: //TypeScript code var