I need to implement Singleton pattern in TypeScript. I have found a solution here but it seems like an overkill for me. After all, JavaScript is great in creating singletons.
Is it possible to write in TypeScript something like this (without getting an error)?
module Helpers {
Helpers.Singleton = {};
}
Currently, it correctly generates the output that I am expecting:
// Module
var Helpers;
(function (Helpers) {
Helpers.Singleton = {};
})(Helpers || (Helpers = {}));
But why is TypeScript compiler inside my VisualStudio complaining about that (it says that it "Could not find symbol 'Helpers'." at line 2!)? Is it possible to write it in another way?
