Is there a way for me to set up this correctly? https://i.sstatic.net/dn75F.png
I am trying to document the id
property using the static classes _Test.list
,
but I can't seem to find the right method with intellisense in vscode.
So any number not coming from the _Test.list
dictionary should throw an error.
https://i.sstatic.net/Ml2HP.png
Can anyone help me format this properly with jsdoc, please? I apologize if this is a beginner question, as I'm just starting out with jsdoc.
class _Test {
static list = { a:1,b:2,c:3 };
constructor() {
/**
* @typedef {Object} DATA
* @property {_Test.list} DATA.id - id from list _Test.list
* @property {_Test.list} DATA.id2 - id from list _Test.list
*
*/
/**@type {DATA} */
this.list = {
id: _Test.list.a, // should work fine
id2: 14, // should display an error
}
}
};
I want to continue like this because I need to maintain reference features in vscode. https://i.sstatic.net/ZiD67.png