I would like to set the avaible values of a functions parameter something like this:
let valueList = [
'val1',
'val2',
'val3',
];
let getSomething = (parameter: valueList) => {
// do something
}
And i want to get error on console if parameter value other than what are in the valueList variable.
And it would be good, if IDE showup the possible values when I call the function as follow:
getSomething(| <- cursor ) // when cursor here, the IDE show the possible values from valueList