How to Iterate Over String Indexed Array In TypeScript?
<p>I have defined a static property as such:</p>

<pre class="lang-js prettyprint-override"><code>private static colorsByName: { [index: string]: MyColorClass}
</code></pre>

<p>but when I attempt to use <code>for... of</code> from the answer listed here: <a href="https://stackoverflow.com/questions/12950681/typescript-for-in-statement">TypeScript for-in statement</a></p>

<pre><code>for(let value of MyClass.colorsByName) {
    ...
}
</code></pre>

<p>I get an error:</p>

<blockquote>
  <p>Type { [index: string]: MyColorClass; } is not an array type or a string type.</p>
</blockquote>

<p>If I switch over to using <code>for in</code>, the error goes away, but <code>value</code> is typed as <code>any</code>.  </p>

<pre><code>for(let value of MyClass.colorsByName) {
    ...
}
</code></pre>

<p>What is the actual type of <code>value</code> in this case?  Ideally I'd like to loop through all values in the colorsByName property, either in a  pair approach, or just to get <code>MyColorClass</code> types returned.  </p>

<pre><code>for(let value of MyClass.colorsByName) {
    // value: MyColorClass
}
</code></pre>

<p>What are my options?</p>