title: use object keys as type in typescript
body: <p>consider we have a defined/constant object like below that we want to use it's keys as a type;</p>
  <pre class="lang-js prettyprint-override"><code>const componentDetail = {
    &quot;ejareRaf&quot; : {
      text : &quot;rented&quot;,
      background : &quot;linear-gradient(0deg, rgba(243, 7, 27, 0.6), rgba(243, 7, 27, 0.6));&quot;
    },
    &quot;hamahangBazdid&quot; : {
      text : &quot;visit-set&quot;, 
      background : &quot;rgba(13, 81, 55, 0.6)&quot;
    },
    &quot;onMozakere&quot; : {
      text : &quot;negotitaing&quot;, 
      background : &quot;linear-gradient(0deg, rgba(217, 171, 33, 0.6), rgba(217, 171, 33, 0.6));&quot;
    },
    &quot;dideShod&quot; : {
      text : &quot;seen&quot;, 
      background : &quot;rgba(18, 25, 33, 0.4)&quot;
    },
    &quot;cancelBazdid&quot; : {
      text : &quot;canceled&quot;, 
      background : &quot;rgba(238, 45, 123, 0.3)&quot;
    },
  }
  </code></pre>
  <p>now I want a <code>type</code> deduced from object keys above like this:</p>
  <pre><code>&quot;ejareRaf&quot; | &quot;hamahangBazdid&quot; | &quot;onMozakere&quot; | &quot;dideShod&quot; | &quot;cancelBazdid&quot;
  </code></pre>