const TYPES = {
"key-one": 1,
"key.two": 2,
"keyt<>three": 3
};
function chooseType(t) {
return TYPES[t];
}
chooseType("key-one");So, the value of "t" parameter should be only one of keys of TYPES object.
Those keys are strings and may contain non-alpabet chars.
So I don't understand, how to correctly make JSDoc to describe it.
I know about enumerating all possible values in jsdoc such way:
/** @param {'key-one'|'key.two'|'keyt<>three'} t */
But it looks disgustingly, and I hope there is right way.