What does "keyof typeof" mean in TypeScript? : <p>Example:</p>

<p>Explain to me what <code>keyof typeof</code> means in TypeScript</p>

<pre><code>enum ColorsEnum {
    white = '#ffffff',
    black = '#000000',
}

type Colors = keyof typeof ColorsEnum;
</code></pre>

<p>The last row is equivalent to:</p>

<pre><code>type Colors = "white" | "black"
</code></pre>

<p>But how does it work?</p>

<p>I would expect <code>typeof ColorsEnum</code> to return something like <code>"Object"</code> and then <code>keyof "Object"</code> to not do anything interesting. But I am obviously wrong.</p>
