I'm trying to document an enum like this:
/**
* Enum for the different types of tokens
* @memberof Ecre
* @enum {number}
* @readonly
*/
Ecre.TokenTypes = Object.freeze({
/**
* A string token
*/
"string": 1,
"comment": 2,
"number": 3,
"boolean": 4,
"identifier": 5
});
But this doesn't not work as excepted: string is being document as a global.
How can I achieve that the values are documented in a proper way?
I'm using JSDoc 3.3.0-alpha9 (Sat, 28 Jun 2014 15:26:03 GMT)
It's pretty old question, but an answer still could be helpful. Since Object.freeze freezes the object, you can call it after enum is defined.
/**
* Enum for the different types of tokens
* @memberof Ecre
* @enum {number}
* @readonly
*/
Ecre.TokenTypes = {
"string": 1,
"comment": 2,
"number": 3,
"boolean": 4,
"identifier": 5
};
Object.freeze(Ecre.TokenTypes);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With