I defined a static property as such:
private static colorsByName: { [index: string]: MyColorClass}
but when I try to use for... offrom the answer given here: TypeScript for-in statement
for(let value of MyClass.colorsByName) {
...
}
I get an error message:
Type {[index: string]: MyColorClass; } is not an array type or a string type.
If I switch to use for in, the error will disappear and valuewill be printed as any.
for(let value of MyClass.colorsByName) {
...
}
What is the actual type valuein this case? Ideally, I would like to iterate over all the values in the colorsByName property, either in pairs, or just get the return types MyColorClass.
for(let value of MyClass.colorsByName) {
}
What are my options?
Daryl source
share