I tried to do something like @param {window.MyNamespace.MyEnum} myVar , but the compiler complained about JSC_TYPE_PARSE_ERROR: Bad type annotation. Unknown type window.MyNamespace.MyEnum JSC_TYPE_PARSE_ERROR: Bad type annotation. Unknown type window.MyNamespace.MyEnum .
Should I make @typedef an enumeration or just use @param {number} if my enum is @enum {number} ? I really prefer the enumeration, as other values ββare really not allowed.
(function (MyNamespace) { MyNamespace.MyEnum = { FOO: 1, BAR: 2, BAZ: 3 } MyNamespace.MyClass = function (foo) { this.foo = foo } MyNamespace.MyOtherClass = function (bar) { this.bar = bar } MyNamespace.MyOtherClass.prototype.someMethod = function (baz) { } })(window.MyNamespace = window.MyNamespace || {})
source share